From 4263df3e93eafe33ab1c9ab37deb3d468bae9845 Mon Sep 17 00:00:00 2001 From: luowenfeng <1092164058@qq.com> Date: Thu, 7 Jul 2022 14:54:45 +0800 Subject: [PATCH] =?UTF-8?q?feature(Redis=E7=9B=91=E6=8E=A7):=20=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/controller/admin/redis/RedisController.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java index 013145b96..ccbfe9e6f 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/redis/RedisController.java @@ -52,7 +52,7 @@ public class RedisController { @GetMapping("/get-key/{keyDefine}") @ApiOperation("获得 Redis keys 键名列表") - @PreAuthorize("@ss.hasPermission('infra:redis:get-key-define')") + @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult> getKeyDefineKeys(@PathVariable("keyDefine") String keyDefine) { Set Keys = stringRedisTemplate.keys(keyDefine + "*"); return success(Keys); @@ -60,7 +60,7 @@ public class RedisController { @DeleteMapping("/clear-key/{keyDefine}") @ApiOperation("删除 Redis Key 根据模板") - @PreAuthorize("@ss.hasPermission('infra:redis:clear-key-define')") + @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult clearKeyDefineKeys(@PathVariable("keyDefine") String keyDefine) { stringRedisTemplate.delete(Objects.requireNonNull(stringRedisTemplate.keys(keyDefine + "*"))); return success(Boolean.TRUE); @@ -68,7 +68,7 @@ public class RedisController { @GetMapping("/get-key/{keyDefine}/{cacheKey}") @ApiOperation("获得 Redis key 内容") - @PreAuthorize("@ss.hasPermission('infra:redis:get-key-value')") + @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult getKeyValue(@PathVariable("keyDefine") String keyDefine, @PathVariable("cacheKey") String cacheKey) { String cacheValue = stringRedisTemplate.opsForValue().get(cacheKey); return success(new RedisValuesRespVO(keyDefine, cacheKey, cacheValue)); @@ -76,7 +76,7 @@ public class RedisController { @DeleteMapping("/clear-key/{cacheKey}") @ApiOperation("删除 Redis Key 根据key") - @PreAuthorize("@ss.hasPermission('infra:redis:clear-key-value')") + @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult clearCacheKey(@PathVariable String cacheKey) { stringRedisTemplate.delete(cacheKey); return success(Boolean.TRUE); @@ -84,7 +84,7 @@ public class RedisController { @DeleteMapping("/clear-cache-all") @ApiOperation(value="删除 所有缓存", notes="不使用该接口") - @PreAuthorize("@ss.hasPermission('infra:redis:clear-cache-all')") + @PreAuthorize("@ss.hasPermission('infra:redis:get-key-list')") public CommonResult clearCacheAll() { Collection cacheKeys = stringRedisTemplate.keys("*"); stringRedisTemplate.delete(cacheKeys);