Commit 741e20dc authored by ZhengJie's avatar ZhengJie
Browse files

[代码优化](v2.5): 代码优化

close https://github.com/elunez/eladmin/issues/434
parent 538e7a6e
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
*/ */
package me.zhengjie.utils; package me.zhengjie.utils;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -210,8 +212,10 @@ public class RedisUtils { ...@@ -210,8 +212,10 @@ public class RedisUtils {
* @return * @return
*/ */
public List<Object> multiGet(List<String> keys) { public List<Object> multiGet(List<String> keys) {
Object obj = redisTemplate.opsForValue().multiGet(Collections.singleton(keys)); List list = redisTemplate.opsForValue().multiGet(Sets.newHashSet(keys));
return null; List resultList = Lists.newArrayList();
Optional.ofNullable(list).ifPresent(e-> list.forEach(ele-> Optional.ofNullable(ele).ifPresent(resultList::add)));
return resultList;
} }
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment