diff --git a/src/main/java/com/huoran/iasf/controller/SysColumnController.java b/src/main/java/com/huoran/iasf/controller/SysColumnController.java index 7dd34e5..3545e55 100644 --- a/src/main/java/com/huoran/iasf/controller/SysColumnController.java +++ b/src/main/java/com/huoran/iasf/controller/SysColumnController.java @@ -102,14 +102,15 @@ public class SysColumnController { boolean updateState = service.updateById(sysColumn); return updateState ? R.success() : R.fail("编辑失败"); } + @NoRepeatSubmit @PostMapping("/delete") @ApiOperation(value = "删除", response = SysContent.class) public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { UpdateWrapper filesEntityUpdateWrapper = new UpdateWrapper<>(); - filesEntityUpdateWrapper.eq("quote_id",id); - filesEntityUpdateWrapper.eq("quote_type",1); - filesEntityUpdateWrapper.set("is_del",1); + filesEntityUpdateWrapper.eq("quote_id", id); + filesEntityUpdateWrapper.eq("quote_type", 1); + filesEntityUpdateWrapper.set("is_del", 1); sysFilesService.update(filesEntityUpdateWrapper); boolean delState = service.removeById(id); @@ -122,15 +123,16 @@ public class SysColumnController { return delState ? R.success() : R.fail("删除失败"); } + @NoRepeatSubmit @PostMapping("/batchDeletion") @ApiOperation(value = "批量删除栏目", response = SysColumn.class) public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List ids) { for (Integer id : ids) { UpdateWrapper filesEntityUpdateWrapper = new UpdateWrapper<>(); - filesEntityUpdateWrapper.eq("quote_id",id); - filesEntityUpdateWrapper.eq("quote_type",1); - filesEntityUpdateWrapper.set("is_del",1); + filesEntityUpdateWrapper.eq("quote_id", id); + filesEntityUpdateWrapper.eq("quote_type", 1); + filesEntityUpdateWrapper.set("is_del", 1); sysFilesService.update(filesEntityUpdateWrapper); } @@ -238,12 +240,14 @@ public class SysColumnController { Integer pid = service.oneLevelChecksThemAll(id); String ids = this.getIds(pid); - return service.getSubColumn(pid, ids,isSort); + return service.getSubColumn(pid, ids, isSort); } /** * 查询栏目下的文章(若选中栏目与子级全部栏目类型一致返回全部文章,反之查询选中栏目下的文章) + * 2023.02.22依需求更改为以发布时间排序(非创建时间) + * * @param columnId * @return */ @@ -251,7 +255,7 @@ public class SysColumnController { @PostMapping("/queryArticlesByColumnType") public R queryArticlesByColumnType(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) { String ids = this.getIds(columnId); - return service.queryArticlesByColumnType(ids,columnId); + return service.queryArticlesByColumnType(ids, columnId); } } diff --git a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml index db96676..4555e50 100644 --- a/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml +++ b/src/main/java/com/huoran/iasf/mapper/xml/SysContentMapper.xml @@ -181,7 +181,7 @@ WHERE FIND_IN_SET( t.column_id, #{columnId} ) - ORDER BY t.create_time desc + ORDER BY t.release_time DESC