feat(lotto): review 라우터 — latest/history/by-draw

This commit is contained in:
2026-05-11 08:39:01 +09:00
parent 2a2209a86c
commit 4f85496fe5
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
"""주간 회고(weekly_review) 조회 엔드포인트."""
from fastapi import APIRouter, HTTPException
from .. import db
router = APIRouter(prefix="/api/lotto/review")
@router.get("/latest")
def latest():
r = db.get_latest_review()
if not r:
raise HTTPException(404, "no review yet")
return r
@router.get("/history")
def history(limit: int = 10):
return {"reviews": db.list_reviews(limit)}
@router.get("/{draw_no}")
def get_one(draw_no: int):
r = db.get_review(draw_no)
if not r:
raise HTTPException(404, f"no review for draw {draw_no}")
return r