From 9aa0aad6554143fb38cedf8a7ed0aea0803eb330 Mon Sep 17 00:00:00 2001 From: ronger Date: Sat, 6 Mar 2021 21:31:31 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E4=BD=9C=E5=93=81=E9=9B=86?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../forest/web/api/common/CommonApiController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java b/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java index d9e330a..ca68996 100644 --- a/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java +++ b/src/main/java/com/rymcu/forest/web/api/common/CommonApiController.java @@ -7,6 +7,7 @@ import com.rymcu.forest.core.result.GlobalResultGenerator; import com.rymcu.forest.core.result.GlobalResultMessage; import com.rymcu.forest.core.service.log.annotation.VisitLogger; import com.rymcu.forest.dto.*; +import com.rymcu.forest.entity.Portfolio; import com.rymcu.forest.entity.User; import com.rymcu.forest.service.*; import com.rymcu.forest.util.UserUtils; @@ -140,4 +141,16 @@ public class CommonApiController { List list = SearchService.initialSearch(); return GlobalResultGenerator.genSuccessResult(list); } + + @GetMapping("/portfolios") + public GlobalResult portfolios(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows) { + PageHelper.startPage(page, rows); + List list = portfolioService.findAll(); + PageInfo pageInfo = new PageInfo(list); + Map map = new HashMap(2); + map.put("portfolios", pageInfo.getList()); + Map pagination = Utils.getPagination(pageInfo); + map.put("pagination", pagination); + return GlobalResultGenerator.genSuccessResult(map); + } }