한국 멕시코 경기 댓글 기능 추가

This commit is contained in:
JinwooKim committed 2026-06-17 11:22:29 +09:00
1 parent 7625db36a0
commit 8a67094510
10 files changed
+611 -2

No files matched your search

+28
View File
@@ -122,6 +122,34 @@ class AdminSetResultIn(BaseModel):
scoreB: int = Field(ge=0, le=50)
# ── 댓글(경기별 한마디) ─────────────────────────────────────
class CommentIn(BaseModel):
deviceId: str = Field(min_length=8, max_length=64)
email: EmailStr # 투표 시 입력한 이메일 — 마스킹해 닉네임으로 노출
body: str = Field(min_length=1, max_length=200)
@field_validator("body")
@classmethod
def body_not_blank(cls, v: str) -> str:
v = v.strip()
if not v:
raise ValueError("EMPTY_BODY")
return v
class CommentOut(BaseModel):
id: int
nickname: str # 마스킹된 이메일 (ab***@gmail.com)
body: str
createdAt: str # ISO8601
mine: bool = False # 조회 요청 기기(device)가 작성한 댓글이면 True (삭제 버튼 노출용)
class CommentListOut(BaseModel):
items: list[CommentOut]
total: int # 숨김 제외 전체 개수 — "더보기" 남은 수 계산용
class GenericOk(BaseModel):
ok: bool
detail: str = ""