2 Star 0 Fork 0

TeamsHub/backend-gopkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
aliyunsms.go 712 Bytes
一键复制 编辑 原始数据 按行查看 历史
HCY 提交于 2024-05-10 13:07 . edit pkg
package sms
import (
"gitee.com/wuzheng0709/backend-gopkg/infrastructure/config"
"github.com/aliyun/alibaba-cloud-sdk-go/services/dysmsapi"
)
func SendSms(phone string, infoType string, value string, template string, signame string) (response *dysmsapi.SendSmsResponse, err error) {
client, err := dysmsapi.NewClientWithAccessKey("cn-hangzhou", config.C.Sms.AccessKeyId, config.C.Sms.AccessKeySecret)
request := dysmsapi.CreateSendSmsRequest()
request.PhoneNumbers = phone
request.TemplateCode = template //config.C.Sms.TemplateCode
request.TemplateParam = "{\"" + infoType + "\":\"" + value + "\"}"
request.SignName = signame // "数字土木平台"
response, err = client.SendSms(request)
return
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuzheng0709/backend-gopkg.git
git@gitee.com:wuzheng0709/backend-gopkg.git
wuzheng0709
backend-gopkg
backend-gopkg
v1.4.16

搜索帮助