fix(HEL-484): 中枢分时接口空 date 按当天查询

缺少或为空的 date 不再 400,按当天处理;显式历史日期保持原行为。

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
总工
2026-09-08 10:07:44 +08:00
co-authored by Cursor multica-agent
parent 3d2c1252f1
commit acde4de40d
4 changed files with 103 additions and 2 deletions
+6 -1
View File
@@ -269,8 +269,13 @@ class V1API:
code = str(q.get("code") or "").strip()
if not code:
raise ApiError("INVALID_ARGUMENT", "code is required")
raw_date = str(q.get("date") or "").strip()
try:
return fetch_intraday(self.db, code, yyyymmdd(q.get("date") or ""))
trade_date = yyyymmdd(raw_date or now_shanghai())
except ValueError as exc:
raise ApiError("INVALID_ARGUMENT", str(exc)) from exc
try:
return fetch_intraday(self.db, code, trade_date)
except RealtimeApiError as exc:
raise ApiError(exc.code, exc.message) from exc