|
@@ -2,9 +2,13 @@ package com.diagbot.web;
|
|
|
|
|
|
import com.diagbot.annotation.SysLogger;
|
|
|
import com.diagbot.dto.RespDTO;
|
|
|
+import com.diagbot.facade.CacheFacade;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.cache.annotation.CacheEvict;
|
|
|
+import org.springframework.cache.annotation.Caching;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
@@ -18,9 +22,12 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
@RequestMapping("/cache")
|
|
|
@Api(value = "缓存相关API", tags = { "缓存相关API" })
|
|
|
@SuppressWarnings("unchecked")
|
|
|
+@Slf4j
|
|
|
public class CacheController {
|
|
|
+ @Autowired
|
|
|
+ CacheFacade cacheFacade;
|
|
|
|
|
|
- @ApiOperation(value = "清空缓存[by:gaodm]",
|
|
|
+ @ApiOperation(value = "清空标签缓存[by:gaodm]",
|
|
|
notes = "")
|
|
|
@PostMapping("/clear")
|
|
|
@SysLogger("clear")
|
|
@@ -28,4 +35,14 @@ public class CacheController {
|
|
|
public RespDTO<Boolean> clearCache() {
|
|
|
return RespDTO.onSuc(true);
|
|
|
}
|
|
|
+
|
|
|
+ @ApiOperation(value = "清除所有缓存[by:gaodm]",
|
|
|
+ notes = "")
|
|
|
+ @PostMapping("/allClear")
|
|
|
+ @SysLogger("allClear")
|
|
|
+ public RespDTO<Boolean> allClear() {
|
|
|
+ cacheFacade.clear();
|
|
|
+ log.info("清理ICSS,AIPT缓存成功!");
|
|
|
+ return RespDTO.onSuc(true);
|
|
|
+ }
|
|
|
}
|