From cd510b43b1ef85202ddf9018271aaadf695f3c8d Mon Sep 17 00:00:00 2001
From: hewenqiang <1527468660@qq.com>
Date: 星期二, 25 一月 2022 17:17:06 +0800
Subject: [PATCH] fix 优化登录、注册校验方式,在接口通过@Validated进行数据基础校验,以及服务执行到异常后,抛出异常结束方法执行(减少if-else嵌套)。
---
ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
diff --git a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
index b2d66f5..7d30a18 100644
--- a/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
+++ b/ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java
@@ -9,7 +9,6 @@
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -52,8 +51,8 @@
* 娴嬭瘯lock4j 宸ュ叿
*/
@ApiOperation("娴嬭瘯lock4j 宸ュ叿")
- @GetMapping("/testLock4jLockTemaplate")
- public AjaxResult<String> testLock4jLockTemaplate(String key, String value) {
+ @GetMapping("/testLock4jLockTemplate")
+ public AjaxResult<String> testLock4jLockTemplate(String key, String value) {
final LockInfo lockInfo = lockTemplate.lock(key, 30000L, 5000L, RedissonLockExecutor.class);
if (null == lockInfo) {
throw new RuntimeException("涓氬姟澶勭悊涓�,璇风◢鍚庡啀璇�");
@@ -74,13 +73,4 @@
return AjaxResult.success("鎿嶄綔鎴愬姛", value);
}
- /**
- * 娴嬭瘯spring-cache娉ㄨВ
- */
- @ApiOperation("娴嬭瘯spring-cache娉ㄨВ")
- @Cacheable(value = "test", key = "#key")
- @GetMapping("/testCache")
- public AjaxResult<String> testCache(String key) {
- return AjaxResult.success("鎿嶄綔鎴愬姛", key);
- }
}
--
Gitblit v1.9.3