From c19bb1e75d6767cd5173f714dbabe14b4cc0cbd7 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 26 Mar 2022 17:26:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BC=93=E5=AD=98=E5=88=A0?= =?UTF-8?q?=E9=99=A4Hash=E6=95=B0=E6=8D=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/redis/RedisCache.java | 18 +++++++++++++++--- 1 file changed, 15 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..e701bcc 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 @@ import org.springframework.stereotype.Component; /** * spring redis 工具类 - * + * * @author ruoyi **/ @SuppressWarnings(value = { "unchecked", "rawtypes" }) @@ -111,7 +111,7 @@ public class RedisCache * 缓存List数据 * * @param key 缓存的键值 - * @param values 待缓存的List数据 + * @param dataList 待缓存的List数据 * @return 缓存的对象 */ public long setCacheList(final String key, final List dataList) @@ -209,6 +209,18 @@ public class RedisCache return opsForHash.get(key, hKey); } + /** + * 删除Hash中的数据 + * + * @param key + * @param hKey + */ + public void delCacheMapValue(final String key, final String hKey) + { + HashOperations hashOperations = redisTemplate.opsForHash(); + hashOperations.delete(key, hKey); + } + /** * 获取多个Hash中的数据 * @@ -223,7 +235,7 @@ public class RedisCache /** * 获得缓存的基本对象列表 - * + * * @param pattern 字符串前缀 * @return 对象列表 */