From 4ae26c2f8676ba73f1e17932ea03e7d581bd82af Mon Sep 17 00:00:00 2001 From: runphp Date: Thu, 4 Aug 2022 01:39:58 +0000 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 --- .../com/ruoyi/common/redis/service/RedisService.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java b/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java index 82efb9b1d..64cc7027c 100644 --- a/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java +++ b/ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java @@ -243,6 +243,18 @@ public class RedisService 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)); + } + /** * 获得缓存的基本对象列表 *