| | |
| | | |
| | | import dask |
| | | |
| | | import log |
| | | from code_attribute import gpcode_manager |
| | | from log import logger_request_debug |
| | | from log_module import log_analyse, log_export |
| | |
| | | def do_GET(self): |
| | | path = self.path |
| | | url = urlparse.urlparse(path) |
| | | thread_id = random.randint(0, 1000000) |
| | | logger_request_debug.info(f"GET 请求开始({thread_id}):{url.path}") |
| | | log.request_info("DATA_SERVER_GET", f"GET 请求开始:{url.path}") |
| | | try: |
| | | if url.path == "/kpl/get_limit_up_list": |
| | | response_data = self.__get_limit_up_list() |
| | |
| | | result = hosting_api_util.get_from_data_server(url.path, ps_dict) |
| | | self.__send_response(result) |
| | | finally: |
| | | logger_request_debug.info(f"GET 请求结束({thread_id}):{url.path}") |
| | | |
| | | log.request_info("DATA_SERVER_GET", f"GET 请求结束") |
| | | |
| | | def do_POST(self): |
| | | thread_id = random.randint(0, 1000000) |
| | | path = self.path |
| | | url = urlparse.urlparse(path) |
| | | logger_request_debug.info(f"POST 请求开始({thread_id}):{url.path}") |
| | | log.request_info("DATA_SERVER_POST", f"POST 请求开始:{url.path}") |
| | | try: |
| | | if url.path == "/upload_kpl_data": |
| | | # 接受开盘啦数据 |
| | |
| | | result_str = self.__process_kpl_data(params) |
| | | self.__send_response(result_str) |
| | | finally: |
| | | logger_request_debug.info(f"POST 请求结束({thread_id}):{url.path}") |
| | | log.request_info("DATA_SERVER_POST", f"POST 请求结束") |
| | | |
| | | def __process_kpl_data(self, data): |
| | | data = json.loads(json.dumps(data).replace("概念", "")) |