|
|
|
@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper; |
|
|
|
|
import com.huoran.iasf.common.exception.NotFoundException; |
|
|
|
|
import com.huoran.iasf.common.exception.code.BaseResponseCode; |
|
|
|
|
import com.huoran.iasf.entity.SysColumn; |
|
|
|
|
import com.huoran.iasf.entity.SysContentFile; |
|
|
|
|
import com.huoran.iasf.entity.SysFilesEntity; |
|
|
|
@ -70,15 +72,24 @@ public class SysContentController { |
|
|
|
|
@PostMapping("/findById") |
|
|
|
|
@ApiOperation(value = "查询详情", response = SysContent.class) |
|
|
|
|
public R findById(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SysContent sysContent = service.getById(id); |
|
|
|
|
if (sysContent == null) { |
|
|
|
|
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
SysColumn sysColumn = columnService.getById(sysContent.getColumnId()); |
|
|
|
|
if (sysColumn == null) { |
|
|
|
|
throw new NotFoundException(BaseResponseCode.DATA_DOES_NOT_EXIST); |
|
|
|
|
} |
|
|
|
|
if (sysColumn.getColumnName() != null) { |
|
|
|
|
sysContent.setColumnName(sysColumn.getColumnName()); |
|
|
|
|
} |
|
|
|
|
List<SysContentFile> fileList = fileService.getFileByContentId(id); |
|
|
|
|
sysContent.setFileList(fileList); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.success(sysContent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -265,9 +276,7 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
@PostMapping("/modifiedSort") |
|
|
|
|
@ApiOperation(value = "修改排序", response = SysContent.class) |
|
|
|
|
public R modifiedSort( |
|
|
|
|
@ApiParam(name = "sequenceNumber", value = "要排序的序号", required = true) @RequestParam Integer sequenceNumber, |
|
|
|
|
@ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) { |
|
|
|
|
public R modifiedSort(@ApiParam(name = "sequenceNumber", value = "要排序的序号", required = true) @RequestParam Integer sequenceNumber, @ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) { |
|
|
|
|
return service.modifiedSort(sequenceNumber, articleId); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|