This commit is contained in:
2023-07-07 12:52:16 +08:00
parent d44775e87c
commit 8aad406ab0
9 changed files with 57 additions and 41 deletions

View File

@ -141,6 +141,14 @@ public interface RedisService {
*/
Map<Object, Object> hGetAll(String key);
/**
* 获取整个hash结构的大小
*
* @param key key
* @return size
*/
Long hSize(String key);
/**
* 直接设置整个Hash结构
*

View File

@ -102,6 +102,11 @@ public class RedisServiceImpl implements RedisService {
return redisTemplate.opsForHash().entries(addTenantPrefix(key));
}
@Override
public Long hSize(String key) {
return redisTemplate.opsForHash().size(addTenantPrefix(key));
}
@Override
public Boolean hSetAll(String key, Map<String, Object> map, long time) {
String newKey = addTenantPrefix(key);