diff --git a/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageCovDTO.java b/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageCovDTO.java index bcde229..55630ff 100644 --- a/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageCovDTO.java +++ b/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageCovDTO.java @@ -42,6 +42,7 @@ public class SendSmsMessageCovDTO { @AllArgsConstructor @NoArgsConstructor public static class SmsData { + /** * 业务名称 这个字段是用Base64进行加密 */ @@ -53,8 +54,8 @@ public class SendSmsMessageCovDTO { /** * 手机号码集合 这个字段是用Base64进行加密 */ - @JSONField(name = "list") - private List phoneList; + @JSONField(name = "mobile") + private String mobile; } } diff --git a/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageDTO.java b/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageDTO.java index 6306b0e..340ecb3 100644 --- a/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageDTO.java +++ b/src/main/java/com/yuyou/openapi/openapi/model/dto/SendSmsMessageDTO.java @@ -3,8 +3,6 @@ package com.yuyou.openapi.openapi.model.dto; import lombok.Data; -import java.util.List; - /** * @author Enzo * @date @@ -32,6 +30,6 @@ public class SendSmsMessageDTO { /** * 电话号码 */ - private List phoneList; + private String mobile; } diff --git a/src/main/java/com/yuyou/openapi/openapi/model/vo/SendSmsClientMessageVo.java b/src/main/java/com/yuyou/openapi/openapi/model/vo/SendSmsClientMessageVo.java index a922275..3cfcd7a 100644 --- a/src/main/java/com/yuyou/openapi/openapi/model/vo/SendSmsClientMessageVo.java +++ b/src/main/java/com/yuyou/openapi/openapi/model/vo/SendSmsClientMessageVo.java @@ -53,8 +53,8 @@ public class SendSmsClientMessageVo extends ABClientBaseVO implements Serializab /** * 单条记录标识ID */ - @JsonProperty("list") - private List phoneList; + @JsonProperty("mobile") + private String mobile; } diff --git a/src/main/java/com/yuyou/openapi/openapi/task/SendSmsMessageTask.java b/src/main/java/com/yuyou/openapi/openapi/task/SendSmsMessageTask.java index c901ee5..fa2d5d9 100644 --- a/src/main/java/com/yuyou/openapi/openapi/task/SendSmsMessageTask.java +++ b/src/main/java/com/yuyou/openapi/openapi/task/SendSmsMessageTask.java @@ -3,7 +3,6 @@ package com.yuyou.openapi.openapi.task; import cn.hutool.core.codec.Base64; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.RandomUtil; -import cn.hutool.core.util.StrUtil; import cn.hutool.crypto.SecureUtil; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; @@ -26,7 +25,6 @@ import java.time.ZoneOffset; import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.stream.Collectors; /** * @author Enzo @@ -65,16 +63,11 @@ public class SendSmsMessageTask { // 号码解密发送 smsDTO.forEach(item -> { /*List stringList = item.getPhoneList().stream().map(Base64::decodeStr).collect(Collectors.toList());*/ - List stringList = item.getPhoneList().stream().map(phone -> { - if (phone.length() != DefaultConstant.ELEVEN_NUMBER) { - // 去除空字符串 解密 - phone = Base64.decodeStr(phone.replaceAll(StrUtil.SPACE, StrUtil.EMPTY)); - } - return phone; - }).collect(Collectors.toList()); SendSmsMessageCovDTO.SmsData smsData = new SendSmsMessageCovDTO.SmsData(); smsData.setActName(item.getActName()); - smsData.setPhoneList(stringList); + if (item.getMobile().length() != DefaultConstant.ELEVEN_NUMBER) { + smsData.setMobile(Base64.decodeStr(item.getMobile())); + } smsDataList.add(smsData); }); // 进行设置