diff --git a/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java b/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java index 5212e2a..8f7b051 100644 --- a/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java +++ b/src/main/java/com/rymcu/forest/web/api/article/ArticleController.java @@ -67,8 +67,11 @@ public class ArticleController { } @GetMapping("/{idArticle}/comments") - public GlobalResult> commons(@PathVariable Integer idArticle) { - return GlobalResultGenerator.genSuccessResult(commentService.getArticleComments(idArticle)); + public GlobalResult> commons(@PathVariable Integer idArticle, @RequestParam(defaultValue = "1") Integer page, @RequestParam(defaultValue = "10") Integer rows) { + PageHelper.startPage(page, rows); + List list = commentService.getArticleComments(idArticle); + PageInfo pageInfo = new PageInfo<>(list); + return GlobalResultGenerator.genSuccessResult(pageInfo); } @GetMapping("/drafts")