Merge remote-tracking branch 'origin/dev' into dev
commit
fdf531ee56
|
@ -49,7 +49,7 @@ public interface HashCache <K, HK, HV> extends DecorationKey<K> {
|
||||||
* @param hashKeyList hash键集合
|
* @param hashKeyList hash键集合
|
||||||
* @return hash值
|
* @return hash值
|
||||||
*/
|
*/
|
||||||
public HV get(K key, HK... hashKeyList);
|
public List<HV> get(K key, HK... hashKeyList);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取hash值集合
|
* 获取hash值集合
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.cache.HashCache;
|
||||||
import com.muyu.common.redis.service.RedisService;
|
import com.muyu.common.redis.service.RedisService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
@ -76,8 +77,9 @@ public abstract class HashCacheAbs<K, HK, HV> implements HashCache<K, HK, HV> {
|
||||||
* @return hash值
|
* @return hash值
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public HV get (K key, HK... hashKeyList) {
|
public List<HV> get (K key, HK... hashKeyList) {
|
||||||
return null;
|
List<String> encodeHashKeyList = Arrays.stream(hashKeyList).map(this::encodeHashKey).toList();
|
||||||
|
return redisService.getMultiCacheMapValue(encode(key), encodeHashKeyList);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -229,7 +229,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<?> hKeys) {
|
||||||
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue