Browse Source

Merge branch 'zx_saas_director_0927' of http://git.dayaedu.com/yonge/mec into test

zouxuan 10 months ago
parent
commit
3a383f22b7

+ 2 - 2
mec-application/src/main/java/com/ym/mec/student/controller/SmsCodeController.java

@@ -44,7 +44,7 @@ public class SmsCodeController extends BaseController {
     @ApiOperation(value = "发送登录短信验证码")
     @ApiImplicitParams({ @ApiImplicitParam(name = "mobile", value = "手机号", required = true, dataType = "String"),
             @ApiImplicitParam(name = "code", value = "验证码", required = true, dataType = "String"),
-            @ApiImplicitParam(name = "type", value = "验证码类型(register  login)", required = true, dataType = "String")})
+            @ApiImplicitParam(name = "type", value = "验证码类型(register  login  director)", required = true, dataType = "String")})
     @PostMapping(value = "/sendSmsCode")
     public HttpResponseResult<Object> sendLoginVerifyCode1(String mobile, String code,String type) throws Exception {
         if(StringUtils.isEmpty(mobile) || StringUtils.isEmpty(code)){
@@ -54,7 +54,7 @@ public class SmsCodeController extends BaseController {
         RBucket<String> bucket = redissonClient.getBucket(redisKey);
         if(bucket.isExists()){
             if(StringUtils.equalsIgnoreCase(bucket.get(),code)){
-                smsCodeService.sendValidCode(mobile,"STUDENT");
+                smsCodeService.sendValidCode(mobile,"STUDENT",StringUtils.isEmpty(type) ? MessageTypeEnum.SMS_VERIFY_CODE_LOGIN.name() : type);
                 return succeed();
             }
         }

+ 1 - 10
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/MessageTypeEnum.java

@@ -15,20 +15,11 @@ public enum MessageTypeEnum implements BaseEnum<String, MessageTypeEnum> {
     PUSH_AUTO_STUDENT_MEMBER_RENEW_MESSAGE("PUSH_AUTO_STUDENT_MEMBER_RENEW_MESSAGE", "会员续费提醒"),
 //    STUDENT_MEMBER_RENEW_QUIT_MESSAGE("STUDENT_MEMBER_RENEW_QUIT_MESSAGE", "会员续费提醒"),
     SMS_VERIFY_CODE_LOGIN("SMS_VERIFY_CODE_LOGIN", "验证码登录"),
+    SMS_VERIFY_CODE_DIRECTOR("SMS_VERIFY_CODE_DIRECTOR", "乐队指导特训营验证码"),
     KAPTCHA_SESSION_KEY("KAPTCHA_SESSION_KEY", "登录图形验证码"),
     SMS_PAYMENT_MESSAGE("SMS_PAYMENT_MESSAGE", "缴费通知"),
     SMS_STANDARD_NO_QUALIFIED("SMS_STANDARD_NO_QUALIFIED", "学习未达标"),
     SMS_STANDARD_QUALIFIED("SMS_STANDARD_QUALIFIED", "学习已达标"),
-//    SMS_PAYMENT_SUCCESS("SMS_PAYMENT_SUCCESS", "缴费成功"),
-//    SMS_RENEW_SUCCESS("SMS_RENEW_SUCCESS", "续费成功"),
-//    SMS_BALANCE_PAY("SMS_BALANCE_PAY", "余额充值"),
-//    SMS_BASICS_SKILL_APPLY_MESSAGE("SMS_BASICS_SKILL_APPLY_MESSAGE", "基础技能训练报名通知"),
-//    SMS_VIP_COURSE_BUY_SUCCESS("SMS_VIP_COURSE_BUY_SUCCESS", "VIP课购买成功"),
-//    SMS_VIP_COURSE_SIGN("SMS_VIP_COURSE_SIGN", "VIP课签到"),
-//    SMS_QUIT_COURSE_SUCCESS("SMS_QUIT_COURSE_SUCCESS", "退课成功"),
-//    SMS_WITHDRAW_SUCCESS("SMS_WITHDRAW_SUCCESS", "提现成功"),
-//    SMS_MUSIC_GROUP_CLOSE("SMS_MUSIC_GROUP_CLOSE", "乐团关闭(关闭后)"),
-
     PUSH_STUDENT_BUY_MEMBER_ACTIVITY("PUSH_STUDENT_BUY_MEMBER_ACTIVITY", "活动购买成功"),
     PUSH_SYSTEM_ACTIVITY_MEMBER("PUSH_SYSTEM_ACTIVITY_MEMBER", "待激活通知"),
     PUSH_STUDENT_BUY_ACTIVITY("PUSH_STUDENT_BUY_ACTIVITY", "活动购买成功"),

+ 2 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/SmsCodeService.java

@@ -17,4 +17,6 @@ public interface SmsCodeService {
 	 * @return
 	 */
 	boolean sendValidCode(String mobile,String jpushType) throws Exception;
+
+	boolean sendValidCode(String mobile, String jpushType, String type);
 }

+ 6 - 2
mec-biz/src/main/java/com/ym/mec/biz/service/impl/SmsCodeServiceImpl.java

@@ -11,7 +11,6 @@ import org.springframework.stereotype.Service;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.biz.dal.entity.SysConfig;
-import com.ym.mec.biz.dal.entity.SysMessage;
 import com.ym.mec.biz.dal.enums.MessageSendMode;
 import com.ym.mec.biz.dal.enums.MessageTypeEnum;
 import com.ym.mec.biz.service.SmsCodeService;
@@ -41,6 +40,11 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 
 	@Override
 	public boolean sendValidCode(String mobile,String jpushType) {
+		return this.sendValidCode(mobile,jpushType,MessageTypeEnum.SMS_VERIFY_CODE_LOGIN.name());
+	}
+
+	@Override
+	public boolean sendValidCode(String mobile, String jpushType, String type) {
 		SysUser sysUser = sysUserFeignService.queryUserByMobile(mobile);
 		Integer userId = -1;
 		if (sysUser != null) {
@@ -59,7 +63,7 @@ public class SmsCodeServiceImpl implements SmsCodeService {
 		if (list != null && list.size() >= times) {
 			throw new BizException("对不起,您发送太频繁请稍后重试!");
 		}
-		sysMessageService.sendSecurityCode(MessageSenderPluginContext.MessageSender.AWSMS, userId, MessageTypeEnum.SMS_VERIFY_CODE_LOGIN, mobile,jpushType);
+		sysMessageService.sendSecurityCode(MessageSenderPluginContext.MessageSender.AWSMS, userId, MessageTypeEnum.valueOf(type), mobile,jpushType);
 		return true;
 	}