From b2b21a2ac5175b1086ae6f7eefdb242c12c5310c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E5=87=AF=E5=87=AF?= Date: Tue, 14 Jan 2025 13:37:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=89=93=E5=BC=80=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E5=A5=96=E5=93=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/controller/AppUserPrizeExchangeController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/sqx/modules/app/controller/AppUserPrizeExchangeController.java b/src/main/java/com/sqx/modules/app/controller/AppUserPrizeExchangeController.java index 4b44a3fb..82ff4e6a 100644 --- a/src/main/java/com/sqx/modules/app/controller/AppUserPrizeExchangeController.java +++ b/src/main/java/com/sqx/modules/app/controller/AppUserPrizeExchangeController.java @@ -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 From 466a66186864420272a47069b38ab65d304ee3a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Tue, 14 Jan 2025 13:38:42 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=8B=89=E9=BB=91=E9=99=90=E5=88=B6=E8=A7=84=E5=88=99=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sqx/modules/redisService/impl/RedisServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sqx/modules/redisService/impl/RedisServiceImpl.java b/src/main/java/com/sqx/modules/redisService/impl/RedisServiceImpl.java index 2c37347b..00eef284 100644 --- a/src/main/java/com/sqx/modules/redisService/impl/RedisServiceImpl.java +++ b/src/main/java/com/sqx/modules/redisService/impl/RedisServiceImpl.java @@ -350,10 +350,9 @@ public class RedisServiceImpl implements RedisService { @Override public boolean setCreateOrderFlagAndCheckLimit(Long userId, Long orderId) { - String key = "createOrder:" + userId; - redisTemplate.opsForSet().add(key, orderId.toString()); - redisUtils.expire(key, 60); - Set members = redisTemplate.opsForSet().members(key); - return members != null && members.size() > 12; + String key = "createOrder:" + userId + ":" + orderId; + redisTemplate.opsForValue().set(key, orderId.toString(), 60, TimeUnit.SECONDS); + Set keys = redisTemplate.keys("createOrder:" + userId + ":*"); + return keys != null && keys.size() > 12; } } From e982a06dc3dab282d34403774eb8142aef5e380c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9D=BE?= <8605635+zhang3064194730@user.noreply.gitee.com> Date: Tue, 14 Jan 2025 13:40:18 +0800 Subject: [PATCH 3/3] =?UTF-8?q?ip=E8=B7=B3=E5=8A=A8=E6=AC=A1=E6=95=B0?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 53f06f32..930d7734 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -123,7 +123,7 @@ logging: limit: urlRate: 10 # 同一用户单url每秒限制次数 - ipJumpLimit: 4 # 同一ip每分钟跳动次数 + ipJumpLimit: 6 # 同一ip每分钟跳动次数 # 指定sharding-jdbc雪花算法的工作机器ID snowflake: