|
|
@ -93,9 +93,9 @@ public class SysContentController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "新增", response = SysContent.class) |
|
|
|
@ApiOperation(value = "新增", response = SysContent.class) |
|
|
|
public R save(@RequestBody @Valid @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { |
|
|
|
public R save(@RequestBody @Valid @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { |
|
|
|
|
|
|
|
|
|
|
@ -115,9 +115,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/update") |
|
|
|
@PostMapping("/update") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "修改", response = SysContent.class) |
|
|
|
@ApiOperation(value = "修改", response = SysContent.class) |
|
|
|
public R update(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { |
|
|
|
public R update(@RequestBody @ApiParam(name = "文章管理对象", value = "传入json格式", required = true) SysContent sysContent) { |
|
|
|
boolean updateState = service.updateById(sysContent); |
|
|
|
boolean updateState = service.updateById(sysContent); |
|
|
@ -126,9 +126,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/delete") |
|
|
|
@PostMapping("/delete") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "删除", response = SysContent.class) |
|
|
|
@ApiOperation(value = "删除", response = SysContent.class) |
|
|
|
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { |
|
|
|
public R delete(@ApiParam(name = "id", value = "主键", required = true) @RequestParam Integer id) { |
|
|
|
UpdateWrapper<SysFilesEntity> queryWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<SysFilesEntity> queryWrapper = new UpdateWrapper<>(); |
|
|
@ -142,9 +142,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "批量删除文章", response = SysContent.class) |
|
|
|
@ApiOperation(value = "批量删除文章", response = SysContent.class) |
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List<Integer> ids) { |
|
|
|
public R batchDeletion(@ApiParam(name = "ids", value = "主键", required = true) @RequestParam List<Integer> ids) { |
|
|
|
for (Integer id : ids) { |
|
|
|
for (Integer id : ids) { |
|
|
@ -167,9 +167,9 @@ public class SysContentController { |
|
|
|
@PostMapping("/newlyPublishedArticles") |
|
|
|
@PostMapping("/newlyPublishedArticles") |
|
|
|
@ApiOperation(value = "站点最新发布的文章", response = PageContentReqVO.class) |
|
|
|
@ApiOperation(value = "站点最新发布的文章", response = PageContentReqVO.class) |
|
|
|
@Cacheable(value = "redis_newlyPublishedArticles", key = "#content.toString()") |
|
|
|
@Cacheable(value = "redis_newlyPublishedArticles", key = "#content.toString()") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
public R newlyPublishedArticles(@Valid @RequestBody PageContentReqVO content) { |
|
|
|
public R newlyPublishedArticles(@Valid @RequestBody PageContentReqVO content) { |
|
|
|
return service.newlyPublishedArticles(content); |
|
|
|
return service.newlyPublishedArticles(content); |
|
|
|
} |
|
|
|
} |
|
|
@ -201,11 +201,12 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/articleEnableOrDisable") |
|
|
|
@PostMapping("/articleEnableOrDisable") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "文章启用禁用", response = SysContent.class) |
|
|
|
@ApiOperation(value = "文章启用禁用", response = SysContent.class) |
|
|
|
public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id, @ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { |
|
|
|
public R articleEnableOrDisable(@ApiParam(name = "id", value = "文章id", required = true) @RequestParam Integer id, |
|
|
|
|
|
|
|
@ApiParam(name = "isDisable", value = "是否禁用(0默认,0启用 1禁用)", required = true) @RequestParam Integer isDisable) { |
|
|
|
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>(); |
|
|
|
UpdateWrapper<SysContent> updateWrapper = new UpdateWrapper<>(); |
|
|
|
updateWrapper.set("is_disable", isDisable); |
|
|
|
updateWrapper.set("is_disable", isDisable); |
|
|
|
updateWrapper.eq("id", id); |
|
|
|
updateWrapper.eq("id", id); |
|
|
@ -237,9 +238,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/articleTopOperation") |
|
|
|
@PostMapping("/articleTopOperation") |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar", "redis_listWithTreeMenuVisible", |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", |
|
|
|
allEntries = true) |
|
|
|
"redis_controlDisplayNavigationMenu", "redis_newlyPublishedArticles"}, allEntries = true) |
|
|
|
@ApiOperation(value = "文章置顶/取消置顶", response = SysContent.class) |
|
|
|
@ApiOperation(value = "文章置顶/取消置顶", response = SysContent.class) |
|
|
|
public R articleTopOperation(@ApiParam(name = "isTop", value = "是否置顶(默认为0 不置顶 1为置顶)", required = true) @RequestParam Integer isTop, @ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) { |
|
|
|
public R articleTopOperation(@ApiParam(name = "isTop", value = "是否置顶(默认为0 不置顶 1为置顶)", required = true) @RequestParam Integer isTop, @ApiParam(name = "articleId", value = "文章Id", required = true) @RequestParam Integer articleId) { |
|
|
|
//是否置顶(默认为0 不置顶 1为置顶)
|
|
|
|
//是否置顶(默认为0 不置顶 1为置顶)
|
|
|
@ -270,8 +271,7 @@ public class SysContentController { |
|
|
|
@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 = "articleFieldCache_" + "siteId_" + siteId + "userId_" + userId; |
|
|
|
String key = "articleFieldCache_" + "siteId_" + siteId + "userId_" + userId; |
|
|
@ -310,7 +310,7 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
// 直接将字符串分割成列表
|
|
|
|
// 直接将字符串分割成列表
|
|
|
|
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(",")); |
|
|
|