From fb1bac211498a6d5a53c551899dc73ac5a3bed07 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 7 Aug 2022 19:31:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=88=A0=E9=99=A4Hash?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E6=9F=90=E6=9D=A1=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/ruoyi/common/core/redis/RedisCache.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java index 719e9df..03f062e 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/redis/RedisCache.java @@ -255,6 +255,18 @@ public class RedisCache return redisTemplate.opsForHash().multiGet(key, hKeys); } + /** + * 删除Hash中的某条数据 + * + * @param key Redis键 + * @param hKey Hash键 + * @return 是否成功 + */ + public boolean deleteCacheMapValue(final String key, final String hKey) + { + return Boolean.TRUE.equals(redisTemplate.opsForHash().delete(key, hKey)); + } + /** * 获得缓存的基本对象列表 *