From 198cff64a5727ac5c25318997f656ba7249226f1 Mon Sep 17 00:00:00 2001 From: ronger Date: Mon, 15 Mar 2021 21:21:27 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E4=BD=9C=E5=93=81=E9=9B=86=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=E6=95=88=E6=9E=9C=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java | 6 ++++++ .../java/com/rymcu/forest/service/PortfolioService.java | 6 ++++++ .../com/rymcu/forest/service/impl/PortfolioServiceImpl.java | 5 +++++ .../rymcu/forest/web/api/common/CommonApiController.java | 4 ++-- src/main/java/mapper/PortfolioMapper.xml | 3 +++ 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java b/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java index 7439e31..d90c0b0 100644 --- a/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java +++ b/src/main/java/com/rymcu/forest/mapper/PortfolioMapper.java @@ -73,4 +73,10 @@ public interface PortfolioMapper extends Mapper { * @return */ Integer unbindArticle(@Param("idPortfolio") Integer idPortfolio, @Param("idArticle") Integer idArticle); + + /** + * 获取作品集列表数据 + * @return + */ + List selectPortfolios(); } diff --git a/src/main/java/com/rymcu/forest/service/PortfolioService.java b/src/main/java/com/rymcu/forest/service/PortfolioService.java index 9413ccd..df8d2e7 100644 --- a/src/main/java/com/rymcu/forest/service/PortfolioService.java +++ b/src/main/java/com/rymcu/forest/service/PortfolioService.java @@ -77,4 +77,10 @@ public interface PortfolioService extends Service { * @return */ Map deletePortfolio(Integer idPortfolio); + + /** + * 获取作品集列表数据 + * @return + */ + List findPortfolios(); } diff --git a/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java b/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java index b6aa53c..af9a0fc 100644 --- a/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java +++ b/src/main/java/com/rymcu/forest/service/impl/PortfolioServiceImpl.java @@ -174,6 +174,11 @@ public class PortfolioServiceImpl extends AbstractService implements return map; } + @Override + public List findPortfolios() { + return portfolioMapper.selectPortfolios(); + } + private PortfolioDTO genPortfolioAuthor(PortfolioDTO portfolioDTO, Author author) { portfolioDTO.setPortfolioAuthorAvatarUrl(author.getUserAvatarURL()); portfolioDTO.setPortfolioAuthorName(author.getUserNickname()); 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 ca68996..88d4931 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 @@ -143,9 +143,9 @@ public class CommonApiController { } @GetMapping("/portfolios") - public GlobalResult portfolios(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows) { + public GlobalResult portfolios(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "12") Integer rows) { PageHelper.startPage(page, rows); - List list = portfolioService.findAll(); + List list = portfolioService.findPortfolios(); PageInfo pageInfo = new PageInfo(list); Map map = new HashMap(2); map.put("portfolios", pageInfo.getList()); diff --git a/src/main/java/mapper/PortfolioMapper.xml b/src/main/java/mapper/PortfolioMapper.xml index 58c6eb9..ac07b15 100644 --- a/src/main/java/mapper/PortfolioMapper.xml +++ b/src/main/java/mapper/PortfolioMapper.xml @@ -51,4 +51,7 @@ + \ No newline at end of file