mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-29 11:51:26 +08:00
【新增】资源管理模块
This commit is contained in:
@@ -5,21 +5,6 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
type AliYun struct {
|
||||
}
|
||||
|
||||
func NewAliYun() *AliYun {
|
||||
return &AliYun{}
|
||||
}
|
||||
|
||||
func (a *AliYun) GetBusiness(key string) Sms {
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AliYun) Send(phone []string, templateParam interface{}) error {
|
||||
panic("implement me")
|
||||
}
|
||||
|
||||
type AliConfig struct {
|
||||
accessKeyId string
|
||||
accessSecret string
|
||||
@@ -36,7 +21,7 @@ func NewAliSms(AliConfig AliConfig) *AliSms {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *AliSms) send(PhoneNumbers, SignName, TemplateCode, TemplateParam string) error {
|
||||
func (a *AliSms) Send(PhoneNumbers, SignName, TemplateCode, TemplateParam string) error {
|
||||
//客户端
|
||||
client, err := dysmsapi.NewClientWithAccessKey(a.config.RegionId, a.config.accessKeyId, a.config.accessSecret)
|
||||
if err != nil {
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
package sms
|
||||
|
||||
type Sms interface {
|
||||
GetBusiness(key string) Sms
|
||||
Send(phone []string, templateParam interface{}) error
|
||||
Send(PhoneNumbers, SignName, TemplateCode, TemplateParam string) error
|
||||
}
|
||||
|
||||
func NewDefaultSms(use string) Sms {
|
||||
switch use {
|
||||
case "AliYun":
|
||||
return NewAliYun()
|
||||
return NewAliSms(AliConfig{})
|
||||
default:
|
||||
panic("sms driver err")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user