|
@@ -25,6 +25,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.Collections;
|
|
|
import java.util.List;
|
|
|
import java.util.Set;
|
|
|
|
|
@@ -119,17 +120,32 @@ public class CommentServiceImpl extends ServiceImpl<CommentMapper, CommentEntity
|
|
|
public Result<CommentVo> voListTree(PageDateDto param, Integer display) {
|
|
|
// startPage(param);
|
|
|
|
|
|
- BaseUtil.startPage(param);
|
|
|
- List<CommentVo> search = baseMapper.search(param, display);
|
|
|
+// BaseUtil.startPage(param);
|
|
|
+// List<CommentVo> search = baseMapper.search(param, display);
|
|
|
+//
|
|
|
+// Set<Object> filterKey = sensitiveService.getFilterKey();
|
|
|
+// CommentTreeUtil commentTreeUtil = new CommentTreeUtil(search, filterKey);
|
|
|
+// List<CommentTree> commentTrees = commentTreeUtil.buildTree();
|
|
|
|
|
|
- Set<Object> filterKey = sensitiveService.getFilterKey();
|
|
|
- CommentTreeUtil commentTreeUtil = new CommentTreeUtil(search, filterKey);
|
|
|
- List<CommentTree> commentTrees = commentTreeUtil.buildTree();
|
|
|
|
|
|
// PageInfo<CommentTree> page = new PageInfo<>(commentTrees);
|
|
|
// return Result.success(page);
|
|
|
+
|
|
|
+
|
|
|
+ Page<CommentVo> voPage = baseMapper.pageSearch(param, display, iBaseService.initPage(param));
|
|
|
+ List<CommentVo> records = voPage.getRecords();
|
|
|
+ Set<Object> filterKey = sensitiveService.getFilterKey();
|
|
|
+ CommentTreeUtil commentTreeUtil = new CommentTreeUtil(records, filterKey);
|
|
|
+ List<CommentTree> commentTrees = commentTreeUtil.buildTree();
|
|
|
+
|
|
|
+ // 转换分页
|
|
|
+ Page<Object> resPage = new Page<>();
|
|
|
+ BeanUtils.copyProperties(voPage, resPage);
|
|
|
+ resPage.setRecords(Collections.singletonList(commentTrees));
|
|
|
+
|
|
|
+
|
|
|
// todo 2022-08-12
|
|
|
- return Result.success();
|
|
|
+ return Result.success(resPage);
|
|
|
}
|
|
|
|
|
|
@Override
|