From 7093bbad9379116c432e4da278a40cc86303c76f Mon Sep 17 00:00:00 2001
From: admin <weikou2014>
Date: 星期四, 02 十一月 2023 11:30:24 +0800
Subject: [PATCH] bug修复

---
 utils/hosting_api_util.py |   30 ++++++++++++++++++++++++++++--
 1 files changed, 28 insertions(+), 2 deletions(-)

diff --git a/utils/hosting_api_util.py b/utils/hosting_api_util.py
index d8b5374..09ed1c1 100644
--- a/utils/hosting_api_util.py
+++ b/utils/hosting_api_util.py
@@ -36,7 +36,9 @@
 API_TYPE_GET_ENV = "get_env"  # 鑾峰彇鐜淇℃伅
 API_TYPE_SYNC_L1_TARGET_CODES = "sync_l1_subscript_codes"  # 鍚屾L1闇�瑕佽闃呯殑浠g爜
 API_TYPE_SYSTEM_LOG = "system_log"  # 绯荤粺鏃ュ織
-
+API_TYPE_GET_FROM_DATA_SERVER = "get_from_data_server"  # 浠庢暟鎹湇鍔″櫒鎷夊彇鏁版嵁
+API_TYPE_CODE_TRADE_INFO = "code_trade_info"  # 浠g爜浜ゆ槗淇℃伅
+API_TYPE_CODE_L2_LISTEN_ACTIVE_COUNT = "l2_listen_active_count"  # L2鏈夋晥鐩戝惉鏁伴噺
 # 瓒呮椂鏃堕棿2s
 TIMEOUT = 5.0
 
@@ -143,7 +145,7 @@
                                     "code": code,
                                     "accountID": accountID,
                                     "orderSysID": orderSysID,
-                                    "sinfo": f"cancel_order_{code}_{round(time.time() * 1000)}"})
+                                    "sinfo": f"cb_{code}_{round(time.time() * 1000)}"})
     return __read_response(client, request_id, blocking)
 
 
@@ -269,6 +271,30 @@
     return __read_response(client, request_id, blocking)
 
 
+# 鎷夊彇data_server鐨勫唴瀹�
+def get_from_data_server(path, params, blocking=True):
+    request_id, client = __request(ClientSocketManager.CLIENT_TYPE_TRADE,
+                                   {"type": API_TYPE_GET_FROM_DATA_SERVER, "path": path, "params": params,
+                                    "sinfo": f"cb_{API_TYPE_GET_FROM_DATA_SERVER}_{round(time.time() * 1000)}"})
+    return __read_response(client, request_id, blocking, timeout=30)
+
+
+# 鑾峰彇浠g爜鐨勪氦鏄撲俊鎭�
+def get_code_trade_info(code, blocking=True):
+    request_id, client = __request(ClientSocketManager.CLIENT_TYPE_TRADE,
+                                   {"type": API_TYPE_CODE_TRADE_INFO, "code": code,
+                                    "sinfo": f"cb_{API_TYPE_CODE_TRADE_INFO}_{round(time.time() * 1000)}"})
+    return __read_response(client, request_id, blocking, timeout=30)
+
+
+# L2鏈夋晥鐩戝惉鏁伴噺
+def get_l2_listen_active_count(blocking=True):
+    request_id, client = __request(ClientSocketManager.CLIENT_TYPE_TRADE,
+                                   {"type": API_TYPE_CODE_L2_LISTEN_ACTIVE_COUNT,
+                                    "sinfo": f"cb_{API_TYPE_CODE_L2_LISTEN_ACTIVE_COUNT}_{round(time.time() * 1000)}"})
+    return __read_response(client, request_id, blocking, timeout=30)
+
+
 if __name__ == "__main__":
     d = {"id": "123123"}
     print(d.pop("id"))

--
Gitblit v1.8.0