fix 修复 远程调用短信功能返回实体 SysSms 序列化报错问题

2.X
疯狂的狮子li 3 years ago
parent aa5ea44dde
commit f0102b857d

@ -26,7 +26,9 @@ public class SysSms implements Serializable {
/**
*
* <p>
* SDK SendSmsResponse
*/
private Object response;
private String response;
}

@ -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());

@ -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());

Loading…
Cancel
Save