2026-09-21 22:34:34 +08:00
|
|
|
|
2026-09-21 16:28:55 +08:00
|
|
|
from model.all_model import *
|
2026-09-21 16:53:39 +08:00
|
|
|
from pydantic import BaseModel, Field, field_validator
|
2026-09-21 22:34:34 +08:00
|
|
|
from fastapi import HTTPException,Form
|
2026-09-21 16:53:39 +08:00
|
|
|
|
2026-09-21 12:24:56 +08:00
|
|
|
|
|
|
|
|
class GradeRequest(BaseModel):
|
2026-09-21 22:34:34 +08:00
|
|
|
stu_id:int = Form(description="学生编号")
|
|
|
|
|
exam_order:int = Form(description='考核序次')
|
|
|
|
|
score:float = Form(description='成绩')
|
2026-09-21 12:24:56 +08:00
|
|
|
|
2026-09-21 16:28:55 +08:00
|
|
|
class GradeResponse(BaseModel):
|
|
|
|
|
code: int = 200
|
|
|
|
|
detail: str = 'OK'
|
2026-09-21 21:40:48 +08:00
|
|
|
stu_id:int
|
2026-09-21 16:28:55 +08:00
|
|
|
exam_order:int
|
2026-09-21 21:40:48 +08:00
|
|
|
score:float
|
|
|
|
|
|
2026-09-21 22:34:34 +08:00
|
|
|
class GradeUpdate(BaseModel):
|
|
|
|
|
exam_order: int | None = Form( description="考核序次")
|
|
|
|
|
score: float | None = Form( description="成绩")
|