Version 9b #1
|
|
@ -644,6 +644,16 @@ def get_stats(x_profile_id: Optional[str]=Header(default=None), session: dict=De
|
|||
# ── AI Insights ───────────────────────────────────────────────────────────────
|
||||
import httpx, json
|
||||
|
||||
@app.get("/api/insights/latest")
|
||||
def get_latest_insights(x_profile_id: Optional[str]=Header(default=None), session: dict=Depends(require_auth)):
|
||||
"""Get latest AI insights across all scopes."""
|
||||
pid = get_pid(x_profile_id)
|
||||
with get_db() as conn:
|
||||
cur = get_cursor(conn)
|
||||
cur.execute("SELECT * FROM ai_insights WHERE profile_id=%s ORDER BY created DESC LIMIT 10", (pid,))
|
||||
rows = cur.fetchall()
|
||||
return [r2d(r) for r in rows]
|
||||
|
||||
@app.get("/api/ai/insights/{scope}")
|
||||
def get_ai_insight(scope: str, x_profile_id: Optional[str]=Header(default=None), session: dict=Depends(require_auth)):
|
||||
pid = get_pid(x_profile_id)
|
||||
|
|
@ -1111,6 +1121,11 @@ def get_me(session: dict=Depends(require_auth)):
|
|||
pid = session['profile_id']
|
||||
return get_profile(pid, session)
|
||||
|
||||
@app.get("/api/auth/status")
|
||||
def auth_status():
|
||||
"""Health check endpoint."""
|
||||
return {"status": "ok", "service": "mitai-jinkendo", "version": "v9b"}
|
||||
|
||||
@app.post("/api/auth/password-reset-request")
|
||||
@limiter.limit("3/minute")
|
||||
async def password_reset_request(req: PasswordResetRequest, request: Request):
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user