增加个删除所有缓存接口

This commit is contained in:
guoshengxiong 2025-10-30 16:32:46 +08:00
parent fe36de8bce
commit a0a4cc7577
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,27 @@
package com.zhgd.xmgl.modules.basicdata.controller;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.redis.lock.RedisRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping("/xmgl/cache")
public class CacheController {
@Lazy
@Autowired
private RedisRepository redisRepository;
/**
* 删除所有缓存
*/
@GetMapping("/clearAll")
public Result clearAllCache() {
redisRepository.flushDb();
return Result.ok();
}
}

View File

@ -78,6 +78,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
http.authorizeRequests()
//请求路径允许访问
.antMatchers("/xmgl/cache/clearAll").permitAll()
.antMatchers("/xmgl/videoScreenshot/captureScreenshotSync").permitAll()
.antMatchers("/xmgl/policeCameraItemFile/*").permitAll()
.antMatchers("/xmgl/workTicketOrderApp/*").permitAll()