fix 修复 短信功能返回实体 SysSms 序列化问题
This commit is contained in:
parent
ac1d7aa69f
commit
15d5eb858c
@ -56,7 +56,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.sms.core;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import com.ruoyi.common.utils.JsonUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import com.ruoyi.sms.config.properties.SmsProperties;
|
||||
import com.ruoyi.sms.entity.SmsResult;
|
||||
@ -65,7 +66,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());
|
||||
|
@ -24,6 +24,8 @@ public class SmsResult {
|
||||
|
||||
/**
|
||||
* 实际响应体
|
||||
* <p>
|
||||
* 可自行转换为 SDK 对应的 SendSmsResponse
|
||||
*/
|
||||
private Object response;
|
||||
private String response;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user