feat():增加缓存代码示例

dev.saas.RedisCar
DongZeLiang 2024-10-08 16:07:46 +08:00
parent 2a3d68f51d
commit ed3a542066
1 changed files with 11 additions and 1 deletions

View File

@ -235,7 +235,7 @@ public class RedisService {
* *
* @return Hash * @return Hash
*/ */
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<Object> hKeys) { public <T> List<T> getMultiCacheMapValue (final String key, final Collection<String> hKeys) {
return redisTemplate.opsForHash().multiGet(key, hKeys); return redisTemplate.opsForHash().multiGet(key, hKeys);
} }
@ -262,6 +262,16 @@ public class RedisService {
return redisTemplate.keys(pattern); return redisTemplate.keys(pattern);
} }
/**
* redishashKey
* @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 * @param key key