zhangtong 2 роки тому
батько
коміт
39fafa0589

+ 3 - 0
src/main/java/com/sagacloud/dict/TypeToInfosMap.java

@@ -87,6 +87,7 @@ public class TypeToInfosMap {
     public static void synCache(){
         HashMap<String, List<InfoPoint>> map = new HashMap<>();
         try {
+            log.info("======init====== TypeToInfosMap.synCache(): getAllInfoPoints()");
             JSONObject json = getAllInfoPoints();
             ObjectMapper mapper = new ObjectMapper();
             TypeFactory typeFactory = mapper.getTypeFactory();
@@ -104,6 +105,7 @@ public class TypeToInfosMap {
             log.error(Arrays.toString(e.getStackTrace()));
             log.error("Failed to syn TypeToInfosMap.");
         }
+        log.info("======init====== TypeToInfosMap.synCache(): synTypeToInfo()");
         synTypeToInfo();
     }
 
@@ -164,6 +166,7 @@ public class TypeToInfosMap {
             IOUtils.closeQuietly(inputStream);
             return (JSONObject) JSONValue.parse(allStr);
         }else{
+            log.info("======init====== TypeToInfosMap.synCache(): getAllInfoPoints(): InfoCode().queryAll()");
             return (JSONObject) JSONValue.parse(new InfoCode().queryAll(null));
         }
     }

+ 8 - 1
src/main/java/com/sagacloud/endpoints/InfoCode.java

@@ -3,11 +3,14 @@ package com.sagacloud.endpoints;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.sagacloud.dict.EqStaticInfo;
+import com.sagacloud.dict.TypeToInfosMap;
 import com.sagacloud.endpoints.item.PhysicalObject;
 import com.sagacloud.utils.Const;
 import com.sagacloud.utils.DpUtils;
 import com.sagacloud.utils.InfoCodeUtil;
 import com.sagacloud.utils.OssUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 import javax.ws.rs.GET;
 import javax.ws.rs.POST;
@@ -23,6 +26,9 @@ import java.util.Set;
 
 @Path("infocode")
 public class InfoCode {
+
+    private static final Logger log = LoggerFactory.getLogger(InfoCode.class);
+
     @Context
     private ResourceContext resourceContext;
     //	public static Hashtable<String, JSONArray> infoCodeMap = new Hashtable<>();
@@ -231,7 +237,8 @@ public class InfoCode {
             tmpSet.addAll(eqStaticInfo.getEcSet());
             tmpSet.addAll(eqStaticInfo.getEqSet());
             tmpSet.addAll(eqStaticInfo.getSysSet());
-            
+
+            log.info("======init====== TypeToInfosMap.synCache(): getAllInfoPoints(): InfoCode().queryAll(): InfoCodeUtil.queryDictId()");
             String ctmDictId = InfoCodeUtil.queryDictId(projectId);
             for (String key : tmpSet) {
                 result.put(key, InfoCodeUtil.getInfosForProperty(projectId, key, ctmDictId));