Files
MoFin/specs/watchlist.json

43 lines
1.5 KiB
JSON
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{
"module": "watchlist",
"version": "1.0",
"purpose": "自选股列表管理。提供自选股查询和批量更新。",
"human_help": {
"title": "自选股管理",
"description": [
"管理老爸的自选股列表,与持仓分开存储。",
"数据存储在 SQLite (mofin.db) 的 watchlist_stocks 表。",
"小果扫描器会消费自选股信号并自动添加到自选列表。"
],
"usage": [
"GET /api/watchlist — 获取完整自选股列表",
"POST /api/update/watchlist — 批量更新自选股(由 cron 调用)"
],
"troubleshooting": [
"数据库查询失败 → 检查 mofin.db 是否可读写",
"自选股列表为空 → 确认 regenerate_all 或手动添加过自选股"
]
},
"ai_spec": {
"apis": [
{"method": "GET", "path": "/api/watchlist", "returns": "{stocks[{code, name, price, change_pct, currency, analysis{...}}]}"},
{"method": "POST", "path": "/api/update/watchlist", "returns": "{status:'ok'}"}
],
"dependencies": [
"mo_data.py — read_watchlist()",
"mofin_db.py — query_watchlist(), write_watchlist_stock()",
"xiaoguo_signal_consumer.py — 消费小果信号,自动加自选"
],
"constraints": [
"自选股也必须标注 currency 字段(HKD/CNY"
],
"related_files": [
"server.py — API 路由定义",
"mo_data.py — read_watchlist()",
"mofin_db.py — watchlist_stocks 表"
]
}
}