Merge remote-tracking branch 'origin/test' into test

# Conflicts:
#	src/main/java/com/sqx/modules/redisService/impl/RedisServiceImpl.java
This commit is contained in:
张松
2025-01-14 13:39:10 +08:00
4 changed files with 7 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package com.sqx.common.aspect;
import com.sqx.common.annotation.Debounce;
import com.sqx.common.utils.Result;
import com.sqx.common.utils.SpelUtil;
import org.apache.commons.lang3.StringUtils;
import org.aspectj.lang.ProceedingJoinPoint;
@@ -76,7 +77,7 @@ public class DebounceAspect {
return joinPoint.proceed();
}
// 在防抖间隔内,不执行目标方法,直接返回
return null;
return Result.error("请求频繁,请重试");
}
private Object debounceForSpecificValue(ProceedingJoinPoint joinPoint, String methodSignature, long interval, TimeUnit timeUnit, Object targetValue) throws Throwable {
@@ -89,7 +90,7 @@ public class DebounceAspect {
return joinPoint.proceed();
}
// 在防抖间隔内,不执行目标方法,直接返回
return null;
return Result.error("请求频繁,请重试");
}
public void cleanExpiredRecords() {

View File

@@ -44,9 +44,8 @@ public class AppUserPrizeExchangeController {
@PostMapping("/exchange")
@ApiOperation("兑换")
public Result exchange(@RequestAttribute("userId") Long userId, @RequestBody UserPrizeExchange entity) {
//userPrizeExchangeService.exchange(userId, entity);
//return Result.success();
return Result.error("奖品正在路上,请耐心等待");
userPrizeExchangeService.exchange(userId, entity);
return Result.success();
}
@Login

View File

@@ -88,7 +88,7 @@ public class WuyouController {
return Result.error("订单已支付");
}
if (redisService.setCreateOrderFlagAndCheckLimit(order.getUserId(), orderId)) {
userService.addBlackUser(order.getUserId(), "一分钟频繁下单超12次");
userService.addBlackUser(order.getUserId(), "一分钟频繁下单超22次");
}
PayDetails payDetails = payDetailsDao.selectByOrderId(order.getOrdersNo());

View File

@@ -353,6 +353,6 @@ public class RedisServiceImpl implements RedisService {
String key = "createOrder:" + userId + ":" + orderId;
redisTemplate.opsForValue().set(key, orderId.toString(), 60, TimeUnit.SECONDS);
Set<String> keys = redisTemplate.keys("createOrder:" + userId + ":*");
return keys != null && keys.size() > 12;
return keys != null && keys.size() > 22;
}
}