🎨 专题接口变更
This commit is contained in:
parent
837cdec2e6
commit
745389caae
@ -78,5 +78,5 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
|
||||
* 获取作品集列表数据
|
||||
* @return
|
||||
*/
|
||||
List<Portfolio> selectPortfolios();
|
||||
List<PortfolioDTO> selectPortfolios();
|
||||
}
|
||||
|
@ -82,5 +82,5 @@ public interface PortfolioService extends Service<Portfolio> {
|
||||
* 获取作品集列表数据
|
||||
* @return
|
||||
*/
|
||||
List<Portfolio> findPortfolios();
|
||||
List<PortfolioDTO> findPortfolios();
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Portfolio> findPortfolios() {
|
||||
public List<PortfolioDTO> findPortfolios() {
|
||||
return portfolioMapper.selectPortfolios();
|
||||
}
|
||||
|
||||
|
@ -147,8 +147,8 @@ public class CommonApiController {
|
||||
@GetMapping("/portfolios")
|
||||
public GlobalResult portfolios(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "12") Integer rows) {
|
||||
PageHelper.startPage(page, rows);
|
||||
List<Portfolio> list = portfolioService.findPortfolios();
|
||||
PageInfo<Portfolio> pageInfo = new PageInfo(list);
|
||||
List<PortfolioDTO> list = portfolioService.findPortfolios();
|
||||
PageInfo<PortfolioDTO> pageInfo = new PageInfo(list);
|
||||
Map map = new HashMap(2);
|
||||
map.put("portfolios", pageInfo.getList());
|
||||
Map pagination = Utils.getPagination(pageInfo);
|
||||
|
@ -17,6 +17,7 @@
|
||||
<result column="portfolio_author_id" property="portfolioAuthorId"></result>
|
||||
<result column="portfolio_description" property="portfolioDescription"></result>
|
||||
<result column="updated_time" property="updatedTime"></result>
|
||||
<result column="numbers" property="articleNumber"></result>
|
||||
</resultMap>
|
||||
<insert id="insertPortfolioArticle">
|
||||
insert into forest_portfolio_article (id_portfolio, id_article, sort_no) values (#{idPortfolio}, #{idArticle}, #{maxSortNo})
|
||||
@ -51,8 +52,8 @@
|
||||
<select id="selectMaxSortNo" resultType="java.lang.Integer">
|
||||
select ifnull(max(sort_no),0) + 1 from forest_portfolio_article where id_portfolio = #{idPortfolio}
|
||||
</select>
|
||||
<select id="selectPortfolios" resultMap="BaseResultMap">
|
||||
select fp.* from forest_portfolio fp left join (select id_portfolio, count(id_portfolio) numbers from forest_portfolio_article group by id_portfolio) fpa
|
||||
<select id="selectPortfolios" resultMap="DTOResultMap">
|
||||
select fp.*,fpa.numbers from forest_portfolio fp left join (select id_portfolio, count(id_portfolio) numbers from forest_portfolio_article group by id_portfolio) fpa
|
||||
on fp.id = fpa.id_portfolio order by fpa.numbers desc, updated_time desc
|
||||
</select>
|
||||
</mapper>
|
Loading…
Reference in New Issue
Block a user