实现商户注册、管理员审核商户申请接口
This commit is contained in:
4
utility/sms/aliyun/aliyun.go
Normal file
4
utility/sms/aliyun/aliyun.go
Normal file
@ -0,0 +1,4 @@
|
||||
package aliyun
|
||||
|
||||
type aliyunClient struct {
|
||||
}
|
||||
21
utility/sms/sms.go
Normal file
21
utility/sms/sms.go
Normal file
@ -0,0 +1,21 @@
|
||||
package sms
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
)
|
||||
|
||||
type SMSClient interface {
|
||||
UploadFile(ctx context.Context, in *model.OssUploadFileInput) (out *model.OssOutput, err error)
|
||||
GetFileURL(ctx context.Context, in *model.OssGetFileInput) (out *model.OssOutput, err error)
|
||||
}
|
||||
|
||||
var clients = make(map[string]SMSClient)
|
||||
|
||||
func Register(name string, client SMSClient) {
|
||||
clients[name] = client
|
||||
}
|
||||
func GetClient(name string) (SMSClient, bool) {
|
||||
client, ok := clients[name]
|
||||
return client, ok
|
||||
}
|
||||
Reference in New Issue
Block a user