From a01653e74e45fb52d0f5a95346d06ab188bed053 Mon Sep 17 00:00:00 2001 From: ronger Date: Fri, 24 Mar 2023 15:21:33 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E8=AF=84=E8=AE=BA=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=86=E9=A1=B5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rymcu/forest/web/api/article/ArticleController.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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")