修改 aliyun,短信,oss,验证码
This commit is contained in:
22
utility/captcha/captcha.go
Normal file
22
utility/captcha/captcha.go
Normal file
@ -0,0 +1,22 @@
|
||||
package captcha
|
||||
|
||||
import (
|
||||
"context"
|
||||
afs "github.com/alibabacloud-go/afs-20180112/client"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type CaptchaClient interface {
|
||||
Vertify(ctx context.Context, client *afs.Client, in *model.CaptchaIn) (out string, err error)
|
||||
}
|
||||
|
||||
var clients = make(map[string]CaptchaClient)
|
||||
|
||||
func Register(name string, client CaptchaClient) {
|
||||
clients[name] = client
|
||||
}
|
||||
|
||||
func GetClient(name string) (CaptchaClient, bool) {
|
||||
client, ok := clients[name]
|
||||
return client, ok
|
||||
}
|
||||
Reference in New Issue
Block a user