Parcourir la source

feat: http 删除远端缓存 1

shc il y a 8 mois
Parent
commit
09f832c471

+ 8 - 2
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/ApiControllerV2.java

@@ -36,10 +36,16 @@ public class ApiControllerV2 {
     private R<Boolean> delCache(@Validated @RequestBody Map<String, String> cacheKey) {
 
         String s = cacheKey.get("key");
-        if (StrUtil.isBlank(s)) {
+        String v1 = cacheKey.get("v1");
+        String v2 = cacheKey.get("v2");
+        String ck = String.format("%s:%s:%s", s, v1, v2);
+
+        log.info("key_info:{}", ck);
+        if (StrUtil.isBlank(ck)) {
             return R.failed("缓存key不存在");
         }
-        redisTemplate.delete(s);
+
+        redisTemplate.delete(ck);
 
         return R.ok();