43 lines
1.6 KiB
JSON
43 lines
1.6 KiB
JSON
{
|
||
"module": "market",
|
||
"version": "1.0",
|
||
"purpose": "市场观察数据。提供大盘指数和板块数据的查询和更新。",
|
||
|
||
"human_help": {
|
||
"title": "市场观察",
|
||
"description": [
|
||
"展示大盘指数(上证、深证、恒生等)和板块热度数据。",
|
||
"数据由 market_watch.py cron(每 30 分钟)自动采集。",
|
||
"优先从 DB 读取(market_snapshots / sector_snapshots 表),DB 无数据时 fallback 到 market.json。"
|
||
],
|
||
"usage": [
|
||
"GET /api/market — 获取最新市场数据(指数 + 板块)",
|
||
"POST /api/update/market — 更新市场数据(由 market_watch 调用)"
|
||
],
|
||
"troubleshooting": [
|
||
"市场数据为空 → 检查 market_watch cron 是否正常运行",
|
||
"数据显示旧 → 手动运行 python3 market_watch.py 更新"
|
||
]
|
||
},
|
||
|
||
"ai_spec": {
|
||
"apis": [
|
||
{"method": "GET", "path": "/api/market", "returns": "{indices[{name, code, price, change_pct}], sectors[{name, change_pct, leader}]}"},
|
||
{"method": "POST", "path": "/api/update/market", "returns": "{status:'ok'}"}
|
||
],
|
||
"dependencies": [
|
||
"mofin_db.py — market_snapshots / sector_snapshots 表",
|
||
"market_watch.py — 大盘采集 cron(*/30 9-15)",
|
||
"market_screener.py — 全市场筛选 cron"
|
||
],
|
||
"constraints": [
|
||
"DB 优先读取,JSON 仅做 fallback"
|
||
],
|
||
"related_files": [
|
||
"server.py — /api/market, /api/update/market",
|
||
"market_watch.py — 大盘数据采集",
|
||
"market_screener.py — 全市场筛选"
|
||
]
|
||
}
|
||
}
|