|
@@ -1,7 +1,9 @@
|
|
|
package com.fs.his.controller;
|
|
|
|
|
|
+import java.util.Collection;
|
|
|
import java.util.List;
|
|
|
|
|
|
+import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.his.vo.OptionsVO;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -24,7 +26,7 @@ import com.fs.common.core.page.TableDataInfo;
|
|
|
|
|
|
/**
|
|
|
* 文章分类Controller
|
|
|
- *
|
|
|
+ *
|
|
|
* @author fs
|
|
|
* @date 2023-07-04
|
|
|
*/
|
|
@@ -34,6 +36,8 @@ public class FsArticleCateController extends BaseController
|
|
|
{
|
|
|
@Autowired
|
|
|
private IFsArticleCateService fsArticleCateService;
|
|
|
+ @Autowired
|
|
|
+ RedisCache redisCache;
|
|
|
|
|
|
/**
|
|
|
* 查询文章分类列表
|
|
@@ -78,7 +82,12 @@ public class FsArticleCateController extends BaseController
|
|
|
@PostMapping
|
|
|
public AjaxResult add(@RequestBody FsArticleCate fsArticleCate)
|
|
|
{
|
|
|
- return toAjax(fsArticleCateService.insertFsArticleCate(fsArticleCate));
|
|
|
+ int i = fsArticleCateService.insertFsArticleCate(fsArticleCate);
|
|
|
+ Collection<String> keys = redisCache.keys("getArticleCateList*");
|
|
|
+ for (String key : keys) {
|
|
|
+ redisCache.deleteObject(key);
|
|
|
+ }
|
|
|
+ return toAjax(i);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -89,7 +98,12 @@ public class FsArticleCateController extends BaseController
|
|
|
@PutMapping
|
|
|
public AjaxResult edit(@RequestBody FsArticleCate fsArticleCate)
|
|
|
{
|
|
|
- return toAjax(fsArticleCateService.updateFsArticleCate(fsArticleCate));
|
|
|
+ int i = fsArticleCateService.updateFsArticleCate(fsArticleCate);
|
|
|
+ Collection<String> keys = redisCache.keys("getArticleCateList*");
|
|
|
+ for (String key : keys) {
|
|
|
+ redisCache.deleteObject(key);
|
|
|
+ }
|
|
|
+ return toAjax(i);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -100,7 +114,12 @@ public class FsArticleCateController extends BaseController
|
|
|
@DeleteMapping("/{cateIds}")
|
|
|
public AjaxResult remove(@PathVariable Long[] cateIds)
|
|
|
{
|
|
|
- return toAjax(fsArticleCateService.deleteFsArticleCateByCateIds(cateIds));
|
|
|
+ int i = fsArticleCateService.deleteFsArticleCateByCateIds(cateIds);
|
|
|
+ Collection<String> keys = redisCache.keys("getArticleCateList*");
|
|
|
+ for (String key : keys) {
|
|
|
+ redisCache.deleteObject(key);
|
|
|
+ }
|
|
|
+ return toAjax(i);
|
|
|
}
|
|
|
|
|
|
/**
|