github.com/SupenBysz/gf-admin-community@v0.7.4/sys_service/sys_mail.go (about)

     1  // ================================================================================
     2  // Code generated and maintained by GoFrame CLI tool. DO NOT EDIT.
     3  // You can delete these comments if you wish manually maintain this interface file.
     4  // ================================================================================
     5  
     6  package sys_service
     7  
     8  import (
     9  	"context"
    10  
    11  	"github.com/kysion/base-library/base_model/base_enum"
    12  )
    13  
    14  type (
    15  	ISysMails interface {
    16  		// SendCaptcha 发送邮件验证码
    17  		SendCaptcha(ctx context.Context, mailTo string, typeIdentifier int) (res bool, err error)
    18  		// Verify 校验验证码
    19  		Verify(ctx context.Context, email string, captcha string, typeIdentifier ...base_enum.CaptchaType) (bool, error)
    20  	}
    21  )
    22  
    23  var (
    24  	localSysMails ISysMails
    25  )
    26  
    27  func SysMails() ISysMails {
    28  	if localSysMails == nil {
    29  		panic("implement not found for interface ISysMails, forgot register?")
    30  	}
    31  	return localSysMails
    32  }
    33  
    34  func RegisterSysMails(i ISysMails) {
    35  	localSysMails = i
    36  }