From 196f6d48d8768243af3eb14c78315200603781c0 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 25 六月 2022 09:40:16 +0800
Subject: [PATCH] 新增缓存列表菜单功能

---
 src/main/java/com/ruoyi/framework/security/service/SysRegisterService.java      |    3 
 src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java  |    4 
 src/main/java/com/ruoyi/common/constant/Constants.java                          |   32 ------
 src/main/java/com/ruoyi/framework/security/service/TokenService.java            |    3 
 src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java |    6 
 sql/ry_20220625.sql                                                             |    8 +
 src/main/java/com/ruoyi/project/monitor/controller/CacheController.java         |   66 +++++++++++++
 src/main/java/com/ruoyi/common/constant/CacheConstants.java                     |   39 +++++++
 src/main/java/com/ruoyi/framework/aspectj/lang/annotation/RateLimiter.java      |    4 
 src/main/java/com/ruoyi/common/utils/DictUtils.java                             |    6 
 src/main/java/com/ruoyi/framework/security/service/SysLoginService.java         |    3 
 src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java   |    6 
 src/main/java/com/ruoyi/project/monitor/domain/SysCache.java                    |   81 ++++++++++++++++
 src/main/java/com/ruoyi/project/common/CaptchaController.java                   |    3 
 14 files changed, 213 insertions(+), 51 deletions(-)

diff --git a/sql/ry_20220613.sql b/sql/ry_20220625.sql
similarity index 98%
rename from sql/ry_20220613.sql
rename to sql/ry_20220625.sql
index 2ec1957..a72c440 100644
--- a/sql/ry_20220613.sql
+++ b/sql/ry_20220625.sql
@@ -176,9 +176,10 @@
 insert into sys_menu values('111',  '鏁版嵁鐩戞帶', '2',   '3', 'druid',      'monitor/druid/index',      '', 1, 0, 'C', '0', '0', 'monitor:druid:list',      'druid',         'admin', sysdate(), '', null, '鏁版嵁鐩戞帶鑿滃崟');
 insert into sys_menu values('112',  '鏈嶅姟鐩戞帶', '2',   '4', 'server',     'monitor/server/index',     '', 1, 0, 'C', '0', '0', 'monitor:server:list',     'server',        'admin', sysdate(), '', null, '鏈嶅姟鐩戞帶鑿滃崟');
 insert into sys_menu values('113',  '缂撳瓨鐩戞帶', '2',   '5', 'cache',      'monitor/cache/index',      '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis',         'admin', sysdate(), '', null, '缂撳瓨鐩戞帶鑿滃崟');
-insert into sys_menu values('114',  '琛ㄥ崟鏋勫缓', '3',   '1', 'build',      'tool/build/index',         '', 1, 0, 'C', '0', '0', 'tool:build:list',         'build',         'admin', sysdate(), '', null, '琛ㄥ崟鏋勫缓鑿滃崟');
-insert into sys_menu values('115',  '浠g爜鐢熸垚', '3',   '2', 'gen',        'tool/gen/index',           '', 1, 0, 'C', '0', '0', 'tool:gen:list',           'code',          'admin', sysdate(), '', null, '浠g爜鐢熸垚鑿滃崟');
-insert into sys_menu values('116',  '绯荤粺鎺ュ彛', '3',   '3', 'swagger',    'tool/swagger/index',       '', 1, 0, 'C', '0', '0', 'tool:swagger:list',       'swagger',       'admin', sysdate(), '', null, '绯荤粺鎺ュ彛鑿滃崟');
+insert into sys_menu values('114',  '缂撳瓨鍒楄〃', '2',   '6', 'cacheList',  'monitor/cache/list',       '', 1, 0, 'C', '0', '0', 'monitor:cache:list',      'redis-list',    'admin', sysdate(), '', null, '缂撳瓨鍒楄〃鑿滃崟');
+insert into sys_menu values('115',  '琛ㄥ崟鏋勫缓', '3',   '1', 'build',      'tool/build/index',         '', 1, 0, 'C', '0', '0', 'tool:build:list',         'build',         'admin', sysdate(), '', null, '琛ㄥ崟鏋勫缓鑿滃崟');
+insert into sys_menu values('116',  '浠g爜鐢熸垚', '3',   '2', 'gen',        'tool/gen/index',           '', 1, 0, 'C', '0', '0', 'tool:gen:list',           'code',          'admin', sysdate(), '', null, '浠g爜鐢熸垚鑿滃崟');
+insert into sys_menu values('117',  '绯荤粺鎺ュ彛', '3',   '3', 'swagger',    'tool/swagger/index',       '', 1, 0, 'C', '0', '0', 'tool:swagger:list',       'swagger',       'admin', sysdate(), '', null, '绯荤粺鎺ュ彛鑿滃崟');
 -- 涓夌骇鑿滃崟
 insert into sys_menu values('500',  '鎿嶄綔鏃ュ織', '108', '1', 'operlog',    'monitor/operlog/index',    '', 1, 0, 'C', '0', '0', 'monitor:operlog:list',    'form',          'admin', sysdate(), '', null, '鎿嶄綔鏃ュ織鑿滃崟');
 insert into sys_menu values('501',  '鐧诲綍鏃ュ織', '108', '2', 'logininfor', 'monitor/logininfor/index', '', 1, 0, 'C', '0', '0', 'monitor:logininfor:list', 'logininfor',    'admin', sysdate(), '', null, '鐧诲綍鏃ュ織鑿滃崟');
@@ -308,6 +309,7 @@
 insert into sys_role_menu values ('2', '114');
 insert into sys_role_menu values ('2', '115');
 insert into sys_role_menu values ('2', '116');
+insert into sys_role_menu values ('2', '117');
 insert into sys_role_menu values ('2', '500');
 insert into sys_role_menu values ('2', '501');
 insert into sys_role_menu values ('2', '1000');
diff --git a/src/main/java/com/ruoyi/common/constant/CacheConstants.java b/src/main/java/com/ruoyi/common/constant/CacheConstants.java
new file mode 100644
index 0000000..7ea15aa
--- /dev/null
+++ b/src/main/java/com/ruoyi/common/constant/CacheConstants.java
@@ -0,0 +1,39 @@
+package com.ruoyi.common.constant;
+
+/**
+ * 缂撳瓨鐨刱ey 甯搁噺
+ * 
+ * @author ruoyi
+ */
+public class CacheConstants
+{
+    /**
+     * 鐧诲綍鐢ㄦ埛 redis key
+     */
+    public static final String LOGIN_TOKEN_KEY = "login_tokens:";
+
+    /**
+     * 楠岃瘉鐮� redis key
+     */
+    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
+
+    /**
+     * 鍙傛暟绠$悊 cache key
+     */
+    public static final String SYS_CONFIG_KEY = "sys_config:";
+
+    /**
+     * 瀛楀吀绠$悊 cache key
+     */
+    public static final String SYS_DICT_KEY = "sys_dict:";
+
+    /**
+     * 闃查噸鎻愪氦 redis key
+     */
+    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
+
+    /**
+     * 闄愭祦 redis key
+     */
+    public static final String RATE_LIMIT_KEY = "rate_limit:";
+}
diff --git a/src/main/java/com/ruoyi/common/constant/Constants.java b/src/main/java/com/ruoyi/common/constant/Constants.java
index 6deff23..2dbdbe6 100644
--- a/src/main/java/com/ruoyi/common/constant/Constants.java
+++ b/src/main/java/com/ruoyi/common/constant/Constants.java
@@ -58,27 +58,7 @@
      * 鐧诲綍澶辫触
      */
     public static final String LOGIN_FAIL = "Error";
-
-    /**
-     * 楠岃瘉鐮� redis key
-     */
-    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
-
-    /**
-     * 鐧诲綍鐢ㄦ埛 redis key
-     */
-    public static final String LOGIN_TOKEN_KEY = "login_tokens:";
-
-    /**
-     * 闃查噸鎻愪氦 redis key
-     */
-    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
-
-    /**
-     * 闄愭祦 redis key
-     */
-    public static final String RATE_LIMIT_KEY = "rate_limit:";
-
+ 
     /**
      * 楠岃瘉鐮佹湁鏁堟湡锛堝垎閽燂級
      */
@@ -123,16 +103,6 @@
      * 鐢ㄦ埛鏉冮檺
      */
     public static final String JWT_AUTHORITIES = "authorities";
-
-    /**
-     * 鍙傛暟绠$悊 cache key
-     */
-    public static final String SYS_CONFIG_KEY = "sys_config:";
-
-    /**
-     * 瀛楀吀绠$悊 cache key
-     */
-    public static final String SYS_DICT_KEY = "sys_dict:";
 
     /**
      * 璧勬簮鏄犲皠璺緞 鍓嶇紑
diff --git a/src/main/java/com/ruoyi/common/utils/DictUtils.java b/src/main/java/com/ruoyi/common/utils/DictUtils.java
index 7432c16..aa7656d 100644
--- a/src/main/java/com/ruoyi/common/utils/DictUtils.java
+++ b/src/main/java/com/ruoyi/common/utils/DictUtils.java
@@ -3,7 +3,7 @@
 import java.util.Collection;
 import java.util.List;
 import com.alibaba.fastjson2.JSONArray;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.utils.spring.SpringUtils;
 import com.ruoyi.framework.redis.RedisCache;
 import com.ruoyi.project.system.domain.SysDictData;
@@ -169,7 +169,7 @@
      */
     public static void clearDictCache()
     {
-        Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(Constants.SYS_DICT_KEY + "*");
+        Collection<String> keys = SpringUtils.getBean(RedisCache.class).keys(CacheConstants.SYS_DICT_KEY + "*");
         SpringUtils.getBean(RedisCache.class).deleteObject(keys);
     }
 
@@ -181,6 +181,6 @@
      */
     public static String getCacheKey(String configKey)
     {
-        return Constants.SYS_DICT_KEY + configKey;
+        return CacheConstants.SYS_DICT_KEY + configKey;
     }
 }
diff --git a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/RateLimiter.java b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/RateLimiter.java
index 722451e..10877ec 100644
--- a/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/RateLimiter.java
+++ b/src/main/java/com/ruoyi/framework/aspectj/lang/annotation/RateLimiter.java
@@ -5,7 +5,7 @@
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.framework.aspectj.lang.enums.LimitType;
 
 /**
@@ -21,7 +21,7 @@
     /**
      * 闄愭祦key
      */
-    public String key() default Constants.RATE_LIMIT_KEY;
+    public String key() default CacheConstants.RATE_LIMIT_KEY;
 
     /**
      * 闄愭祦鏃堕棿,鍗曚綅绉�
diff --git a/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java b/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
index 0ead497..ef335f3 100644
--- a/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
+++ b/src/main/java/com/ruoyi/framework/interceptor/impl/SameUrlDataInterceptor.java
@@ -8,7 +8,7 @@
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
 import com.alibaba.fastjson2.JSON;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.filter.RepeatedlyRequestWrapper;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.common.utils.http.HttpHelper;
@@ -63,7 +63,7 @@
         String submitKey = StringUtils.trimToEmpty(request.getHeader(header));
 
         // 鍞竴鏍囪瘑锛堟寚瀹歬ey + url + 娑堟伅澶达級
-        String cacheRepeatKey = Constants.REPEAT_SUBMIT_KEY + url + submitKey;
+        String cacheRepeatKey = CacheConstants.REPEAT_SUBMIT_KEY + url + submitKey;
 
         Object sessionObj = redisCache.getCacheObject(cacheRepeatKey);
         if (sessionObj != null)
diff --git a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java
index 4ed3967..8f8766c 100644
--- a/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java
+++ b/src/main/java/com/ruoyi/framework/security/service/SysLoginService.java
@@ -7,6 +7,7 @@
 import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
 import org.springframework.security.core.Authentication;
 import org.springframework.stereotype.Component;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.exception.ServiceException;
 import com.ruoyi.common.exception.user.CaptchaException;
@@ -103,7 +104,7 @@
      */
     public void validateCaptcha(String username, String code, String uuid)
     {
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
+        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
         String captcha = redisCache.getCacheObject(verifyKey);
         redisCache.deleteObject(verifyKey);
         if (captcha == null)
diff --git a/src/main/java/com/ruoyi/framework/security/service/SysRegisterService.java b/src/main/java/com/ruoyi/framework/security/service/SysRegisterService.java
index 94234f3..a2fea6a 100644
--- a/src/main/java/com/ruoyi/framework/security/service/SysRegisterService.java
+++ b/src/main/java/com/ruoyi/framework/security/service/SysRegisterService.java
@@ -2,6 +2,7 @@
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.exception.user.CaptchaException;
@@ -100,7 +101,7 @@
      */
     public void validateCaptcha(String username, String code, String uuid)
     {
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
+        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + StringUtils.nvl(uuid, "");
         String captcha = redisCache.getCacheObject(verifyKey);
         redisCache.deleteObject(verifyKey);
         if (captcha == null)
diff --git a/src/main/java/com/ruoyi/framework/security/service/TokenService.java b/src/main/java/com/ruoyi/framework/security/service/TokenService.java
index fbe84a2..2b1c74c 100644
--- a/src/main/java/com/ruoyi/framework/security/service/TokenService.java
+++ b/src/main/java/com/ruoyi/framework/security/service/TokenService.java
@@ -7,6 +7,7 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Component;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.utils.ServletUtils;
 import com.ruoyi.common.utils.StringUtils;
@@ -220,6 +221,6 @@
 
     private String getTokenKey(String uuid)
     {
-        return Constants.LOGIN_TOKEN_KEY + uuid;
+        return CacheConstants.LOGIN_TOKEN_KEY + uuid;
     }
 }
diff --git a/src/main/java/com/ruoyi/project/common/CaptchaController.java b/src/main/java/com/ruoyi/project/common/CaptchaController.java
index b4fb767..b24d873 100644
--- a/src/main/java/com/ruoyi/project/common/CaptchaController.java
+++ b/src/main/java/com/ruoyi/project/common/CaptchaController.java
@@ -12,6 +12,7 @@
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RestController;
 import com.google.code.kaptcha.Producer;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.utils.sign.Base64;
 import com.ruoyi.common.utils.uuid.IdUtils;
@@ -59,7 +60,7 @@
 
         // 淇濆瓨楠岃瘉鐮佷俊鎭�
         String uuid = IdUtils.simpleUUID();
-        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String verifyKey = CacheConstants.CAPTCHA_CODE_KEY + uuid;
 
         String capStr = null, code = null;
         BufferedImage image = null;
diff --git a/src/main/java/com/ruoyi/project/monitor/controller/CacheController.java b/src/main/java/com/ruoyi/project/monitor/controller/CacheController.java
index c3bcc4b..9765ba6 100644
--- a/src/main/java/com/ruoyi/project/monitor/controller/CacheController.java
+++ b/src/main/java/com/ruoyi/project/monitor/controller/CacheController.java
@@ -1,19 +1,25 @@
 package com.ruoyi.project.monitor.controller;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Properties;
+import java.util.Set;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.data.redis.core.RedisCallback;
 import org.springframework.data.redis.core.RedisTemplate;
 import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.DeleteMapping;
 import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.project.monitor.domain.SysCache;
 
 /**
  * 缂撳瓨鐩戞帶
@@ -26,6 +32,16 @@
 {
     @Autowired
     private RedisTemplate<String, String> redisTemplate;
+
+    private final static List<SysCache> caches = new ArrayList<SysCache>();
+    {
+        caches.add(new SysCache(CacheConstants.LOGIN_TOKEN_KEY, "鐢ㄦ埛淇℃伅"));
+        caches.add(new SysCache(CacheConstants.SYS_CONFIG_KEY, "閰嶇疆淇℃伅"));
+        caches.add(new SysCache(CacheConstants.SYS_DICT_KEY, "鏁版嵁瀛楀吀"));
+        caches.add(new SysCache(CacheConstants.CAPTCHA_CODE_KEY, "楠岃瘉鐮�"));
+        caches.add(new SysCache(CacheConstants.REPEAT_SUBMIT_KEY, "闃查噸鎻愪氦"));
+        caches.add(new SysCache(CacheConstants.RATE_LIMIT_KEY, "闄愭祦澶勭悊"));
+    }
 
     @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
     @GetMapping()
@@ -50,4 +66,54 @@
         result.put("commandStats", pieList);
         return AjaxResult.success(result);
     }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @GetMapping("/getNames")
+    public AjaxResult cache()
+    {
+        return AjaxResult.success(caches);
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @GetMapping("/getKeys/{cacheName}")
+    public AjaxResult getCacheKeys(@PathVariable String cacheName)
+    {
+        Set<String> cacheKyes = redisTemplate.keys(cacheName + "*");
+        return AjaxResult.success(cacheKyes);
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @GetMapping("/getValue/{cacheName}/{cacheKey}")
+    public AjaxResult getCacheValue(@PathVariable String cacheName, @PathVariable String cacheKey)
+    {
+        String cacheValue = redisTemplate.opsForValue().get(cacheKey);
+        SysCache sysCache = new SysCache(cacheName, cacheKey, cacheValue);
+        return AjaxResult.success(sysCache);
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @DeleteMapping("/clearCacheName/{cacheName}")
+    public AjaxResult clearCacheName(@PathVariable String cacheName)
+    {
+        Collection<String> cacheKeys = redisTemplate.keys(cacheName + "*");
+        redisTemplate.delete(cacheKeys);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @DeleteMapping("/clearCacheKey/{cacheKey}")
+    public AjaxResult clearCacheKey(@PathVariable String cacheKey)
+    {
+        redisTemplate.delete(cacheKey);
+        return AjaxResult.success();
+    }
+
+    @PreAuthorize("@ss.hasPermi('monitor:cache:list')")
+    @DeleteMapping("/clearCacheAll")
+    public AjaxResult clearCacheAll()
+    {
+        Collection<String> cacheKeys = redisTemplate.keys("*");
+        redisTemplate.delete(cacheKeys);
+        return AjaxResult.success();
+    }
 }
diff --git a/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java b/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java
index 0d955ae..454fa0b 100644
--- a/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java
+++ b/src/main/java/com/ruoyi/project/monitor/controller/SysUserOnlineController.java
@@ -11,7 +11,7 @@
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.utils.StringUtils;
 import com.ruoyi.framework.aspectj.lang.annotation.Log;
 import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
@@ -42,7 +42,7 @@
     @GetMapping("/list")
     public TableDataInfo list(String ipaddr, String userName)
     {
-        Collection<String> keys = redisCache.keys(Constants.LOGIN_TOKEN_KEY + "*");
+        Collection<String> keys = redisCache.keys(CacheConstants.LOGIN_TOKEN_KEY + "*");
         List<SysUserOnline> userOnlineList = new ArrayList<SysUserOnline>();
         for (String key : keys)
         {
@@ -86,7 +86,7 @@
     @DeleteMapping("/{tokenId}")
     public AjaxResult forceLogout(@PathVariable String tokenId)
     {
-        redisCache.deleteObject(Constants.LOGIN_TOKEN_KEY + tokenId);
+        redisCache.deleteObject(CacheConstants.LOGIN_TOKEN_KEY + tokenId);
         return AjaxResult.success();
     }
 }
diff --git a/src/main/java/com/ruoyi/project/monitor/domain/SysCache.java b/src/main/java/com/ruoyi/project/monitor/domain/SysCache.java
new file mode 100644
index 0000000..1417f33
--- /dev/null
+++ b/src/main/java/com/ruoyi/project/monitor/domain/SysCache.java
@@ -0,0 +1,81 @@
+package com.ruoyi.project.monitor.domain;
+
+import com.ruoyi.common.utils.StringUtils;
+
+/**
+ * 缂撳瓨淇℃伅
+ * 
+ * @author ruoyi
+ */
+public class SysCache
+{
+    /** 缂撳瓨鍚嶇О */
+    private String cacheName = "";
+
+    /** 缂撳瓨閿悕 */
+    private String cacheKey = "";
+
+    /** 缂撳瓨鍐呭 */
+    private String cacheValue = "";
+
+    /** 澶囨敞 */
+    private String remark = "";
+
+    public SysCache()
+    {
+
+    }
+
+    public SysCache(String cacheName, String remark)
+    {
+        this.cacheName = cacheName;
+        this.remark = remark;
+    }
+
+    public SysCache(String cacheName, String cacheKey, String cacheValue)
+    {
+        this.cacheName = StringUtils.replace(cacheName, ":", "");
+        this.cacheKey = StringUtils.replace(cacheKey, cacheName, "");
+        this.cacheValue = cacheValue;
+    }
+
+    public String getCacheName()
+    {
+        return cacheName;
+    }
+
+    public void setCacheName(String cacheName)
+    {
+        this.cacheName = cacheName;
+    }
+
+    public String getCacheKey()
+    {
+        return cacheKey;
+    }
+
+    public void setCacheKey(String cacheKey)
+    {
+        this.cacheKey = cacheKey;
+    }
+
+    public String getCacheValue()
+    {
+        return cacheValue;
+    }
+
+    public void setCacheValue(String cacheValue)
+    {
+        this.cacheValue = cacheValue;
+    }
+
+    public String getRemark()
+    {
+        return remark;
+    }
+
+    public void setRemark(String remark)
+    {
+        this.remark = remark;
+    }
+}
diff --git a/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java b/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java
index 1f07ef7..827e75a 100644
--- a/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java
+++ b/src/main/java/com/ruoyi/project/system/service/impl/SysConfigServiceImpl.java
@@ -5,7 +5,7 @@
 import javax.annotation.PostConstruct;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.ruoyi.common.constant.Constants;
+import com.ruoyi.common.constant.CacheConstants;
 import com.ruoyi.common.constant.UserConstants;
 import com.ruoyi.common.core.text.Convert;
 import com.ruoyi.common.exception.ServiceException;
@@ -178,7 +178,7 @@
     @Override
     public void clearConfigCache()
     {
-        Collection<String> keys = redisCache.keys(Constants.SYS_CONFIG_KEY + "*");
+        Collection<String> keys = redisCache.keys(CacheConstants.SYS_CONFIG_KEY + "*");
         redisCache.deleteObject(keys);
     }
 
@@ -218,6 +218,6 @@
      */
     private String getCacheKey(String configKey)
     {
-        return Constants.SYS_CONFIG_KEY + configKey;
+        return CacheConstants.SYS_CONFIG_KEY + configKey;
     }
 }

--
Gitblit v1.9.3