Преглед изворни кода

fix response success

fix send verification
tags/24080901
niohe·erbao пре 1 година
родитељ
комит
2992a5ef78
2 измењених фајлова са 6 додато и 3 уклоњено
  1. +2
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java
  2. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java

+ 2
- 1
pmapi/src/main/java/com/ningdatech/pmapi/common/handler/GlobalResponseHandler.java Прегледај датотеку

@@ -24,7 +24,8 @@ import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
"com.ningdatech.pmapi.todocenter.controller",
"com.ningdatech.pmapi.user.controller",
"com.ningdatech.pmapi.meeting.controller",
"com.ningdatech.pmapi.expert.controller"
"com.ningdatech.pmapi.expert.controller",
"com.ningdatech.pmapi.sms.controller"
})
public class GlobalResponseHandler implements ResponseBodyAdvice<Object> {



+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/sms/manage/SmsManage.java Прегледај датотеку

@@ -82,8 +82,10 @@ public class SmsManage {

cachePlusOps.set(new CacheKey(cacheKey, Duration.ofMinutes(verificationCodeTypeEnum.getExpireTime())), cache);
String limitKey = SmsRedisKeyUtils.smsSendLimitKey(verificationCodeTypeEnum, request.getMobile());
if (StringUtils.isNotBlank(cachePlusOps.get(limitKey))) {
long limitCount = cachePlusOps.incr(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())));
if (Objects.nonNull(cachePlusOps.get(limitKey))) {
Integer limitCount = cachePlusOps.get(limitKey);
cachePlusOps.set(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), limitCount++);
// long limitCount = cachePlusOps.incr(new CacheKey(limitKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())));
// 超出单日发送次数之后直接锁定
if (limitCount >= verificationCodeTypeEnum.getSendTimesByDay().longValue()) {
cachePlusOps.set(new CacheKey(lockKey, Duration.ofSeconds(DateUtil.restSecondsFromNowToNoon())), request.getMobile());


Loading…
Откажи
Сачувај