|
|
@ -23,6 +23,7 @@ import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
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.Cacheable; |
|
|
|
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; |
|
|
@ -92,6 +93,9 @@ public class SysContentController { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/save") |
|
|
|
@PostMapping("/save") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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) { |
|
|
|
|
|
|
|
|
|
|
@ -111,6 +115,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/update") |
|
|
|
@PostMapping("/update") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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); |
|
|
@ -119,6 +126,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/delete") |
|
|
|
@PostMapping("/delete") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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<>(); |
|
|
@ -132,6 +142,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
@PostMapping("/batchDeletion") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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) { |
|
|
@ -154,6 +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", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
allEntries = true) |
|
|
|
public R newlyPublishedArticles(@Valid @RequestBody PageContentReqVO content) { |
|
|
|
public R newlyPublishedArticles(@Valid @RequestBody PageContentReqVO content) { |
|
|
|
return service.newlyPublishedArticles(content); |
|
|
|
return service.newlyPublishedArticles(content); |
|
|
|
} |
|
|
|
} |
|
|
@ -185,6 +201,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/articleEnableOrDisable") |
|
|
|
@PostMapping("/articleEnableOrDisable") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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<>(); |
|
|
@ -218,6 +237,9 @@ public class SysContentController { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/articleTopOperation") |
|
|
|
@PostMapping("/articleTopOperation") |
|
|
|
|
|
|
|
@CacheEvict(value = {"redis_listWithTree", "redis_columnDisplayFloatingBar","redis_listWithTreeMenuVisible", |
|
|
|
|
|
|
|
"redis_showTheFooterAccordingToTheColumn", "redis_articlesByColumnType", "redis_columnDetails", "redis_controlDisplayNavigationMenu"}, |
|
|
|
|
|
|
|
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为置顶)
|
|
|
|