feat: 移除公开触发AI分析接口,仅管理面板可用
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user