From 3f2a477b1c3e4323e9de59fe96b75e69a1fb90d3 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 07 五月 2025 14:45:44 +0800
Subject: [PATCH] mybatiesPlus

---
 src/main/java/com/ruoyi/framework/redis/RedisCache.java |   50 ++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 36 insertions(+), 14 deletions(-)

diff --git a/src/main/java/com/ruoyi/framework/redis/RedisCache.java b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
index e701bcc..121b27b 100644
--- a/src/main/java/com/ruoyi/framework/redis/RedisCache.java
+++ b/src/main/java/com/ruoyi/framework/redis/RedisCache.java
@@ -75,6 +75,28 @@
     }
 
     /**
+     * 鑾峰彇鏈夋晥鏃堕棿
+     *
+     * @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);
+    }
+
+    /**
      * 鑾峰緱缂撳瓨鐨勫熀鏈璞°��
      *
      * @param key 缂撳瓨閿��
@@ -102,9 +124,9 @@
      * @param collection 澶氫釜瀵硅薄
      * @return
      */
-    public long deleteObject(final Collection collection)
+    public boolean deleteObject(final Collection collection)
     {
-        return redisTemplate.delete(collection);
+        return redisTemplate.delete(collection) > 0;
     }
 
     /**
@@ -210,18 +232,6 @@
     }
 
     /**
-     * 鍒犻櫎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閿�
@@ -234,6 +244,18 @@
     }
 
     /**
+     * 鍒犻櫎Hash涓殑鏌愭潯鏁版嵁
+     *
+     * @param key Redis閿�
+     * @param hKey Hash閿�
+     * @return 鏄惁鎴愬姛
+     */
+    public boolean deleteCacheMapValue(final String key, final String hKey)
+    {
+        return redisTemplate.opsForHash().delete(key, hKey) > 0;
+    }
+
+    /**
      * 鑾峰緱缂撳瓨鐨勫熀鏈璞″垪琛�
      *
      * @param pattern 瀛楃涓插墠缂�

--
Gitblit v1.9.3