From 263777aa70ae34b603485cc9358933c70cbc5be9 Mon Sep 17 00:00:00 2001 From: ZhouXY108 Date: Mon, 12 Dec 2022 04:01:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=85=BE=E8=AE=AF=E4=BA=91?= =?UTF-8?q?=E7=9A=84=E8=A7=84=E5=AE=9A=EF=BC=8C=E9=AA=8C=E8=AF=81=E7=A0=81?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E6=98=AF=E7=BA=AF=E6=95=B0=E5=AD=97=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/xyz/zhouxy/plusone/sms/TencentSmsServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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());