diff --git a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java index 1b4478b..0c5ecb1 100644 --- a/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java +++ b/src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java @@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huoran.iasf.common.utils.Constant; import com.huoran.iasf.common.utils.R; import com.huoran.iasf.entity.SysContent; +import com.huoran.iasf.entity.SysContentFile; +import com.huoran.iasf.mapper.SysContentFileMapper; import com.huoran.iasf.mapper.SysContentMapper; import com.huoran.iasf.service.SysContentService; import com.huoran.iasf.vo.req.ArticleModifiedSortReq; @@ -39,6 +41,8 @@ public class SysContentServiceImpl extends ServiceImpl page = new Page(reqVO.getPageNum(), reqVO.getPageSize()); IPage pageList = baseMapper.getPublishedArticles(page, reqVO); + + + for (PageContentRespVO vo : pageList.getRecords()) { + List fileList = fileMapper.getFileByContentId(vo.getId()); + vo.setFileList(fileList); + } return R.success(pageList); } @@ -182,10 +192,10 @@ public class SysContentServiceImpl extends ServiceImpl sequenceNumber) { //改大 gt > updateWrapper1.setSql(" sequence = sequence + 1"); diff --git a/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java index 17a3c08..ecf4950 100644 --- a/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java +++ b/src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.java @@ -2,6 +2,7 @@ package com.huoran.iasf.vo.resp; import com.baomidou.mybatisplus.annotation.*; import com.huoran.iasf.entity.SysColumn; +import com.huoran.iasf.entity.SysContentFile; import com.huoran.iasf.vo.FatherContentRespVO; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -246,5 +247,7 @@ public class PageContentRespVO { @ApiModelProperty(value = "荣誉") private String honor; - + @ApiModelProperty(value = "文章附件") + @TableField(exist = false) + List fileList; } \ No newline at end of file