Merge branch 'rymcu:master' into master

This commit is contained in:
你一个人在这儿干嘛你是来拉屎的吧 2023-04-01 17:26:42 +08:00 committed by GitHub
commit 9abdf94d7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,8 +67,11 @@ public class ArticleController {
} }
@GetMapping("/{idArticle}/comments") @GetMapping("/{idArticle}/comments")
public GlobalResult<List<CommentDTO>> commons(@PathVariable Integer idArticle) { public GlobalResult<PageInfo<CommentDTO>> commons(@PathVariable Integer idArticle, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer rows) {
return GlobalResultGenerator.genSuccessResult(commentService.getArticleComments(idArticle)); PageHelper.startPage(page, rows);
List<CommentDTO> list = commentService.getArticleComments(idArticle);
PageInfo<CommentDTO> pageInfo = new PageInfo<>(list);
return GlobalResultGenerator.genSuccessResult(pageInfo);
} }
@GetMapping("/drafts") @GetMapping("/drafts")