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