|
|
|
@ -12,10 +12,9 @@ import au.com.royalpay.payment.tools.exceptions.BadRequestException;
|
|
|
|
|
import au.com.royalpay.payment.tools.exceptions.ServerErrorException;
|
|
|
|
|
import au.com.royalpay.payment.tools.locale.LocaleSupport;
|
|
|
|
|
import au.com.royalpay.payment.tools.mail.SendMail;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.sms.SmsSingleSender;
|
|
|
|
|
import au.com.royalpay.payment.tools.utils.sms.SmsSingleSenderResult;
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.github.qcloudsms.SmsSingleSender;
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.lang3.RandomStringUtils;
|
|
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
|
@ -55,9 +54,9 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private StringRedisTemplate stringRedisTemplate;
|
|
|
|
|
private final SmsSingleSender smsSingleSender = new SmsSingleSender(appId, appKey);
|
|
|
|
|
// private final int REGISTER_CLIENT_TEMPLID = 126008;//正式
|
|
|
|
|
private final int REGISTER_CLIENT_TEMPLID = 110449;
|
|
|
|
|
private final SmsSingleSender ssender = new SmsSingleSender(appId, appKey);
|
|
|
|
|
// TODO: 2018/5/24 kira
|
|
|
|
|
private final int REGISTER_CLIENT_TEMPLID = 126008;
|
|
|
|
|
private final String REGISTER_CLIENT_PREFIX = "REGISTER_CLIENT";
|
|
|
|
|
private final String REGISTER_CLIENT_PROCESS_PREFIX = "REGISTER_CLIENT_PROCESS";
|
|
|
|
|
private final String VERIFY_MAIL_PREFIX = "VERIFY_MAIL";
|
|
|
|
@ -95,7 +94,6 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
if (StringUtils.isNotEmpty(value)) {
|
|
|
|
|
throw new BadRequestException("SMS has been sent,Please check your messages or try again in 3 minutes.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject sysConfig = sysConfigManager.getSysConfig();
|
|
|
|
|
ArrayList<String> param = new ArrayList<>();
|
|
|
|
|
String registerClientCode = RandomStringUtils.random(6, true, true);
|
|
|
|
@ -103,10 +101,7 @@ public class SimpleClientApplyServiceImpl implements SimpleClientApplyService {
|
|
|
|
|
String expireMin = (String) sysConfig.getOrDefault("sms.verification.code.expire", 3);
|
|
|
|
|
param.add(expireMin);
|
|
|
|
|
try {
|
|
|
|
|
SmsSingleSenderResult result = smsSingleSender.sendWithParam(nationCode, phoneNumber, REGISTER_CLIENT_TEMPLID, param, "", "", "");
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
System.out.println(result);
|
|
|
|
|
ssender.sendWithParam(nationCode, phoneNumber, REGISTER_CLIENT_TEMPLID, param, "RoyalPay", "", ""); //
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
throw new ServerErrorException("System Error");
|
|
|
|
|
}
|
|
|
|
|