feat: 移除公开触发AI分析接口,仅管理面板可用

This commit is contained in:
Sakurasan
2026-09-01 19:16:09 +08:00
parent 45fe244330
commit 317ea483d0
2 changed files with 0 additions and 20 deletions
-10
View File
@@ -93,16 +93,6 @@ async def check_report(trade_date: str):
return JSONResponse({"data": {"hasReport": has, "tradeDate": trade_date}})
@router.post("/ai-analysis/trigger", summary="手动触发今日 AI 分析")
async def trigger_analysis():
now = datetime.now(_CST)
trade_date = now.strftime("%Y-%m-%d")
from services.ai_service import collect_ai_analysis
result = await collect_ai_analysis(trade_date)
return JSONResponse({"data": result})
@router.post("/ai-analysis/{report_id}/regenerate", summary="重新生成 AI 分析报告")
async def regenerate_report(report_id: int):
conn = get_connection()
-10
View File
@@ -45,16 +45,6 @@ export async function checkAiReport(tradeDate: string): Promise<boolean> {
return result.data?.hasReport || false;
}
export async function triggerAiAnalysis(): Promise<{ id: number; tokens_used: number }> {
const resp = await fetch(`${API_BASE}/api/ai-analysis/trigger`, { method: "POST" });
if (!resp.ok) {
const err = await resp.json().catch(() => ({}));
throw new Error(err.detail || "触发失败");
}
const result = await resp.json();
return result.data;
}
export async function regenerateAiReport(id: number): Promise<{ id: number; tokens_used: number }> {
const resp = await fetch(`${API_BASE}/api/ai-analysis/${id}/regenerate`, { method: "POST" });
if (!resp.ok) {