Эх сурвалжийг харах

Merge branch 'master' of http://124.220.229.80:9093/root/operating

linxk 6 өдөр өмнө
parent
commit
90a48058d5

+ 15 - 15
operating-service/src/main/java/com/txz/operating/dubbo/impl/OperatingInterfacesDubboServiceImpl.java

@@ -40,22 +40,22 @@ public class OperatingInterfacesDubboServiceImpl implements OperatingInterfacesD
     @Resource
     private RedisTemplate redisTemplate;
     
-    private Map<String, InterfacesDTO> map = new HashMap<>();
+    // private Map<String, InterfacesDTO> map = new HashMap<>();
     
     @Override
     public Result<InterfacesDTO> detailForGateway(String servicePath) {
         servicePath = servicePath.replaceAll("/\\d+$", "");
-        InterfacesDTO interfaces = map.get(servicePath);
-        if (null != interfaces) {
-            return Result.success(interfaces);
-        } else {
+        // InterfacesDTO interfaces = map.get(servicePath);
+        // if (null != interfaces) {
+        //     return Result.success(interfaces);
+        // } else {
             // 处理 通配符 * 部分
-            for (String key : map.keySet()) {
-                InterfacesDTO temp = map.get(key);
-                if (key.contains("*") && servicePath.startsWith(key.substring(0, key.indexOf("*")))) {
-                    return Result.success(temp);
-                }
-            }
+            // for (String key : map.keySet()) {
+            //     InterfacesDTO temp = map.get(key);
+            //     if (key.contains("*") && servicePath.startsWith(key.substring(0, key.indexOf("*")))) {
+            //         return Result.success(temp);
+            //     }
+            // }
             // 查询数据库
             InterfacesDTO dto = null;
             List<Interfaces> all = interfacesService.findAll();
@@ -63,11 +63,11 @@ public class OperatingInterfacesDubboServiceImpl implements OperatingInterfacesD
                 String key = interfacez.getServicePath();
                 if (key.equals(servicePath)) {
                     dto = InterfacesDTO.generator(interfacez);
-                    map.put(key, dto);
+                    // map.put(key, dto);
                     return Result.success(dto);
                 } else if (key.contains("*") && servicePath.startsWith(key.substring(0, key.indexOf("*")))) {
                     dto = InterfacesDTO.generator(interfacez);
-                    map.put(key, dto);
+                    // map.put(key, dto);
                     return Result.success(dto);
                 }
             }
@@ -93,10 +93,10 @@ public class OperatingInterfacesDubboServiceImpl implements OperatingInterfacesD
                     .build();
             interfacesService.save(build);
             dto = InterfacesDTO.generator(build);
-            map.put(servicePath, dto);
+            // map.put(servicePath, dto);
             return Result.success(dto);
             // return Result.fail("未找到接口");
-        }
+        // }
     }