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