feat(app): update
This commit is contained in:
@ -145,7 +145,7 @@ func _SendSms() {
|
||||
|
||||
/* 下发手机号码,采用 E.164 标准,+[国家或地区码][手机号]
|
||||
* 示例如:+8613711112222, 其中前面有一个+号 ,86为国家码,13711112222为手机号,最多不要超过200个手机号*/
|
||||
request.PhoneNumberSet = common.StringPtrs([]string{"+8615215229221"})
|
||||
request.PhoneNumberSet = common.StringPtrs([]string{"+8615615156"})
|
||||
|
||||
/* 用户的 session 内容(无需要可忽略): 可以携带用户侧 ID 等上下文信息,server 会原样返回 */
|
||||
request.SessionContext = common.StringPtr("")
|
||||
@ -190,8 +190,6 @@ func _PullStatus() {
|
||||
* 以免泄露密钥对危及您的财产安全。
|
||||
* SecretId、SecretKey 查询: https://console.cloud.tencent.com/cam/capi */
|
||||
credential := common.NewCredential(
|
||||
// os.Getenv("TENCENTCLOUD_SECRET_ID"),
|
||||
// os.Getenv("TENCENTCLOUD_SECRET_KEY"),
|
||||
viper.GetString("tencent.secretId"),
|
||||
viper.GetString("tencent.secretKey"),
|
||||
)
|
||||
@ -235,26 +233,21 @@ func _PullStatus() {
|
||||
request.SmsSdkAppId = common.StringPtr(viper.GetString("tencent.sdkAppId"))
|
||||
/* 拉取最大条数,最多100条 */
|
||||
request.Limit = common.Uint64Ptr(10)
|
||||
PhoneNumber := "+8615215229221"
|
||||
PhoneNumber := "+8645456151141"
|
||||
request.PhoneNumber = &PhoneNumber
|
||||
beginTime := uint64(time.Now().Unix()) - (60 * 60)
|
||||
request.BeginTime = &beginTime
|
||||
Offset := uint64(0)
|
||||
request.Offset = &Offset
|
||||
|
||||
// 通过client对象调用想要访问的接口,需要传入请求对象
|
||||
response, err := client.PullSmsSendStatusByPhoneNumber(request)
|
||||
// 处理异常
|
||||
if _, ok := err.(*errors.TencentCloudSDKError); ok {
|
||||
fmt.Printf("An API error has returned: %s", err)
|
||||
return
|
||||
}
|
||||
// 非SDK异常,直接失败。实际代码中可以加入其他的处理。
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
b, _ := json.Marshal(response.Response)
|
||||
// 打印返回的json字符串
|
||||
fmt.Printf("%s", b)
|
||||
// {"PullSmsSendStatusSet":[{"UserReceiveTime":1695299239,"CountryCode":"86","SubscriberNumber":"15215229221","PhoneNumber":"+8615215229221","SerialNo":"4012:319315169316952992330592922","ReportStatus":"SUCCESS","Description":"DELIVRD","SessionContext":""}],"RequestId":"40476317-2cf4-4c48-bf30-2b33ac14a8b7"}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user