Showing
7 changed files
with
10 additions
and
10 deletions
... | ... | @@ -3,5 +3,5 @@ package org.thingsboard.server.common.data.yunteng.config.sms; |
3 | 3 | import java.util.LinkedHashMap; |
4 | 4 | |
5 | 5 | public interface SmsSender { |
6 | - String sendSms(String phone, String templateCode, LinkedHashMap<String,String> param,String signName); | |
6 | + String sendSms(String phone, String templateCode, LinkedHashMap<String,Object> param,String signName); | |
7 | 7 | } | ... | ... |
... | ... | @@ -47,7 +47,7 @@ public class AliSmsSender extends AbstractSmsSender { |
47 | 47 | |
48 | 48 | @Override |
49 | 49 | public String sendSms( |
50 | - String phone, String templateCode, LinkedHashMap<String, String> param, String signName) { | |
50 | + String phone, String templateCode, LinkedHashMap<String, Object> param, String signName) { | |
51 | 51 | validatePhoneNumber(phone); |
52 | 52 | IAcsClient client = new DefaultAcsClient(profile); |
53 | 53 | SendSmsRequest request = new SendSmsRequest(); | ... | ... |
... | ... | @@ -13,7 +13,7 @@ public class TencentSmsSender extends AbstractSmsSender { |
13 | 13 | |
14 | 14 | @Override |
15 | 15 | public String sendSms( |
16 | - String phone, String templateCode, LinkedHashMap<String, String> param, String signName) { | |
16 | + String phone, String templateCode, LinkedHashMap<String, Object> param, String signName) { | |
17 | 17 | return ""; |
18 | 18 | } |
19 | 19 | } | ... | ... |
... | ... | @@ -11,7 +11,7 @@ import java.util.LinkedHashMap; |
11 | 11 | public class SmsReqDTO { |
12 | 12 | |
13 | 13 | /** 模板参数 */ |
14 | - private LinkedHashMap<String, String> params; | |
14 | + private LinkedHashMap<String, Object> params; | |
15 | 15 | |
16 | 16 | /** 手机号码 */ |
17 | 17 | @Pattern(regexp = FastIotConstants.MOBILE, message = "请输入正确的手机号") | ... | ... |
... | ... | @@ -563,7 +563,7 @@ public class SysUserServiceImpl extends AbstractBaseService<UserMapper, SysUserE |
563 | 563 | SmsReqDTO smsReqDTO = new SmsReqDTO(); |
564 | 564 | smsReqDTO.setPhoneNumbers(user.getPhoneNumber()); |
565 | 565 | smsReqDTO.setId(templateDTOList.get(0).getId()); |
566 | - LinkedHashMap<String, String> params = new LinkedHashMap<>(); | |
566 | + LinkedHashMap<String, Object> params = new LinkedHashMap<>(); | |
567 | 567 | params.put("code", accountProperties.getDefaultPassword()); |
568 | 568 | smsReqDTO.setParams(params); |
569 | 569 | smsReqDTO.setTemplatePurpose(messageTemplateDTO.getTemplatePurpose()); | ... | ... |
... | ... | @@ -139,7 +139,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
139 | 139 | SmsReqDTO info = new SmsReqDTO(); |
140 | 140 | info.setId(templateId); |
141 | 141 | info.setTemplatePurpose(MsgTemplatePurposeEnum.FOR_ALARM_NOTICE.name()); |
142 | - LinkedHashMap<String, String> params = new LinkedHashMap<>(); | |
142 | + LinkedHashMap<String, Object> params = new LinkedHashMap<>(); | |
143 | 143 | //name-其他;device_name-其他;level-其他;location-其他;alarm_value-其他; |
144 | 144 | params.put("type", alarmInfo.getType()); |
145 | 145 | params.put("device_name", alarmInfo.getDeviceName()); |
... | ... | @@ -201,7 +201,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
201 | 201 | // TODO 推送钉钉消息 |
202 | 202 | SmsReqDTO info = new SmsReqDTO(); |
203 | 203 | info.setId(templateId); |
204 | - LinkedHashMap<String, String> params = new LinkedHashMap<>(); | |
204 | + LinkedHashMap<String, Object> params = new LinkedHashMap<>(); | |
205 | 205 | //name-其他;device_name-其他;level-其他;location-其他;alarm_value-其他; |
206 | 206 | params.put("type", alarmInfo.getType()); |
207 | 207 | params.put("device_name", alarmInfo.getDeviceName()); |
... | ... | @@ -231,7 +231,7 @@ public class TkNoticeServiceImpl implements TkNoticeService { |
231 | 231 | // TODO 推送微信通知 |
232 | 232 | SmsReqDTO info = new SmsReqDTO(); |
233 | 233 | info.setId(templateId); |
234 | - LinkedHashMap<String, String> params = new LinkedHashMap<>(); | |
234 | + LinkedHashMap<String, Object> params = new LinkedHashMap<>(); | |
235 | 235 | //name-其他;device_name-其他;level-其他;location-其他;alarm_value-其他; |
236 | 236 | params.put("type", alarmInfo.getType()); |
237 | 237 | params.put("device_name", alarmInfo.getDeviceName()); | ... | ... |
... | ... | @@ -58,7 +58,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
58 | 58 | @Transactional |
59 | 59 | public boolean sendSms(SmsReqDTO smsReqDTO) { |
60 | 60 | String phoneNumbers = smsReqDTO.getPhoneNumbers(); |
61 | - LinkedHashMap<String, String> templateParam = smsReqDTO.getParams(); | |
61 | + LinkedHashMap<String, Object> templateParam = smsReqDTO.getParams(); | |
62 | 62 | String templateId = smsReqDTO.getId(); |
63 | 63 | if (StringUtils.isEmpty(phoneNumbers) || StringUtils.isEmpty(templateId)) { |
64 | 64 | throw new TkDataValidationException(ErrorMessage.INVALID_PARAMETER.getMessage()); |
... | ... | @@ -200,7 +200,7 @@ public class TkSmsServiceImpl implements TkSmsService { |
200 | 200 | } |
201 | 201 | |
202 | 202 | String code = RandomStringUtils.randomNumeric(6); |
203 | - LinkedHashMap<String, String> params = new LinkedHashMap<>(); | |
203 | + LinkedHashMap<String, Object> params = new LinkedHashMap<>(); | |
204 | 204 | params.put("code", code); |
205 | 205 | SmsReqDTO smsReqDTO = new SmsReqDTO(); |
206 | 206 | smsReqDTO.setParams(params); | ... | ... |