|
|
|
@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|
|
|
|
import com.huoran.iasf.entity.SysColumn; |
|
|
|
|
import com.huoran.iasf.entity.SysContentFile; |
|
|
|
|
import com.huoran.iasf.entity.SysFilesEntity; |
|
|
|
|
import com.huoran.iasf.service.SysColumnService; |
|
|
|
|
import com.huoran.iasf.service.SysContentFileService; |
|
|
|
|
import com.huoran.iasf.service.SysFilesService; |
|
|
|
|
import com.huoran.iasf.vo.req.ContentHeavyTitleReqVO; |
|
|
|
|
import com.huoran.iasf.vo.req.ContentReq; |
|
|
|
|
import com.huoran.iasf.vo.req.PageContentReqVO; |
|
|
|
@ -49,6 +51,9 @@ public class SysContentController { |
|
|
|
|
@Autowired |
|
|
|
|
public SysContentFileService fileService; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
public SysFilesService sysFilesService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/pagingQuery") |
|
|
|
@ -92,6 +97,10 @@ public class SysContentController { |
|
|
|
|
@PostMapping("/delete") |
|
|
|
|
@ApiOperation(value = "删除", response = SysContent.class) |
|
|
|
|
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { |
|
|
|
|
UpdateWrapper<SysFilesEntity> queryWrapper = new UpdateWrapper<>(); |
|
|
|
|
queryWrapper.eq("quote_id",id); |
|
|
|
|
queryWrapper.set("is_del",1); |
|
|
|
|
sysFilesService.update(queryWrapper); |
|
|
|
|
boolean delState = service.removeById(id); |
|
|
|
|
return delState ? R.success() : R.fail("删除失败"); |
|
|
|
|
} |
|
|
|
@ -100,6 +109,12 @@ public class SysContentController { |
|
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
|
@ApiOperation(value = "批量删除文章", response = SysContent.class) |
|
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List<Integer> ids) { |
|
|
|
|
for (Integer id : ids) { |
|
|
|
|
UpdateWrapper<SysFilesEntity> queryWrapper = new UpdateWrapper<>(); |
|
|
|
|
queryWrapper.eq("quote_id",id); |
|
|
|
|
queryWrapper.set("is_del",1); |
|
|
|
|
sysFilesService.update(queryWrapper); |
|
|
|
|
} |
|
|
|
|
boolean delState = service.removeByIds(ids); |
|
|
|
|
return delState ? R.success() : R.fail("删除失败"); |
|
|
|
|
} |
|
|
|
|