From 28441b3922e6188f643d145a32c55d4fa285af84 Mon Sep 17 00:00:00 2001
From: wuxw7 <wuxw7@asiainfo.com>
Date: 星期三, 13 六月 2018 00:11:52 +0800
Subject: [PATCH] 日志保存 和 调用链开发

---
 CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceSMOImpl.java |   28 +++++++++++++++++++---------
 1 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceSMOImpl.java b/CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceSMOImpl.java
index eef7768..cdec684 100644
--- a/CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceSMOImpl.java
+++ b/CenterService/src/main/java/com/java110/center/smo/impl/CenterServiceSMOImpl.java
@@ -8,23 +8,25 @@
 import com.java110.common.cache.MappingCache;
 import com.java110.common.constant.*;
 import com.java110.common.exception.*;
-import com.java110.core.factory.AuthenticationFactory;
-import com.java110.core.factory.DataFlowFactory;
-import com.java110.core.factory.DataTransactionFactory;
 import com.java110.common.kafka.KafkaFactory;
 import com.java110.common.log.LoggerEngine;
 import com.java110.common.util.*;
-import com.java110.entity.center.Business;
 import com.java110.core.context.DataFlow;
-import com.java110.entity.center.*;
+import com.java110.core.factory.AuthenticationFactory;
+import com.java110.core.factory.DataFlowFactory;
+import com.java110.core.factory.DataTransactionFactory;
+import com.java110.entity.center.AppRoute;
+import com.java110.entity.center.AppService;
+import com.java110.entity.center.Business;
+import com.java110.entity.center.DataFlowLinksCost;
 import com.java110.event.center.DataFlowEventPublishing;
+
 import com.java110.service.smo.IQueryServiceSMO;
 import org.apache.commons.lang3.math.NumberUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpEntity;
 import org.springframework.http.HttpHeaders;
 import org.springframework.stereotype.Service;
-import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.client.RestTemplate;
 
 import java.util.*;
@@ -63,6 +65,10 @@
             reqJson = decrypt(reqJson,headers);
             //1.0 鍒涘缓鏁版嵁娴�
             dataFlow = DataFlowFactory.newInstance(DataFlow.class).builder(reqJson, headers);
+
+            /*LogAgent.sendLog(dataFlow.reBuilder(dataFlow.getTransactionId(),LogAgent.LOG_TYPE_S,LogAgent.LOG_STATUS_S,
+                    dataFlow.getRequestURL(),dataFlow.getReqData(),dataFlow.getHeaders()));
+*/
             //2.0 鍔犺浇閰嶇疆淇℃伅
             initConfigData(dataFlow);
             //3.0 鏍¢獙 APPID鏄惁鏈夋潈闄愭搷浣渟erviceCode
@@ -123,17 +129,21 @@
                 dataFlow.setEndDate(endDate);
                 dataFlow.setResJson(responseJson);
                 //娣诲姞鑰楁椂
-                DataFlowFactory.addCostTime(dataFlow, "service", "涓氬姟澶勭悊鎬昏�楁椂", dataFlow.getStartDate(), dataFlow.getEndDate());
+                //DataFlowFactory.addCostTime(dataFlow, "service", "涓氬姟澶勭悊鎬昏�楁椂", dataFlow.getStartDate(), dataFlow.getEndDate());
 
                 //杩欓噷淇濆瓨鑰楁椂锛屼互鍙婃棩蹇�
-                saveLogMessage(dataFlow.getReqJson(), dataFlow.getResJson());
+                //saveLogMessage(dataFlow.getReqJson(), dataFlow.getResJson());
 
                 //淇濆瓨鑰楁椂
-                saveCostTimeLogMessage(dataFlow);
+                //saveCostTimeLogMessage(dataFlow);
                 //澶勭悊杩斿洖鎶ユ枃閴存潈
                 AuthenticationFactory.putSign(dataFlow, responseJson);
             }
             resJson = encrypt(responseJson.toJSONString(),headers);
+            /*LogAgent.sendLog(dataFlow.reBuilder(dataFlow.getTransactionId(),
+                            LogAgent.LOG_TYPE_C,DataTransactionFactory.isSuccessBusiness(responseJson)?
+                            LogAgent.LOG_STATUS_S:LogAgent.LOG_STATUS_F,
+                    dataFlow.getRequestURL(),responseJson.toJSONString(),headers));*/
             return resJson;
 
         }

--
Gitblit v1.8.0