From f9967cca4ca696860986ccd3497bc5687b3544ba Mon Sep 17 00:00:00 2001
From: 疯狂的狮子li <15040126243@163.com>
Date: 星期三, 16 六月 2021 17:41:48 +0800
Subject: [PATCH] fix 移除 Long 序列化为 String 配置 改为由用户自行添加注解

---
 ruoyi-demo/src/main/java/com/ruoyi/demo/controller/RedisLockController.java |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 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 40019fc..c3c71ef 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
@@ -5,6 +5,7 @@
 import com.ruoyi.common.core.redis.RedisLockManager;
 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,7 +53,7 @@
 			if (flag) {
 				log.info("鑾峰彇閿佹垚鍔�: " + key);
 				Thread.sleep(3000);
-				redisLockManager.unLock();
+				redisLockManager.unLock(key);
 				log.info("閲婃斁閿佹垚鍔�: " + key);
 			} else {
 				log.error("鑾峰彇閿佸け璐�: " + key);
@@ -62,4 +63,13 @@
 		}
 		return AjaxResult.success();
 	}
+
+	/**
+	 * 娴嬭瘯spring-cache娉ㄨВ
+	 */
+	@Cacheable(value = "test", key = "#key")
+	@GetMapping("/testCache")
+	public AjaxResult<String> testCache(String key) {
+		return AjaxResult.success("鎿嶄綔鎴愬姛", key);
+	}
 }

--
Gitblit v1.9.3