| | |
| | | def OnTest(self, client_id, request_id, data, sk): |
| | | send_response( |
| | | json.dumps({"type": "response", "data": {"code": 0, "data": data}, "client_id": client_id, |
| | | "request_id": request_id}), type, client_id, request_id, show_log=False, sk=sk) |
| | | "request_id": request_id}), type, client_id, request_id, show_log=False) |
| | |
| | | except: |
| | | pass |
| | | return None |
| | | |
| | | |
| | | # 深证 |
| | | MARKET_TYPE_SZSE = 1 |
| | | # 上证 |
| | | MARKET_TYPE_SSE = 0 |
| | | # 未知 |
| | | MARKET_TYPE_UNKNOWN = -1 |
| | | |
| | | |
| | | def get_market_type(code): |
| | | """ |
| | | 根据股票代码 |
| | | :param code: |
| | | :return: |
| | | """ |
| | | if code.find("00") == 0 or code.find("30") == 0 or code.find("12") == 0: |
| | | return MARKET_TYPE_SZSE |
| | | elif code.find("60") == 0 or code.find("68") == 0 or code.find("11") == 0: |
| | | return MARKET_TYPE_SSE |
| | | else: |
| | | return MARKET_TYPE_UNKNOWN |