Commit bd107f65 authored by jiaorz's avatar jiaorz

发现排序

parent e1418f90
...@@ -130,6 +130,7 @@ public class MsgBiz { ...@@ -130,6 +130,7 @@ public class MsgBiz {
for (Msg msg : list) { for (Msg msg : list) {
//添加评论 //添加评论
Query query = new Query(Criteria.where("msgId").is(msg.getId())); Query query = new Query(Criteria.where("msgId").is(msg.getId()));
query.with(new Sort(Sort.Direction.DESC, "time"));
List<Comment> comments = mongoTemplate.find(query, Comment.class, "s_comment"); List<Comment> comments = mongoTemplate.find(query, Comment.class, "s_comment");
msg.setComments(replaceCommentResult(comments)); msg.setComments(replaceCommentResult(comments));
......
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