|
|
@ -46,6 +46,8 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
@Autowired |
|
|
|
@Autowired |
|
|
|
private ICmsColumnService cmsColumnService; |
|
|
|
private ICmsColumnService cmsColumnService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static final String ADMIN_COLUMN_KEY = "99"; |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-获取栏目树型列表", notes = "文章栏目-获取栏目树型列表") |
|
|
|
@ApiOperation(value = "文章栏目-获取栏目树型列表", notes = "文章栏目-获取栏目树型列表") |
|
|
|
@GetMapping(value = "/getColumnTree") |
|
|
|
@GetMapping(value = "/getColumnTree") |
|
|
|
public Result<?> getColumnTree(HttpServletRequest req) { |
|
|
|
public Result<?> getColumnTree(HttpServletRequest req) { |
|
|
@ -76,7 +78,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
* @param req |
|
|
|
* @param req |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
// @AutoLog(value = "文章栏目-分页列表查询")
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-分页列表查询", notes = "文章栏目-分页列表查询") |
|
|
|
@ApiOperation(value = "文章栏目-分页列表查询", notes = "文章栏目-分页列表查询") |
|
|
|
@GetMapping(value = "/rootList") |
|
|
|
@GetMapping(value = "/rootList") |
|
|
|
public Result<?> queryPageList(CmsColumn cmsColumn, |
|
|
|
public Result<?> queryPageList(CmsColumn cmsColumn, |
|
|
@ -84,7 +85,7 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
|
|
|
HttpServletRequest req) { |
|
|
|
HttpServletRequest req) { |
|
|
|
String hasQuery = req.getParameter("hasQuery"); |
|
|
|
String hasQuery = req.getParameter("hasQuery"); |
|
|
|
if (hasQuery != null && "true".equals(hasQuery)) { |
|
|
|
if (hasQuery != null && HAS_QUERY.equals(hasQuery)) { |
|
|
|
QueryWrapper<CmsColumn> queryWrapper = QueryGenerator.initQueryWrapper(cmsColumn, req.getParameterMap()); |
|
|
|
QueryWrapper<CmsColumn> queryWrapper = QueryGenerator.initQueryWrapper(cmsColumn, req.getParameterMap()); |
|
|
|
List<CmsColumn> list = cmsColumnService.queryTreeListNoPage(queryWrapper); |
|
|
|
List<CmsColumn> list = cmsColumnService.queryTreeListNoPage(queryWrapper); |
|
|
|
IPage<CmsColumn> pageList = new Page<>(1, 10, list.size()); |
|
|
|
IPage<CmsColumn> pageList = new Page<>(1, 10, list.size()); |
|
|
@ -105,7 +106,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
Page<CmsColumn> page = new Page<CmsColumn>(pageNo, pageSize); |
|
|
|
Page<CmsColumn> page = new Page<CmsColumn>(pageNo, pageSize); |
|
|
|
IPage<CmsColumn> pageList = cmsColumnService.page(page, queryWrapper); |
|
|
|
IPage<CmsColumn> pageList = cmsColumnService.page(page, queryWrapper); |
|
|
|
List<CmsColumn> records = pageList.getRecords(); |
|
|
|
List<CmsColumn> records = pageList.getRecords(); |
|
|
|
// records.sort(Comparator.comparing(CmsColumn::getSort));
|
|
|
|
|
|
|
|
Collections.sort(records, Comparator.comparingInt(CmsColumn::getSort)); |
|
|
|
Collections.sort(records, Comparator.comparingInt(CmsColumn::getSort)); |
|
|
|
|
|
|
|
|
|
|
|
return Result.OK(pageList); |
|
|
|
return Result.OK(pageList); |
|
|
@ -119,7 +119,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
* @param req |
|
|
|
* @param req |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
// @AutoLog(value = "文章栏目-获取子数据")
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-获取子数据", notes = "文章栏目-获取子数据") |
|
|
|
@ApiOperation(value = "文章栏目-获取子数据", notes = "文章栏目-获取子数据") |
|
|
|
@GetMapping(value = "/childList") |
|
|
|
@GetMapping(value = "/childList") |
|
|
|
public Result<?> queryPageList(CmsColumn cmsColumn, HttpServletRequest req) { |
|
|
|
public Result<?> queryPageList(CmsColumn cmsColumn, HttpServletRequest req) { |
|
|
@ -138,7 +137,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
* @return 返回 IPage |
|
|
|
* @return 返回 IPage |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
// @AutoLog(value = "文章栏目-批量获取子数据")
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-批量获取子数据", notes = "文章栏目-批量获取子数据") |
|
|
|
@ApiOperation(value = "文章栏目-批量获取子数据", notes = "文章栏目-批量获取子数据") |
|
|
|
@GetMapping("/getChildListBatch") |
|
|
|
@GetMapping("/getChildListBatch") |
|
|
|
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) { |
|
|
|
public Result getChildListBatch(@RequestParam("parentIds") String parentIds) { |
|
|
@ -162,7 +160,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
* @param cmsColumn |
|
|
|
* @param cmsColumn |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
// @AutoLog(value = "文章栏目-添加")
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-添加", notes = "文章栏目-添加") |
|
|
|
@ApiOperation(value = "文章栏目-添加", notes = "文章栏目-添加") |
|
|
|
@PostMapping(value = "/add") |
|
|
|
@PostMapping(value = "/add") |
|
|
|
public Result<?> add(@RequestBody CmsColumn cmsColumn) { |
|
|
|
public Result<?> add(@RequestBody CmsColumn cmsColumn) { |
|
|
@ -178,7 +175,6 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
* @param cmsColumn |
|
|
|
* @param cmsColumn |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
// @AutoLog(value = "文章栏目-编辑")
|
|
|
|
|
|
|
|
@ApiOperation(value = "文章栏目-编辑", notes = "文章栏目-编辑") |
|
|
|
@ApiOperation(value = "文章栏目-编辑", notes = "文章栏目-编辑") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
@PutMapping(value = "/edit") |
|
|
|
public Result<?> edit(@RequestBody CmsColumn cmsColumn) { |
|
|
|
public Result<?> edit(@RequestBody CmsColumn cmsColumn) { |
|
|
@ -196,9 +192,13 @@ public class CmsColumnController extends JeecgController<CmsColumn, ICmsColumnSe |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
@DeleteMapping(value = "/delete") |
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
public Result<?> delete(@RequestParam(name = "id", required = true) String id) { |
|
|
|
CmsColumn cmsColumn = cmsColumnService.getById(id); |
|
|
|
CmsColumn cmsColumn = cmsColumnService.getById(id); |
|
|
|
if (StringUtils.equals("99", cmsColumn.getId())) throw new JeecgBootException("文章总栏目不可删除"); |
|
|
|
if (StringUtils.equals(ADMIN_COLUMN_KEY, cmsColumn.getId())) { |
|
|
|
|
|
|
|
throw new JeecgBootException("文章总栏目不可删除"); |
|
|
|
|
|
|
|
} |
|
|
|
int count = cmsColumnService.count(new LambdaQueryWrapper<CmsColumn>().eq(CmsColumn::getPid, cmsColumn.getId())); |
|
|
|
int count = cmsColumnService.count(new LambdaQueryWrapper<CmsColumn>().eq(CmsColumn::getPid, cmsColumn.getId())); |
|
|
|
if (count > 0) throw new JeecgBootException("存在子栏目暂不可删除"); |
|
|
|
if (count > 0) { |
|
|
|
|
|
|
|
throw new JeecgBootException("存在子栏目暂不可删除"); |
|
|
|
|
|
|
|
} |
|
|
|
cmsColumnService.deleteCmsColumn(id); |
|
|
|
cmsColumnService.deleteCmsColumn(id); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
return Result.OK("删除成功!"); |
|
|
|
} |
|
|
|
} |
|
|
|