|
|
|
@ -185,26 +185,16 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public String sendOpenSms(String phoneNumber, String nationCode) {
|
|
|
|
|
String reidsCheckCodeKey = getRegisterClientRedisKey(phoneNumber);
|
|
|
|
|
String value = stringRedisTemplate.boundValueOps(reidsCheckCodeKey).get();
|
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
|
|
throw new BadRequestException("SMS has been sent,Please check your messages or try again in 3 minutes.");
|
|
|
|
|
}
|
|
|
|
|
public void sendOpenSms(String phoneNumber, String nationCode) {
|
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
String registerClientCode = RandomStringUtils.random(6, false, true);
|
|
|
|
|
param.add("RoyalPay");
|
|
|
|
|
param.add(registerClientCode);
|
|
|
|
|
String expireMin = "3";
|
|
|
|
|
param.add(expireMin);
|
|
|
|
|
String phone_Number = phoneNumber.substring(0, 3) + "****" + phoneNumber.substring(7, phoneNumber.length());
|
|
|
|
|
param.add(phone_Number);
|
|
|
|
|
try {
|
|
|
|
|
smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", "");
|
|
|
|
|
smsSender.getSender().sendWithParam(nationCode.trim(), phoneNumber, 462770, param, "RoyalPay", "", "");
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
e.printStackTrace();
|
|
|
|
|
throw new ServerErrorException("Phone number is wrong Please try again");
|
|
|
|
|
}
|
|
|
|
|
stringRedisTemplate.boundValueOps(getRegisterClientRedisKey(phoneNumber)).set(registerClientCode, Long.parseLong(expireMin), TimeUnit.MINUTES);
|
|
|
|
|
return registerClientCode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|