feat: 后端 CRUD 完成(episodes + yearly_targets + users 管理 API)

This commit is contained in:
simonkoson
2026-05-15 12:17:46 +08:00
parent fab15505bd
commit 3dc1a1cf3c
10 changed files with 497 additions and 4 deletions
+31
View File
@@ -0,0 +1,31 @@
"""
年度收视目标 Schema — 请求 / 响应模型
业务规则:yearly_targets 只增不改,ON CONFLICT DO NOTHING
"""
from datetime import date
from pydantic import BaseModel, ConfigDict
class YearlyTargetBase(BaseModel):
year: int
base_target: float
stretch_target: float
issued_date: date | None = None
notes: str | None = None
class YearlyTargetCreate(YearlyTargetBase):
pass
class YearlyTargetUpdate(YearlyTargetBase):
pass
class YearlyTargetResponse(YearlyTargetBase):
id: int
model_config = ConfigDict(from_attributes=True)