Merge remote-tracking branch 'origin/master'

This commit is contained in:
你一个人在这儿干嘛你是来拉屎的吧 2023-04-02 09:55:02 +08:00
commit 3e2cbc0bf5

View File

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