|
|
@@ -34,20 +34,20 @@ public class LitemallNotifyService {
|
|
|
/**
|
|
|
* 短信模版通知
|
|
|
* @param phoneNumber 接收通知的电话号码
|
|
|
- * @param params 通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
|
|
|
* @param notifyType 通知类别,通过该枚举值在配置文件中获取相应的模版ID
|
|
|
+ * @param params 通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
|
|
|
*/
|
|
|
- public void notifySMSTemplate(String phoneNumber, String[] params, NotifyUtils.NotifyType notifyType) {
|
|
|
+ public void notifySMSTemplate(String phoneNumber, NotifyUtils.NotifyType notifyType, String[] params) {
|
|
|
if (!sendSMSEnable)
|
|
|
return;
|
|
|
|
|
|
int templateId = -1;
|
|
|
switch (notifyType) {
|
|
|
- case PAY_COMPLATED:
|
|
|
- templateId = Integer.parseInt(environment.getProperty("spring.sms.template.pay.complated"));
|
|
|
+ case PAY_SUCCEED:
|
|
|
+ templateId = Integer.parseInt(environment.getProperty("spring.sms.template.paySucceed"));
|
|
|
break;
|
|
|
- case VERIFICATIONCODE:
|
|
|
- templateId = Integer.parseInt(environment.getProperty("spring.sms.template.verificationcode"));
|
|
|
+ case CAPTCHA:
|
|
|
+ templateId = Integer.parseInt(environment.getProperty("spring.sms.template.captcha"));
|
|
|
break;
|
|
|
}
|
|
|
|
|
|
@@ -56,6 +56,19 @@ public class LitemallNotifyService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 短信模版通知
|
|
|
+ * @param phoneNumber 接收通知的电话号码
|
|
|
+ * @param templateId 模板ID
|
|
|
+ * @param params 通知模版内容里的参数,类似"您的验证码为{1}"中{1}的值
|
|
|
+ */
|
|
|
+ public void notifySMSTemplate(String phoneNumber, int templateId, String[] params) {
|
|
|
+ if (!sendSMSEnable)
|
|
|
+ return;
|
|
|
+
|
|
|
+ smsSendService.sendSMSWithTemplate(phoneNumber, templateId, params);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 发送邮件通知,接收者在spring.mail.sendto中指定
|
|
|
* @param setSubject 邮件标题
|
|
|
* @param setText 邮件内容
|