| | |
| | | String verification = (int) ((Math.random() * 9 + 1) * 100000) + ""; |
| | | redisUtils.set(uuid, verification, time); |
| | | String message = "您的验证码为:" + verification + ",请勿泄露于他人!"; |
| | | SendMessageUtils.sendMsg(phone, message, properties); |
| | | SendMessageUtils.sendMsg(properties.getUrlSendMsg(), phone, message, properties); |
| | | return ResponseEntity.ok(R.success(uuid)); |
| | | } |
| | | } |
| | |
| | | |
| | | winner-look: |
| | | url-send-msg: https://118.178.116.15:8443/winnerrxd/api/trigger/SendMsg |
| | | url-send-msg-batch: https://118.178.116.15:8443/winnerrxd/api/trigger/SendBatchMsg |
| | | user-code: CQLYSXYJ |
| | | user-pass: lych1205! |
| | |
| | | |
| | | winner-look: |
| | | url-send-msg: https://118.178.116.15:8443/winnerrxd/api/trigger/SendMsg |
| | | url-send-msg-batch: https://118.178.116.15:8443/winnerrxd/api/trigger/SendBatchMsg |
| | | user-code: CQLYSXYJ |
| | | user-pass: lych1205! |
| | |
| | | @Data |
| | | public class SendMessageUtils { |
| | | |
| | | public static void sendMsg(String phone, String message, WinnerLookProperties properties) { |
| | | public static void sendMsg(String url, String phone, String message, WinnerLookProperties properties) { |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("userCode", properties.getUserCode()); |
| | | params.put("userPass", properties.getUserPass()); |
| | | params.put("DesNo", phone); |
| | | params.put("Msg", message + "【立研】"); |
| | | params.put("smsType", "101"); |
| | | String str = HttpRequest.exchangeMsg(HttpMethod.POST, properties.getUrlSendMsg(), convert(params)); |
| | | String str = HttpRequest.exchangeMsg(HttpMethod.POST, url, convert(params)); |
| | | if (ObjectUtils.isEmpty(extractWithRegex(str))) { |
| | | log.error("短信调用异常 {}", str); |
| | | throw new BadRequestException("短信调用异常"); |
| | |
| | | public class WinnerLookProperties { |
| | | |
| | | private String urlSendMsg; |
| | | private String urlSendMsgBatch; |
| | | private String userCode; |
| | | private String userPass; |
| | | } |