7
0
gaore-common-sdk-go/services/jedi
2020-08-11 18:16:37 +08:00
..
client.go 添加注释 2020-08-11 18:16:37 +08:00
README.md 添加注释 2020-08-11 18:16:37 +08:00
send_sms.go 添加注释 2020-08-11 18:16:37 +08:00
test_demo.go 1.添加Debug信息 2020-08-08 15:09:58 +08:00

发送短信调用示例

import (
    "fmt"
    "golib.gaore.com/GaoreGo/gaore-common-sdk-go/services/jedi"
)

func main() {
    c, err := jedi.NewClientWithAccessKey("accessKeyId", "accessKeySecret", "xxx.xxx.com")
    if err != nil {
        return
    }
    
    req := jedi.CreateSendSmsRequest()
    // sso统一用户名uid 多个用户用逗句隔开
    req.User = "liangzy,liaoks"
    // 公共模板的代码模板
    req.Code = "d7kt5IwP"
    // 模板参数,模板里有多少个模板参数就传入几个替换字符串,
    req.ParamsArray = []string{"www", "线上", "好人"}
    if resp, err := c.SendSms(req); err == nil {
        grlogs.Informational(fmt.Sprintf("%+v", resp.GetHttpContentString()))
    } else {
        grlogs.Error(err)
    }
}