|
@@ -2,6 +2,7 @@ package com.abi.qms.platform.infrastructure.util;
|
|
|
|
|
|
import com.abi.qms.platform.feign.SmsClient;
|
|
import com.abi.qms.platform.feign.SmsClient;
|
|
import com.abi.smscenter.dto.SmsTemplateMsgDto;
|
|
import com.abi.smscenter.dto.SmsTemplateMsgDto;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.stereotype.Component;
|
|
import org.springframework.stereotype.Component;
|
|
@@ -15,6 +16,7 @@ import java.util.UUID;
|
|
* @author AndyTan
|
|
* @author AndyTan
|
|
*/
|
|
*/
|
|
@Component
|
|
@Component
|
|
|
|
+@Slf4j
|
|
public class SmsUtil {
|
|
public class SmsUtil {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -34,7 +36,7 @@ public class SmsUtil {
|
|
smsDto.setPhones(mobile);
|
|
smsDto.setPhones(mobile);
|
|
//uuid
|
|
//uuid
|
|
smsDto.setRequestId(String.valueOf(UUID.randomUUID()));
|
|
smsDto.setRequestId(String.valueOf(UUID.randomUUID()));
|
|
- //qms-codepackage
|
|
|
|
|
|
+ //qms-codepackagesendMobileMsg
|
|
smsDto.setSource(source);
|
|
smsDto.setSource(source);
|
|
//模板code
|
|
//模板code
|
|
smsDto.setTemplateCode(templateCode);
|
|
smsDto.setTemplateCode(templateCode);
|
|
@@ -44,7 +46,10 @@ public class SmsUtil {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
map.put("code", code);
|
|
map.put("code", code);
|
|
smsDto.setParamMap(map);
|
|
smsDto.setParamMap(map);
|
|
- smsClient.sendTemplateMsg(smsDto);
|
|
|
|
|
|
+ try {
|
|
|
|
+ smsClient.sendTemplateMsg(smsDto);
|
|
|
|
+ }catch (Exception e){
|
|
|
|
+ log.warn("发送短信失败,",e);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|