Merge remote-tracking branch 'origin/dev' into dev

dev
Yunfei Du 2024-03-30 11:30:27 +08:00
commit fdf531ee56
3 changed files with 6 additions and 4 deletions

View File

@ -49,7 +49,7 @@ public interface HashCache <K, HK, HV> extends DecorationKey<K> {
* @param hashKeyList hash
* @return hash
*/
public HV get(K key, HK... hashKeyList);
public List<HV> get(K key, HK... hashKeyList);
/**
* hash

View File

@ -4,6 +4,7 @@ import com.muyu.common.cache.HashCache;
import com.muyu.common.redis.service.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -76,8 +77,9 @@ public abstract class HashCacheAbs<K, HK, HV> implements HashCache<K, HK, HV> {
* @return hash
*/
@Override
public HV get (K key, HK... hashKeyList) {
return null;
public List<HV> get (K key, HK... hashKeyList) {
List<String> encodeHashKeyList = Arrays.stream(hashKeyList).map(this::encodeHashKey).toList();
return redisService.getMultiCacheMapValue(encode(key), encodeHashKeyList);
}
/**

View File

@ -229,7 +229,7 @@ public class RedisService {
*
* @return Hash
*/
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<Object> hKeys) {
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<?> hKeys) {
return redisTemplate.opsForHash().multiGet(key, hKeys);
}