|
|
@ -1,7 +1,6 @@ |
|
|
|
package com.huoran.iasf.controller; |
|
|
|
package com.huoran.iasf.controller; |
|
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import cn.hutool.core.util.StrUtil; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import com.huoran.iasf.common.aop.annotation.NoRepeatSubmit; |
|
|
|
import com.huoran.iasf.common.aop.annotation.NoRepeatSubmit; |
|
|
@ -19,9 +18,6 @@ import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.cache.annotation.CacheEvict; |
|
|
|
|
|
|
|
import org.springframework.cache.annotation.CachePut; |
|
|
|
|
|
|
|
import org.springframework.cache.annotation.Cacheable; |
|
|
|
|
|
|
|
import org.springframework.data.redis.RedisConnectionFailureException; |
|
|
|
import org.springframework.data.redis.RedisConnectionFailureException; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
@ -67,14 +63,12 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/listWithTree") |
|
|
|
@PostMapping("/listWithTree") |
|
|
|
@ApiOperation(value = "栏目树结构", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "栏目树结构", response = SysColumn.class) |
|
|
|
@Cacheable(value = "redis_listWithTree", key = "#sysColumn.toString()") |
|
|
|
|
|
|
|
public R listWithTree(@RequestBody @Valid PaginationColumnReqVO sysColumn) { |
|
|
|
public R listWithTree(@RequestBody @Valid PaginationColumnReqVO sysColumn) { |
|
|
|
return R.success(service.listWithTree(sysColumn)); |
|
|
|
return R.success(service.listWithTree(sysColumn)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/listWithTreeMenuVisible") |
|
|
|
@PostMapping("/listWithTreeMenuVisible") |
|
|
|
@ApiOperation(value = "栏目树结构(前台可见,只展示试单可见的栏目)", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "栏目树结构(前台可见,只展示试单可见的栏目)", response = SysColumn.class) |
|
|
|
@Cacheable(value = "redis_listWithTreeMenuVisible", key = "#sysColumn.toString()") |
|
|
|
|
|
|
|
public R listWithTreeMenuVisible(@RequestBody @Valid PaginationColumnReqVO sysColumn) { |
|
|
|
public R listWithTreeMenuVisible(@RequestBody @Valid PaginationColumnReqVO sysColumn) { |
|
|
|
return R.success(service.listWithTreeMenuVisible(sysColumn)); |
|
|
|
return R.success(service.listWithTreeMenuVisible(sysColumn)); |
|
|
|
} |
|
|
|
} |
|
|
@ -82,7 +76,6 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/findById") |
|
|
|
@PostMapping("/findById") |
|
|
|
@ApiOperation(value = "查询详情", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "查询详情", response = SysColumn.class) |
|
|
|
@Cacheable(value = "redis_columnDetails", key = "#id") |
|
|
|
|
|
|
|
public R findById(@RequestParam("id") @ApiParam(value = "主键ID") Integer id) { |
|
|
|
public R findById(@RequestParam("id") @ApiParam(value = "主键ID") Integer id) { |
|
|
|
SysColumn sysColumn = service.getById(id); |
|
|
|
SysColumn sysColumn = service.getById(id); |
|
|
|
if (sysColumn == null) { |
|
|
|
if (sysColumn == null) { |
|
|
@ -90,11 +83,11 @@ public class SysColumnController { |
|
|
|
} |
|
|
|
} |
|
|
|
SysTemplateStyle sysTemplateStyle = styleService.getById(sysColumn.getListStyleId()); |
|
|
|
SysTemplateStyle sysTemplateStyle = styleService.getById(sysColumn.getListStyleId()); |
|
|
|
|
|
|
|
|
|
|
|
if (!ObjectUtil.isEmpty(sysTemplateStyle)) { |
|
|
|
if (!ObjectUtil.isEmpty(sysTemplateStyle)){ |
|
|
|
if (!ObjectUtil.isEmpty(sysTemplateStyle.getPath())) { |
|
|
|
if (!ObjectUtil.isEmpty(sysTemplateStyle.getPath())) { |
|
|
|
sysColumn.setPath(sysTemplateStyle.getPath()); |
|
|
|
sysColumn.setPath(sysTemplateStyle.getPath()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return R.success(sysColumn); |
|
|
|
return R.success(sysColumn); |
|
|
|
} |
|
|
|
} |
|
|
@ -102,9 +95,6 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@NoRepeatSubmit |
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
|
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
|
|
|
|
@ApiOperation(value = "新增", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "新增", response = SysColumn.class) |
|
|
|
public R save(@RequestBody @Valid SysColumn sysColumn) { |
|
|
|
public R save(@RequestBody @Valid SysColumn sysColumn) { |
|
|
|
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<SysColumn>(); |
|
|
|
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<SysColumn>(); |
|
|
@ -115,11 +105,8 @@ public class SysColumnController { |
|
|
|
return addState ? R.success(sysColumn.getId()) : R.fail("新增失败"); |
|
|
|
return addState ? R.success(sysColumn.getId()) : R.fail("新增失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
|
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
|
|
|
|
@ApiOperation(value = "修改", response = SysColumn.class) |
|
|
|
|
|
|
|
@PostMapping("/update") |
|
|
|
@PostMapping("/update") |
|
|
|
|
|
|
|
@ApiOperation(value = "修改", response = SysColumn.class) |
|
|
|
public R update(@RequestBody SysColumn sysColumn) { |
|
|
|
public R update(@RequestBody SysColumn sysColumn) { |
|
|
|
boolean updateState = service.updateById(sysColumn); |
|
|
|
boolean updateState = service.updateById(sysColumn); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
@ -136,10 +123,11 @@ public class SysColumnController { |
|
|
|
@ApiOperation(value = "缓存用户存过的字段") |
|
|
|
@ApiOperation(value = "缓存用户存过的字段") |
|
|
|
public R cacheField(@ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, |
|
|
|
public R cacheField(@ApiParam(name = "userId", value = "用户id", required = true) @RequestParam Integer userId, |
|
|
|
@ApiParam(name = "fields", required = true, value = "字段(逗号隔开)") @RequestParam String fields, |
|
|
|
@ApiParam(name = "fields", required = true, value = "字段(逗号隔开)") @RequestParam String fields, |
|
|
|
@ApiParam(name = "siteId", required = true, value = "站点id") @RequestParam Integer siteId) { |
|
|
|
@ApiParam(name = "siteId", required = true, value = "站点id") @RequestParam Integer siteId |
|
|
|
|
|
|
|
) { |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
String key = "fieldCache_" + "siteId_" + siteId + "userId_" + userId; |
|
|
|
String key = "fieldCache_" +"siteId_" +siteId +"userId_"+ userId; |
|
|
|
redisTemplate.opsForValue().set(key, fields); |
|
|
|
redisTemplate.opsForValue().set(key, fields); |
|
|
|
return R.success("字段缓存成功"); |
|
|
|
return R.success("字段缓存成功"); |
|
|
|
} catch (RedisConnectionFailureException e) { |
|
|
|
} catch (RedisConnectionFailureException e) { |
|
|
@ -148,6 +136,7 @@ public class SysColumnController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据用户ID和站点ID获取缓存的字段列表。 |
|
|
|
* 根据用户ID和站点ID获取缓存的字段列表。 |
|
|
|
* 该接口通过组合用户ID和站点ID作为键,从Redis缓存中获取字段列表。如果缓存中不存在相应的数据, |
|
|
|
* 该接口通过组合用户ID和站点ID作为键,从Redis缓存中获取字段列表。如果缓存中不存在相应的数据, |
|
|
@ -163,7 +152,7 @@ public class SysColumnController { |
|
|
|
@ApiParam(name = "siteId", required = true, value = "站点id") @RequestParam Integer siteId) { |
|
|
|
@ApiParam(name = "siteId", required = true, value = "站点id") @RequestParam Integer siteId) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
// 组合键名,用于在Redis中查找缓存数据。
|
|
|
|
// 组合键名,用于在Redis中查找缓存数据。
|
|
|
|
String key = "fieldCache_" + "siteId_" + siteId + "userId_" + userId; |
|
|
|
String key = "fieldCache_" +"siteId_" +siteId +"userId_"+ userId; |
|
|
|
// 从Redis中获取缓存数据。
|
|
|
|
// 从Redis中获取缓存数据。
|
|
|
|
Object cachedFieldsObj = redisTemplate.opsForValue().get(key); |
|
|
|
Object cachedFieldsObj = redisTemplate.opsForValue().get(key); |
|
|
|
|
|
|
|
|
|
|
@ -180,8 +169,8 @@ public class SysColumnController { |
|
|
|
// 将缓存的字符串转换为字段列表。
|
|
|
|
// 将缓存的字符串转换为字段列表。
|
|
|
|
// 直接将字符串分割成列表
|
|
|
|
// 直接将字符串分割成列表
|
|
|
|
String cachedFieldsStr = (String) cachedFieldsObj; |
|
|
|
String cachedFieldsStr = (String) cachedFieldsObj; |
|
|
|
if (cachedFieldsStr.isEmpty()) { |
|
|
|
if (cachedFieldsStr.isEmpty()){ |
|
|
|
return R.success(); |
|
|
|
return R.success(); |
|
|
|
} |
|
|
|
} |
|
|
|
List<String> fields = Arrays.asList(cachedFieldsStr.split(",")); |
|
|
|
List<String> fields = Arrays.asList(cachedFieldsStr.split(",")); |
|
|
|
|
|
|
|
|
|
|
@ -196,22 +185,18 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/controlDisplayNavigationMenu") |
|
|
|
@PostMapping("/controlDisplayNavigationMenu") |
|
|
|
@ApiOperation(value = "控制显示导航菜单", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "控制显示导航菜单", response = SysColumn.class) |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
|
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
|
|
|
|
@CachePut(value = "redis_controlDisplayNavigationMenu", key = "#id + ':' + #menuVisible") |
|
|
|
|
|
|
|
public R controlDisplayNavigationMenu(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id, @ApiParam(name = "menuVisible", value = "菜单是否可见(默认0可见 1不可见)", required = true) @RequestParam Integer menuVisible) { |
|
|
|
public R controlDisplayNavigationMenu(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id, @ApiParam(name = "menuVisible", value = "菜单是否可见(默认0可见 1不可见)", required = true) @RequestParam Integer menuVisible) { |
|
|
|
|
|
|
|
|
|
|
|
SysColumn column = new SysColumn(); |
|
|
|
SysColumn column = new SysColumn(); |
|
|
|
column.setId(id); |
|
|
|
column.setId(id); |
|
|
|
column.setMenuVisible(menuVisible); // 菜单是否可见(默认0可见 1不可见)
|
|
|
|
column.setMenuVisible(menuVisible);//菜单是否可见(默认0可见 1不可见)
|
|
|
|
|
|
|
|
|
|
|
|
boolean updateState = service.updateById(column); |
|
|
|
boolean updateState = service.updateById(column); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
|
return updateState ? R.success() : R.fail("编辑失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 批量删除栏目及其关联的内容和长页信息。 |
|
|
|
* 批量删除栏目及其关联的内容和长页信息。 |
|
|
|
* 接收一个包含栏目ID的列表,遍历这些ID以执行以下操作: |
|
|
|
* 接收一个包含栏目ID的列表,遍历这些ID以执行以下操作: |
|
|
|
* 1. 更新与栏目关联的文件记录为已删除状态。 |
|
|
|
* 1. 更新与栏目关联的文件记录为已删除状态。 |
|
|
@ -225,9 +210,6 @@ public class SysColumnController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@NoRepeatSubmit |
|
|
|
@NoRepeatSubmit |
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
|
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
|
|
|
|
@ApiOperation(value = "批量删除栏目", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "批量删除栏目", response = SysColumn.class) |
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "栏目ID列表", required = true) @RequestParam List<Integer> ids) { |
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "栏目ID列表", required = true) @RequestParam List<Integer> ids) { |
|
|
|
for (Integer id : ids) { |
|
|
|
for (Integer id : ids) { |
|
|
@ -260,13 +242,14 @@ public class SysColumnController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/sameLevelJudgment") |
|
|
|
@PostMapping("/sameLevelJudgment") |
|
|
|
@ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class) |
|
|
|
@ApiOperation(value = "同级判重", response = ColumnWeightReqVO.class) |
|
|
|
public R sameLevelJudgment(@RequestBody @Valid ColumnWeightReqVO sysColumn) { |
|
|
|
public R sameLevelJudgment(@RequestBody @Valid ColumnWeightReqVO sysColumn) { |
|
|
|
return service.sameLevelJudgment(sysColumn) ? R.success() : R.fail("同级下已存在重复栏目!"); |
|
|
|
return service.sameLevelJudgment(sysColumn) ? R.success() : R.fail("同级下已存在重复栏目!"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据传入的栏目排序信息更新栏目顺序。 |
|
|
|
* 根据传入的栏目排序信息更新栏目顺序。 |
|
|
|
* 遍历接收到的排序信息列表,针对每个栏目验证同级下是否有名称相同的栏目存在(排除自身), |
|
|
|
* 遍历接收到的排序信息列表,针对每个栏目验证同级下是否有名称相同的栏目存在(排除自身), |
|
|
|
* 若无冲突则更新该栏目的排序信息。 |
|
|
|
* 若无冲突则更新该栏目的排序信息。 |
|
|
@ -276,9 +259,6 @@ public class SysColumnController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@PostMapping("/sortByColumn") |
|
|
|
@PostMapping("/sortByColumn") |
|
|
|
@ApiOperation(value = "栏目排序(依据id更改)", response = SysColumn.class) |
|
|
|
@ApiOperation(value = "栏目排序(依据id更改)", response = SysColumn.class) |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
|
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
|
|
|
|
public R sortByColumn(@RequestBody List<SortColumnRespVO> sortColumnRespVOList) { |
|
|
|
public R sortByColumn(@RequestBody List<SortColumnRespVO> sortColumnRespVOList) { |
|
|
|
for (SortColumnRespVO sortInfo : sortColumnRespVOList) { |
|
|
|
for (SortColumnRespVO sortInfo : sortColumnRespVOList) { |
|
|
|
// 获取当前要排序的栏目信息
|
|
|
|
// 获取当前要排序的栏目信息
|
|
|
@ -286,7 +266,10 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
// 构建查询条件,检查同级下是否有名称相同的其他栏目(排除自己)
|
|
|
|
// 构建查询条件,检查同级下是否有名称相同的其他栏目(排除自己)
|
|
|
|
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<SysColumn> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("column_name", existingColumn.getColumnName()).eq("site_id", existingColumn.getSiteId()).eq("father_id", sortInfo.getFatherId()).ne("id", sortInfo.getId()); // 确保不包括当前正在处理的栏目
|
|
|
|
queryWrapper.eq("column_name", existingColumn.getColumnName()) |
|
|
|
|
|
|
|
.eq("site_id", existingColumn.getSiteId()) |
|
|
|
|
|
|
|
.eq("father_id", sortInfo.getFatherId()) |
|
|
|
|
|
|
|
.ne("id", sortInfo.getId()); // 确保不包括当前正在处理的栏目
|
|
|
|
|
|
|
|
|
|
|
|
// 执行查询
|
|
|
|
// 执行查询
|
|
|
|
List<SysColumn> conflictingColumns = service.list(queryWrapper); |
|
|
|
List<SysColumn> conflictingColumns = service.list(queryWrapper); |
|
|
@ -309,8 +292,7 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("获取一级下的子级栏目") |
|
|
|
@ApiOperation("获取一级下的子级栏目") |
|
|
|
@PostMapping("/getsTheSubColumn") |
|
|
|
@PostMapping("/getsTheSubColumn") |
|
|
|
public R getsTheSubColumn(@ApiParam(name = "id", value = "id", required = true) @RequestParam Integer id, |
|
|
|
public R getsTheSubColumn(@ApiParam(name = "id", value = "id", required = true) @RequestParam Integer id, @ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) { |
|
|
|
@ApiParam(name = "siteId", value = "站点id", required = true) @RequestParam Integer siteId) { |
|
|
|
|
|
|
|
String ids = this.getIds(id); |
|
|
|
String ids = this.getIds(id); |
|
|
|
return service.getsTheSubColumn(id, ids, siteId); |
|
|
|
return service.getsTheSubColumn(id, ids, siteId); |
|
|
|
|
|
|
|
|
|
|
@ -384,10 +366,7 @@ public class SysColumnController { |
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("某一级查全部") |
|
|
|
@ApiOperation("某一级查全部") |
|
|
|
@PostMapping("/oneLevelChecksThemAll") |
|
|
|
@PostMapping("/oneLevelChecksThemAll") |
|
|
|
public R oneLevelChecksThemAll(@ApiParam(name = "id", value = "栏目id", required = true) @RequestParam Integer id, |
|
|
|
public R oneLevelChecksThemAll(@ApiParam(name = "id", value = "栏目id", required = true) @RequestParam Integer id, @ApiParam(name = "isSort", value = "判断是否为排序接口调用(1为排序接口调用 0我栏目管理列表调用)", required = true) @RequestParam Integer isSort, @ApiParam(name = "ids", value = "主键", required = true) @RequestParam Integer siteId) { |
|
|
|
@ApiParam(name = "isSort", value = "判断是否为排序接口调用(1为排序接口调用 0我栏目管理列表调用)", required = |
|
|
|
|
|
|
|
true) @RequestParam Integer isSort, @ApiParam(name = "ids", value = "主键", |
|
|
|
|
|
|
|
required = true) @RequestParam Integer siteId) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer pid = service.oneLevelChecksThemAll(id); |
|
|
|
Integer pid = service.oneLevelChecksThemAll(id); |
|
|
|
String ids = this.getIds(pid); |
|
|
|
String ids = this.getIds(pid); |
|
|
@ -404,12 +383,8 @@ public class SysColumnController { |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@ApiOperation("查询栏目下的文章(若选中栏目与子级全部栏目类型一致返回全部文章,反之查询选中栏目下的文章)") |
|
|
|
@ApiOperation("查询栏目下的文章(若选中栏目与子级全部栏目类型一致返回全部文章,反之查询选中栏目下的文章)") |
|
|
|
@PostMapping("/queryArticlesByColumnType") |
|
|
|
@PostMapping("/queryArticlesByColumnType") |
|
|
|
@Cacheable(value = "redis_articlesByColumnType", key = "#columnId") |
|
|
|
|
|
|
|
public R queryArticlesByColumnType(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) { |
|
|
|
public R queryArticlesByColumnType(@ApiParam(name = "columnId", value = "栏目id", required = true) @RequestParam Integer columnId) { |
|
|
|
String ids = this.getIds(columnId); |
|
|
|
String ids = this.getIds(columnId); |
|
|
|
if (StrUtil.isBlank(ids)) { |
|
|
|
|
|
|
|
return R.fail("栏目类型ID字符串不能为空"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return service.queryArticlesByColumnType(ids, columnId); |
|
|
|
return service.queryArticlesByColumnType(ids, columnId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|