16 lines
599 B
Python
16 lines
599 B
Python
# 请求体
|
|||
|
|
from pydantic import BaseModel, Field
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
class ScoreCreate(BaseModel):
|
||
|
|
stu_id: int=Field(...,ge=1,description='学生id必须大于等于1')
|
||
|
|
exam_id: int=Field(...,ge=1,description='考核序次必须大于等于1')
|
||
|
|
score: int=Field(...,ge=0,le=100,description='成绩必须在0-100之间')
|
||
|
|
|
||
|
|
|
||
|
|
class ScoreUpdate(BaseModel):
|
||
|
|
# stu_id: int = Field(None, ge=1, description='学生id必须大于等于1')
|
||
|
|
# exam_id: int = Field(None, ge=1, description='考核序次必须大于等于1')
|
||
|
|
score: int = Field(None, ge=0, le=100, description='成绩必须在0-100之间')
|