feat: 品种推荐与下单显示主力合约

推荐列表展示当前主力代码;下单品种支持中文/代码搜索并按交易所分组选择主力合约。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-24 12:56:06 +08:00
parent 3ba3be6035
commit aea9aca472
7 changed files with 94 additions and 41 deletions
+2 -2
View File
@@ -29,11 +29,11 @@ def filter_affordable_recommendations(rows: list[dict]) -> list[dict]:
def refresh_recommend_cache(
conn,
capital: float,
price_fn: Callable[[str], Optional[float]],
quote_fn: Callable[[str], Optional[dict]],
) -> list[dict]:
"""后台拉行情、筛选并写入数据库。"""
ensure_recommend_tables(conn)
all_rows = list_product_recommendations(capital, price_fn)
all_rows = list_product_recommendations(capital, quote_fn)
rows = filter_affordable_recommendations(all_rows)
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
conn.execute(