feat: 添加支持多个短信服务商支持 添加短信宝服务商支持,同时添加配置示例

This commit is contained in:
whale_fall
2024-01-22 16:38:44 +08:00
parent 09fb2f6557
commit 9c73e16560
11 changed files with 193 additions and 21 deletions

View File

@@ -17,6 +17,7 @@ type AppConfig struct {
ApiConfig ChatPlusApiConfig // ChatPlus API authorization configs
SmsConfig AliYunSmsConfig // AliYun send message service config
OSS OSSConfig // OSS config
SMS SMSConfig // sms config
MjConfigs []MidJourneyConfig // mj AI draw service pool
WeChatBot bool // 是否启用微信机器人
SdConfigs []StableDiffusionConfig // sd AI draw service pool
@@ -71,14 +72,14 @@ type StableDiffusionConfig struct {
Txt2ImgJsonPath string
}
type AliYunSmsConfig struct {
AccessKey string
AccessSecret string
Product string
Domain string
Sign string // 短信签名
CodeTempId string // 验证码短信模板 ID
}
//type AliYunSmsConfig struct {
// AccessKey string
// AccessSecret string
// Product string
// Domain string
// Sign string // 短信签名
// CodeTempId string // 验证码短信模板 ID
//}
type AlipayConfig struct {
Enabled bool // 是否启用该支付通道

25
api/core/types/sms.go Normal file
View File

@@ -0,0 +1,25 @@
package types
type SMSConfig struct {
Active string
ALI AliYunSmsConfig
SMSBAO SmsBaoSmsConfig
}
type AliYunSmsConfig struct {
AccessKey string
AccessSecret string
Product string
Domain string
Sign string // 短信签名
CodeTempId string // 验证码短信模板 ID
}
type SmsBaoSmsConfig struct {
Account string //短信包平台注册的用户名
ApiKey string //apiKey
Domain string //域名
Sign string // 短信签名
CodeTemplate string // 验证码短信模板 匹配
Num string // 实效性
}