From 1e9634f5b69c72914b6a46d2f1330df2cf69046b Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期四, 23 五月 2024 11:19:54 +0800 Subject: [PATCH] 可转债增加交易刷新 --- utils/hosting_api_util.py | 15 ++++++++++++++- middle_cb_api_server.py | 7 +++++++ 2 files changed, 21 insertions(+), 1 deletions(-) diff --git a/middle_cb_api_server.py b/middle_cb_api_server.py index dadcb75..7b21615 100644 --- a/middle_cb_api_server.py +++ b/middle_cb_api_server.py @@ -146,6 +146,13 @@ result = hosting_api_util.get_account_money_for_cb() return_str = json.dumps(result) break + elif type_ == 'refresh_trade_data': + # 楠岃瘉绛惧悕 + data = data_json["data"] + refresh_type = data["ctype"] + result = hosting_api_util.refresh_trade_data_for_cb(refresh_type) + return_str = json.dumps(result) + break elif type_ == 'common': params = data_json["data"] diff --git a/utils/hosting_api_util.py b/utils/hosting_api_util.py index 3e06172..7d73a28 100644 --- a/utils/hosting_api_util.py +++ b/utils/hosting_api_util.py @@ -378,6 +378,20 @@ return __read_response(client, request_id, blocking) +def refresh_trade_data_for_cb(refresh_type, blocking=True): + """ + 鍒锋柊浜ゆ槗鏁版嵁 + :param refresh_type: + :param blocking: + :return: + """ + + request_id, client = __request(ClientSocketManager.CLIENT_TYPE_TRADE_CB, + {"type": API_TYPE_REFRESH_TRADE_DATA, "ctype": refresh_type, + "sinfo": f"cb_{API_TYPE_REFRESH_TRADE_DATA}_{round(time.time() * 1000)}"}) + return __read_response(client, request_id, blocking) + + def get_account_money_for_cb(blocking=True): """ 鑾峰彇璐︽埛璧勯噾鎯呭喌 @@ -399,7 +413,6 @@ {"type": API_TYPE_REFRESH_TRADE_DATA, "ctype": type_, "sinfo": f"cb_{API_TYPE_REFRESH_TRADE_DATA}_{round(time.time() * 1000)}"}) return __read_response(client, request_id, blocking) - def common_request_for_cb(params, blocking=True): -- Gitblit v1.8.0