From 1ec45acb95db9428a41e4424c7bb07561bc6c814 Mon Sep 17 00:00:00 2001 From: gahusb Date: Wed, 15 Apr 2026 08:23:53 +0900 Subject: [PATCH] =?UTF-8?q?feat(lotto):=20curator=20candidates/context=20?= =?UTF-8?q?=EB=9D=BC=EC=9A=B0=ED=84=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/routers/__init__.py | 0 backend/app/routers/curator.py | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 backend/app/routers/__init__.py create mode 100644 backend/app/routers/curator.py diff --git a/backend/app/routers/__init__.py b/backend/app/routers/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/backend/app/routers/curator.py b/backend/app/routers/curator.py new file mode 100644 index 0000000..914a870 --- /dev/null +++ b/backend/app/routers/curator.py @@ -0,0 +1,24 @@ +"""큐레이터 입력 엔드포인트 — agent-office에서만 호출.""" +from fastapi import APIRouter +from ..curator_helpers import collect_candidates, build_context +from .. import db + +router = APIRouter(prefix="/api/lotto/curator") + + +@router.get("/candidates") +def candidates(n: int = 20): + ctx = build_context() + hot = set(ctx["hot_numbers"]) + cold = set(ctx["cold_numbers"]) + latest = db.get_latest_draw() + draw_no = (latest["drw_no"] + 1) if latest else 0 + items = collect_candidates(n, hot, cold) + return {"draw_no": draw_no, "candidates": items} + + +@router.get("/context") +def context(): + latest = db.get_latest_draw() + draw_no = (latest["drw_no"] + 1) if latest else 0 + return {"draw_no": draw_no, **build_context()}