Commit 7a346571 authored by jiaorz's avatar jiaorz

Merge branch 'master-vedio-list' into dev

# Conflicts:
#	xx-im/xx-im-server/src/main/java/com/xxfc/platform/im/biz/MsgBiz.java
parents 7778ec8f 082e7a72
...@@ -139,16 +139,16 @@ public class MsgBiz { ...@@ -139,16 +139,16 @@ public class MsgBiz {
} }
query.with(new Sort(Sort.Direction.DESC, "count.praise")); query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId); List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
List<MsgVo> msgVoList = replaceMsgResult(msgList);
Set<Msg> resultList = new HashSet<>(); Set<MsgVo> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(msgList)) { if(CollectionUtils.isNotEmpty(msgVoList)) {
if(number >= msgList.size()) { if(number >= msgVoList.size()) {
return ObjectRestResponse.succ(msgList); return ObjectRestResponse.succ(msgVoList);
} }
Set<Integer> set = new HashSet<>(); Set<Integer> set = new HashSet<>();
RandomUtil.randomSet(msgList.size(), number, set, number); RandomUtil.randomSet(msgVoList.size(), number, set, number);
for(Integer i : set) { for(Integer i : set) {
resultList.add(msgList.get(i)); resultList.add(msgVoList.get(i));
} }
} }
return ObjectRestResponse.succ(resultList); return ObjectRestResponse.succ(resultList);
......
Markdown is supported
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