mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/per-boe/java-servers.git
synced 2025-12-09 02:46:50 +08:00
校验
This commit is contained in:
@@ -2,6 +2,7 @@ package com.xboe.module.interaction.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.xboe.common.utils.StringUtil;
|
||||
import com.xboe.module.interaction.dto.CommentsDto;
|
||||
@@ -85,22 +86,16 @@ public class CommentsApi extends ApiBaseController{
|
||||
}
|
||||
List<Comments> list = service.list(objType, objId);
|
||||
|
||||
List<String> ids=new ArrayList<String>();
|
||||
for(Comments c: list) {
|
||||
if(c.getReplys()>0) {
|
||||
ids.add(c.getId());
|
||||
}
|
||||
}
|
||||
// List<String> ids=new ArrayList<String>();
|
||||
// for(Comments c: list) {
|
||||
// if(c.getReplys()>0) {
|
||||
// ids.add(c.getId());
|
||||
// }
|
||||
// }
|
||||
List<String> ids = list.stream().map(Comments::getId).collect(Collectors.toList());
|
||||
List<Comments> replyList = service.findReplysByCommentIds(20, objType, ids);
|
||||
|
||||
for(Comments c: list) {
|
||||
c.setReplyList(new ArrayList<Comments>());
|
||||
for(Comments r: replyList) {
|
||||
if(r.getCommentId().equals(c.getId())) {
|
||||
c.getReplyList().add(r);
|
||||
}
|
||||
}
|
||||
}
|
||||
list.addAll(replyList);
|
||||
return success(list);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user