Expand recommend table with gap, daily stats, and client-side sorting

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-06-25 17:36:31 +08:00
parent a56370d2af
commit b641a4eaa0
6 changed files with 324 additions and 28 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ from typing import Callable, Optional
from contract_specs import get_contract_spec
from fee_specs import calc_fee_breakdown
from recommend_trend import analyze_product_trend, sort_recommend_by_trend
from recommend_trend import analyze_product_daily, sort_recommend_by_trend
from symbols import PRODUCTS
logger = logging.getLogger(__name__)
@@ -128,7 +128,7 @@ def list_product_recommendations(
main_code = (quote.get("ths_code") or "").strip()
row["main_code"] = main_code
if main_code:
row.update(analyze_product_trend(main_code))
row.update(analyze_product_daily(main_code))
return row
except Exception as exc:
logger.warning("recommend product failed %s: %s", ths, exc)