| File was renamed from oying-tools/src/main/java/com/oying/utils/SendMessageUtils.java |
| | |
| | | package com.oying.utils; |
| | | package com.oying.modules.security.utils; |
| | | |
| | | import cn.hutool.core.util.IdUtil; |
| | | import com.oying.exception.BadRequestException; |
| | | import com.oying.utils.HttpRequest; |
| | | import lombok.Data; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.http.HttpMethod; |
| | |
| | | @Data |
| | | public class SendMessageUtils { |
| | | |
| | | public static final String SIGN = "【立研】"; |
| | | public static final String SIGN = "【哦应科技】"; |
| | | public static final String MESSAGE = "您的验证码为:{code},请勿泄露于他人!"; |
| | | public static void main(String[] args) { |
| | | System.out.println(IdUtil.simpleUUID()); |
| | | Map<String, String> params = new HashMap<>(); |
| | | params.put("userCode", "SHOYYJ"); |
| | | params.put("userPass", "Oy250928"); |
| | | params.put("DesNo", "15213186640"); |
| | | params.put("Msg", "【哦应科技】您的验证码为:784121,请勿泄露于他人!"); |
| | | params.put("smsType", "101"); |
| | | String str = extractWithRegex(HttpRequest.exchangeMsg(HttpMethod.POST, "https://118.178.116.15:8443/winnerrxd/api/trigger/SendMsg", convert(params))); |
| | | if (ObjectUtils.isEmpty(str)) { |
| | | log.error("短信调用异常 {}", str); |
| | | throw new BadRequestException("短信调用异常"); |
| | | } |
| | | long i = Long.parseLong(str); |
| | | if (i < 0) { |
| | | throw new BadRequestException(WinnerLookEnum.find(str)); |
| | | } |
| | | } |
| | | |
| | | public static void sendMsg(String url, String phone, String sign, String message, WinnerLookProperties properties) { |
| | | Map<String, String> params = new HashMap<>(); |