Closed gotoxu closed 6 years ago
新的SDK代码在yunpian文件夹下,请评审。 新接口的调用方式,以发送单个SMS短信为例:
yunpian
cfg := DefaultConfig().WithAPIKey("" /*you api key*/) sms := NewClient(cfg).SMS() input := &SingleSendRequest{ Mobile: "13800138000", Text: "您的验证码是1234。如非本人操作,请忽略本短信", } resp, err := sms.SingleSend(input) if err != nil { // handle error return } if !resp.IsSuccess() { // 发送失败 return } // 正常业务流程
目前只实现了V2接口,如果需要实现V1接口,请自行实现。 由于我没有测试API KEY,因此测试用例不是很齐全,如果需要请自行补齐。
重新合并到develop分支中,请到这里查看
develop
新的SDK代码在
yunpian
文件夹下,请评审。 新接口的调用方式,以发送单个SMS短信为例:目前只实现了V2接口,如果需要实现V1接口,请自行实现。 由于我没有测试API KEY,因此测试用例不是很齐全,如果需要请自行补齐。