mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-13 21:53:41 +08:00
fix:前后端交互优化
This commit is contained in:
@@ -35,6 +35,7 @@ public abstract class AbstractRedisStringCache<IN, OUT> implements BatchCache<IN
|
||||
|
||||
@Override
|
||||
public Map<IN, OUT> getBatch(List<IN> req) {
|
||||
req = req.stream().distinct().collect(Collectors.toList());
|
||||
List<String> keys = req.stream().map(this::getKey).collect(Collectors.toList());
|
||||
List<OUT> valueList = RedisUtils.mget(keys, outClass);
|
||||
List<IN> loadReqs = new ArrayList<>();
|
||||
|
||||
@@ -146,6 +146,7 @@ public class UserServiceImpl implements UserService {
|
||||
return req.getReqList()
|
||||
.stream()
|
||||
.map(a -> batch.containsKey(a.getUid()) ? batch.get(a.getUid()) : SummeryInfoDTO.skip(a.getUid()))
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user