feat(agent-office): 매매알람 텔레그램 notify(너+아내) 엔드포인트
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user