diff --git a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/sms/TencentSmsServiceImpl.java b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/sms/TencentSmsServiceImpl.java index f5e265f..7b7d319 100644 --- a/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/sms/TencentSmsServiceImpl.java +++ b/plusone-basic/plusone-basic-infrastructure/src/main/java/xyz/zhouxy/plusone/sms/TencentSmsServiceImpl.java @@ -6,6 +6,8 @@ import com.tencentcloudapi.common.profile.ClientProfile; import com.tencentcloudapi.common.profile.HttpProfile; import com.tencentcloudapi.sms.v20210111.SmsClient; import com.tencentcloudapi.sms.v20210111.models.SendSmsRequest; +import com.tencentcloudapi.sms.v20210111.models.SendSmsResponse; + import org.springframework.stereotype.Service; import lombok.extern.slf4j.Slf4j; @@ -54,11 +56,10 @@ public class TencentSmsServiceImpl implements SmsService { * 通过 client 对象调用 SendSms 方法发起请求。注意请求方法名与请求对象是对应的 返回的 res 是一个 * SendSmsResponse 类的实例,与请求对象对应 */ - // var res = client.SendSms(req); - client.SendSms(req); + var res = client.SendSms(req); // 输出json格式的字符串回包 - // System.out.println(SendSmsResponse.toJsonString(res)); + System.out.println(SendSmsResponse.toJsonString(res)); // 也可以取出单个值,你可以通过官网接口文档或跳转到response对象的定义处查看返回字段的定义 // System.out.println(res.getRequestId());