feat(agent-office): 매매알람 텔레그램 notify(너+아내) 엔드포인트

This commit is contained in:
2026-07-02 20:01:10 +09:00
parent 2906a2ae3e
commit 2bce07c367
3 changed files with 116 additions and 0 deletions

View File

@@ -278,3 +278,19 @@ async def trigger_signal_check(source: str = "light"):
if not agent:
raise HTTPException(status_code=503, detail="lotto agent not registered")
return await agent.run_signal_check(source=source)
# --- Trade Alert Notify Endpoint ---
class TradeAlertBody(BaseModel):
alerts: List[Dict[str, Any]] = []
@app.post("/api/agent-office/stock/trade-alert")
async def stock_trade_alert(body: TradeAlertBody):
from .notifiers.telegram_trade import send_trade_alerts
from .db import add_log
res = await send_trade_alerts(body.alerts)
for a in body.alerts:
add_log("stock", f"매매알람 {a.get('kind')} {a.get('ticker')} {a.get('condition')}", "info")
return res