feat: 后端 CRUD 完成(episodes + yearly_targets + users 管理 API)
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user