From ff8206323dc1b88c9373a3ee5cf5cb8e86ef60d0 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: 星期六, 30 七月 2022 14:00:32 +0800
Subject: [PATCH] 支持配置密码最大错误次数/锁定时间

---
 src/main/java/com/ruoyi/framework/redis/RedisCache.java |   40 +++++++++++++++++++++++++++++++++++++---
 1 files changed, 37 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/redis/RedisCache.java b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
index 6157274..1e674db 100644
--- a/src/main/java/com/ruoyi/framework/redis/RedisCache.java
+++ b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
@@ -15,7 +15,7 @@
 
 /**
  * spring redis 宸ュ叿绫�
- * 
+ *
  * @author ruoyi
  **/
 @SuppressWarnings(value = { "unchecked", "rawtypes" })
@@ -59,6 +59,28 @@
     public boolean expire(final String key, final long timeout)
     {
         return expire(key, timeout, TimeUnit.SECONDS);
+    }
+
+    /**
+     * 鑾峰彇鏈夋晥鏃堕棿
+     *
+     * @param key Redis閿�
+     * @return 鏈夋晥鏃堕棿
+     */
+    public long getExpire(final String key)
+    {
+        return redisTemplate.getExpire(key);
+    }
+
+    /**
+     * 鍒ゆ柇 key鏄惁瀛樺湪
+     *
+     * @param key 閿�
+     * @return true 瀛樺湪 false涓嶅瓨鍦�
+     */
+    public Boolean hasKey(String key)
+    {
+        return redisTemplate.hasKey(key);
     }
 
     /**
@@ -111,7 +133,7 @@
      * 缂撳瓨List鏁版嵁
      *
      * @param key 缂撳瓨鐨勯敭鍊�
-     * @param values 寰呯紦瀛樼殑List鏁版嵁
+     * @param dataList 寰呯紦瀛樼殑List鏁版嵁
      * @return 缂撳瓨鐨勫璞�
      */
     public <T> long setCacheList(final String key, final List<T> dataList)
@@ -210,6 +232,18 @@
     }
 
     /**
+     * 鍒犻櫎Hash涓殑鏁版嵁
+     * 
+     * @param key
+     * @param hKey
+     */
+    public void delCacheMapValue(final String key, final String hKey)
+    {
+        HashOperations hashOperations = redisTemplate.opsForHash();
+        hashOperations.delete(key, hKey);
+    }
+
+    /**
      * 鑾峰彇澶氫釜Hash涓殑鏁版嵁
      *
      * @param key Redis閿�
@@ -223,7 +257,7 @@
 
     /**
      * 鑾峰緱缂撳瓨鐨勫熀鏈璞″垪琛�
-     * 
+     *
      * @param pattern 瀛楃涓插墠缂�
      * @return 瀵硅薄鍒楄〃
      */

--
Gitblit v1.9.3