From ed3a542066f41c741c37a47aa4a21b1e9b79f219 Mon Sep 17 00:00:00 2001 From: DongZeLiang <2746733890@qq.com> Date: Tue, 8 Oct 2024 16:07:46 +0800 Subject: [PATCH] =?UTF-8?q?feat()=EF=BC=9A=E5=A2=9E=E5=8A=A0=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E4=BB=A3=E7=A0=81=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/muyu/common/redis/service/RedisService.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java b/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java index 73326db..ca98a3d 100644 --- a/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java +++ b/cloud-common/cloud-common-redis/src/main/java/com/muyu/common/redis/service/RedisService.java @@ -235,7 +235,7 @@ public class RedisService { * * @return Hash对象集合 */ - public List getMultiCacheMapValue (final String key, final Collection hKeys) { + public List getMultiCacheMapValue (final String key, final Collection hKeys) { return redisTemplate.opsForHash().multiGet(key, hKeys); } @@ -262,6 +262,16 @@ public class RedisService { return redisTemplate.keys(pattern); } + + /** + * 判断redis中hashKey是否存在 + * @param key redis键 + * @param hashKey hash键 + */ + public boolean hashKey(final String key, final String hashKey){ + return this.redisTemplate.opsForHash().hasKey(key, hashKey); + } + /** * 减少序列值 * @param key key