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") @GetMapping("/treeList")
@ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET") @ApiOperation(value = "评论树列表", notes = "评论树列表", httpMethod = "GET")
public AjaxResult treeList(AppDynamicComment appDynamicComment) { public AjaxResult treeList(AppDynamicComment appDynamicComment) {
List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment); //List<AppDynamicCommentVo> list = appDynamicCommentMapper.selectCommentList(appDynamicComment);
startPage(); //startPage();
Map map = appDynamicCommentService.treeList(appDynamicComment); Map map = appDynamicCommentService.treeList(appDynamicComment);
map.put("countNum",list.size()); //map.put("countNum",list.size());
return AjaxResult.success(list); 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> parentList = appDynamicComments.stream().filter(entity -> entity.getParentId() == null).collect(Collectors.toList());
List<AppDynamicCommentVo> srcList = 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("list",buildList(parentList,srcList));
map.put("countNum",appDynamicComments.size());
return map; return map;
} }
public List<AppDynamicCommentVo> buildList(List<AppDynamicCommentVo> parentList,List<AppDynamicCommentVo> srcList){ public List<AppDynamicCommentVo> buildList(List<AppDynamicCommentVo> parentList,List<AppDynamicCommentVo> srcList){