linhw 2024-06-24 16:00:25 +08:00
parent eef6b9d3bd
commit 8ca921e805
2 changed files with 5 additions and 4 deletions

View File

@ -126,10 +126,10 @@ public class AppDynamicCommentController extends BaseController
@GetMapping("/treeList")
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
public AjaxResult treeList(AppDynamicComment appDynamicComment) {
List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment);
startPage();
//List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment);
//startPage();
Map map = appDynamicCommentService.treeList(appDynamicComment);
map.put("countNum",list.size());
return AjaxResult.success(list);
//map.put("countNum",list.size());
return AjaxResult.success(map);
}
}

View File

@ -132,6 +132,7 @@ public class AppDynamicCommentServiceImpl implements IAppDynamicCommentService
List<AppDynamicCommentVo> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
List<AppDynamicCommentVo> srcList = appDynamicComments.stream().filter(entity -> entity.getParentId() != null).collect(Collectors.toList());
map.put("list",buildList(parentList,srcList));
map.put("countNum",appDynamicComments.size());
return map;
}
public List<AppDynamicCommentVo> buildList(List<AppDynamicCommentVo> parentList,List<AppDynamicCommentVo> srcList){