| | |
| | | |
| | | import psutil |
| | | |
| | | import constant |
| | | from db import redis_manager_delegate as redis_manager, mysql_data_delegate as mysql_data |
| | | from db.redis_manager_delegate import RedisUtils |
| | | from log_module import log_export |
| | |
| | | print("接收到POST请求:", str(path)) |
| | | url = urlparse.urlparse(path) |
| | | if url.path == "/trade_callback": |
| | | # 接受开盘啦数据 |
| | | body = self.__parse_request() |
| | | if type(body) != str: |
| | | huaxin_trade_api.add_trade_callback_data(json.dumps(body)) |
| | | else: |
| | | huaxin_trade_api.add_trade_callback_data(body) |
| | | if constant.IS_SIMULATED_TRADE: |
| | | # 接受开盘啦数据 |
| | | body = self.__parse_request() |
| | | if type(body) != str: |
| | | huaxin_trade_api.add_trade_callback_data(json.dumps(body)) |
| | | else: |
| | | huaxin_trade_api.add_trade_callback_data(body) |
| | | result_str = json.dumps({"code": 0}) |
| | | elif url.path == "/buy": |
| | | # 签名验证 |