diff --git a/ruoyi-api/ruoyi-api-resource/src/main/java/com/ruoyi/resource/api/domain/SysSms.java b/ruoyi-api/ruoyi-api-resource/src/main/java/com/ruoyi/resource/api/domain/SysSms.java index 4cfba79a..32963040 100644 --- a/ruoyi-api/ruoyi-api-resource/src/main/java/com/ruoyi/resource/api/domain/SysSms.java +++ b/ruoyi-api/ruoyi-api-resource/src/main/java/com/ruoyi/resource/api/domain/SysSms.java @@ -26,7 +26,9 @@ public class SysSms implements Serializable { /** * 实际响应体 + *

+ * 可自行转换为 SDK 对应的 SendSmsResponse */ - private Object response; + private String response; } diff --git a/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/AliyunSmsTemplate.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/AliyunSmsTemplate.java index 7d36aa7e..8624787c 100644 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/AliyunSmsTemplate.java +++ b/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/AliyunSmsTemplate.java @@ -55,7 +55,7 @@ public class AliyunSmsTemplate implements SmsTemplate { return SmsResult.builder() .isSuccess("OK".equals(resp.getBody().getCode())) .message(resp.getBody().getMessage()) - .response(resp) + .response(JsonUtils.toJsonString(resp)) .build(); } catch (Exception e) { throw new SmsException(e.getMessage()); diff --git a/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/TencentSmsTemplate.java b/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/TencentSmsTemplate.java index 0827d10c..f4a3e069 100644 --- a/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/TencentSmsTemplate.java +++ b/ruoyi-common/ruoyi-common-sms/src/main/java/com/ruoyi/common/sms/core/TencentSmsTemplate.java @@ -2,6 +2,7 @@ package com.ruoyi.common.sms.core; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.ArrayUtil; +import com.ruoyi.common.core.utils.JsonUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.common.sms.config.properties.SmsProperties; import com.ruoyi.common.sms.entity.SmsResult; @@ -64,7 +65,7 @@ public class TencentSmsTemplate implements SmsTemplate { SmsResult.SmsResultBuilder builder = SmsResult.builder() .isSuccess(true) .message("send success") - .response(resp); + .response(JsonUtils.toJsonString(resp)); for (SendStatus sendStatus : resp.getSendStatusSet()) { if (!"Ok".equals(sendStatus.getCode())) { builder.isSuccess(false).message(sendStatus.getMessage());