Commit 4b89704d authored by jiaorz's avatar jiaorz

新增获取视频列表

parent d32e25fe
......@@ -134,21 +134,12 @@ public class MsgBiz {
}
number = number == null ? 10 : number;
Query query = new Query(Criteria.where("body.type").is(4).and("count.praise").gt(getNumber()).and("visible").is(1));
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
if (StringUtils.isNotBlank(messageId)) {
query = new Query(Criteria.where("_id").is(new ObjectId(messageId)));
Msg msg = mongoTemplate.findOne(query, Msg.class, "s_msg");
if (msg != null) {
Iterator<Msg> iterator = msgList.iterator();
while (iterator.hasNext()){
Msg next = iterator.next();
if (next.getId().equals(msg.getId())){
iterator.remove();
}
}
}
query.addCriteria(Criteria.where("_id").ne(new ObjectId(messageId)));
}
query.with(new Sort(Sort.Direction.DESC, "count.praise"));
List<Msg> msgList = fetchAndAttach(mongoTemplate.find(query, Msg.class, "s_msg"), userId);
Set<Msg> resultList = new HashSet<>();
if(CollectionUtils.isNotEmpty(msgList)) {
if(number >= msgList.size()) {
......
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