feat(broadcast): 播报系统Tab+API+历史查询+消息分类
This commit is contained in:
@@ -2445,6 +2445,33 @@ def api_research_execution_log():
|
||||
return jsonify([dict(r) for r in rows])
|
||||
|
||||
|
||||
# ── Broadcast System API ──
|
||||
@app.route("/api/broadcast/recent")
|
||||
def api_broadcast_recent():
|
||||
from broadcast import get_recent
|
||||
hours = int(request.args.get("hours", "72"))
|
||||
category = request.args.get("category")
|
||||
limit = int(request.args.get("limit", "200"))
|
||||
return jsonify(get_recent(hours=hours, category=category, limit=limit))
|
||||
|
||||
@app.route("/api/broadcast/search")
|
||||
def api_broadcast_search():
|
||||
from broadcast import search_history
|
||||
start = request.args.get("start")
|
||||
end = request.args.get("end")
|
||||
keyword = request.args.get("keyword")
|
||||
category = request.args.get("category")
|
||||
limit = int(request.args.get("limit", "100"))
|
||||
return jsonify(search_history(start_date=start, end_date=end, keyword=keyword, category=category, limit=limit))
|
||||
|
||||
@app.route("/api/broadcast/archive", methods=["POST"])
|
||||
def api_broadcast_archive():
|
||||
from broadcast import archive_old
|
||||
days = int(request.args.get("days", "7"))
|
||||
archive_old(days=days)
|
||||
return jsonify({"ok": True})
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
port = int(os.environ.get("PORT", 8899))
|
||||
print(f"🚀 MoFin Dashboard → http://0.0.0.0:{port}")
|
||||
|
||||
Reference in New Issue
Block a user