This commit is contained in:
孟帅
2023-07-20 18:01:10 +08:00
parent 9113fc5297
commit 373d9627fb
492 changed files with 12170 additions and 6982 deletions

View File

@@ -4,15 +4,12 @@ import (
"context"
"fmt"
"hotgo/internal/consts"
"hotgo/internal/library/sms/aliyun"
"hotgo/internal/library/sms/tencent"
"hotgo/internal/model"
"hotgo/internal/model/input/sysin"
)
// Drive 短信驱动
type Drive interface {
SendCode(ctx context.Context, in sysin.SendCodeInp, config *model.SmsConfig) (err error)
SendCode(ctx context.Context, in *sysin.SendCodeInp) (err error)
}
func New(name ...string) Drive {
@@ -27,9 +24,9 @@ func New(name ...string) Drive {
switch instanceName {
case consts.SmsDriveAliYun:
drive = &aliyun.Handle
drive = &AliYunDrive{}
case consts.SmsDriveTencent:
drive = &tencent.Handle
drive = &TencentDrive{}
default:
panic(fmt.Sprintf("暂不支持短信驱动:%v", instanceName))
}