站点最新发布的文章增加返回上传的文件

master
rong.liu 1 year ago
parent aaae4c9b6c
commit c75bae7dfa
  1. 18
      src/main/java/com/huoran/iasf/service/impl/SysContentServiceImpl.java
  2. 5
      src/main/java/com/huoran/iasf/vo/resp/PageContentRespVO.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<SysContentMapper, SysCont
@Autowired
private StringRedisTemplate redisTemplate;
@Autowired
private SysContentFileMapper fileMapper;
@Override
public boolean checkIfTheTitleIsRepeat(ContentHeavyTitleReqVO content) {
@ -77,6 +81,12 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
}
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize());
IPage<PageContentRespVO> pageList = baseMapper.getPublishedArticles(page, reqVO);
for (PageContentRespVO vo : pageList.getRecords()) {
List<SysContentFile> fileList = fileMapper.getFileByContentId(vo.getId());
vo.setFileList(fileList);
}
return R.success(pageList);
}
@ -182,10 +192,10 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont
//sequenceNumber 要更改的序号
*//**
* 就要判断排序是值改小还是改大
* 大改小比如53改5那就加一个语句大于等于5并且小于53
* 如果是小改大比如3改50那就是大于3并且小于等于50"
*//*
* 就要判断排序是值改小还是改大
* 大改小比如53改5那就加一个语句大于等于5并且小于53
* 如果是小改大比如3改50那就是大于3并且小于等于50"
*//*
if (currentSerialNumber > sequenceNumber) {
//改大 gt >
updateWrapper1.setSql(" sequence = sequence + 1");

@ -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<SysContentFile> fileList;
}
Loading…
Cancel
Save