|
|
@ -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.Constant; |
|
|
|
import com.huoran.iasf.common.utils.R; |
|
|
|
import com.huoran.iasf.common.utils.R; |
|
|
|
import com.huoran.iasf.entity.SysContent; |
|
|
|
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.mapper.SysContentMapper; |
|
|
|
import com.huoran.iasf.service.SysContentService; |
|
|
|
import com.huoran.iasf.service.SysContentService; |
|
|
|
import com.huoran.iasf.vo.req.ArticleModifiedSortReq; |
|
|
|
import com.huoran.iasf.vo.req.ArticleModifiedSortReq; |
|
|
@ -39,6 +41,8 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private StringRedisTemplate redisTemplate; |
|
|
|
private StringRedisTemplate redisTemplate; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
|
|
private SysContentFileMapper fileMapper; |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean checkIfTheTitleIsRepeat(ContentHeavyTitleReqVO content) { |
|
|
|
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()); |
|
|
|
Page<PageContentRespVO> page = new Page<PageContentRespVO>(reqVO.getPageNum(), reqVO.getPageSize()); |
|
|
|
IPage<PageContentRespVO> pageList = baseMapper.getPublishedArticles(page, reqVO); |
|
|
|
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); |
|
|
|
return R.success(pageList); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -182,10 +192,10 @@ public class SysContentServiceImpl extends ServiceImpl<SysContentMapper, SysCont |
|
|
|
//sequenceNumber 要更改的序号
|
|
|
|
//sequenceNumber 要更改的序号
|
|
|
|
|
|
|
|
|
|
|
|
*//**
|
|
|
|
*//**
|
|
|
|
* 就要判断排序是值改小还是改大 |
|
|
|
* 就要判断排序是值改小还是改大 |
|
|
|
* 大改小比如53改5那就加一个语句“大于等于5并且小于53” |
|
|
|
* 大改小比如53改5那就加一个语句“大于等于5并且小于53” |
|
|
|
* 如果是小改大比如3改50那就是“大于3并且小于等于50" |
|
|
|
* 如果是小改大比如3改50那就是“大于3并且小于等于50" |
|
|
|
*//*
|
|
|
|
*//*
|
|
|
|
if (currentSerialNumber > sequenceNumber) { |
|
|
|
if (currentSerialNumber > sequenceNumber) { |
|
|
|
//改大 gt >
|
|
|
|
//改大 gt >
|
|
|
|
updateWrapper1.setSql(" sequence = sequence + 1"); |
|
|
|
updateWrapper1.setSql(" sequence = sequence + 1"); |
|
|
|