24 lines
1.0 KiB
Python
24 lines
1.0 KiB
Python
from pydantic import BaseModel, Field
|
|
|
|
class AddScore(BaseModel):
|
|
id: str = Field(...,min_length=1,max_length=10,description="学生ID")
|
|
exam_round: int = Field(...,ge=1,le=10,description="考核序次1~10")
|
|
score: int = Field(...,ge=0,le=100,description="分数0~100")
|
|
|
|
class QueryID(BaseModel):
|
|
id: str = Field(..., min_length=1, max_length=10, description="学生ID")
|
|
|
|
class QueryExamRound(BaseModel):
|
|
exam_round: int = Field(..., ge=1, le=10, description="考核序次1~10")
|
|
|
|
class QueryScore(BaseModel):
|
|
score: int = Field(..., ge=0, le=100, description="分数0~100")
|
|
|
|
class UpdateScore(BaseModel):
|
|
id: str = Field(...,min_length=1,max_length=10,description="学生ID")
|
|
exam_round: int = Field(...,ge=1,le=10,description="考核序次1~10")
|
|
score: int = Field(...,ge=0,le=100,description="分数0~100")
|
|
|
|
class DeleteScore(BaseModel):
|
|
id: str = Field(..., min_length=1, max_length=10, description="学生ID")
|
|
exam_round: int = Field(..., ge=1, le=10, description="考核序次1~10") |