fix 修复 短信功能返回实体 SysSms 序列化问题

feature/model
疯狂的狮子li 2 years ago
parent ac1d7aa69f
commit 15d5eb858c

@ -56,7 +56,7 @@ public class AliyunSmsTemplate implements SmsTemplate {
return SmsResult.builder() return SmsResult.builder()
.isSuccess("OK".equals(resp.getBody().getCode())) .isSuccess("OK".equals(resp.getBody().getCode()))
.message(resp.getBody().getMessage()) .message(resp.getBody().getMessage())
.response(resp) .response(JsonUtils.toJsonString(resp))
.build(); .build();
} catch (Exception e) { } catch (Exception e) {
throw new SmsException(e.getMessage()); throw new SmsException(e.getMessage());

@ -2,6 +2,7 @@ package com.ruoyi.sms.core;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ArrayUtil; import cn.hutool.core.util.ArrayUtil;
import com.ruoyi.common.utils.JsonUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.sms.config.properties.SmsProperties; import com.ruoyi.sms.config.properties.SmsProperties;
import com.ruoyi.sms.entity.SmsResult; import com.ruoyi.sms.entity.SmsResult;
@ -65,7 +66,7 @@ public class TencentSmsTemplate implements SmsTemplate {
SmsResult.SmsResultBuilder builder = SmsResult.builder() SmsResult.SmsResultBuilder builder = SmsResult.builder()
.isSuccess(true) .isSuccess(true)
.message("send success") .message("send success")
.response(resp); .response(JsonUtils.toJsonString(resp));
for (SendStatus sendStatus : resp.getSendStatusSet()) { for (SendStatus sendStatus : resp.getSendStatusSet()) {
if (!"Ok".equals(sendStatus.getCode())) { if (!"Ok".equals(sendStatus.getCode())) {
builder.isSuccess(false).message(sendStatus.getMessage()); builder.isSuccess(false).message(sendStatus.getMessage());

@ -24,6 +24,8 @@ public class SmsResult {
/** /**
* *
* <p>
* SDK SendSmsResponse
*/ */
private Object response; private String response;
} }

Loading…
Cancel
Save