浏览代码

!225 新增删除Hash中的某条数据
Merge pull request !225 from runphp/N/A

若依 3 年之前
父节点
当前提交
e7b9e12d15

+ 12 - 0
ruoyi-common/ruoyi-common-redis/src/main/java/com/ruoyi/common/redis/service/RedisService.java

@@ -244,6 +244,18 @@ public class RedisService
     }
 
     /**
+     * 删除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));
+    }
+
+    /**
      * 获得缓存的基本对象列表
      * 
      * @param pattern 字符串前缀