Files
DoubaoTeam/schemas/score.py
T
2026-09-21 21:55:04 +08:00

36 lines
859 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
from pydantic import BaseModel, Field
from datetime import date, datetime
from typing import Optional, List
from decimal import Decimal
class ScoreCreate(BaseModel):
student_id: int
exam_seq: int
score: Decimal = Field(ge=0, le=100, description="分数0‑100")
exam_date: Optional[date] = None
remark: Optional[str] = None
class ScoreUpdate(BaseModel):
score: Optional[Decimal] = Field(None, ge=0, le=100)
exam_seq: Optional[int] = None
exam_date: Optional[date] = None
remark: Optional[str] = None
class ScoreItem(BaseModel):
id: int
student_id: int
score: Decimal
exam_seq: int
exam_date: Optional[date]
remark: Optional[str]
created_at: Optional[datetime]
updated_at: Optional[datetime]
is_deleted: int
class ScorePageResp(BaseModel):
total: int
data: List[ScoreItem]