feat:添加前端页面
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from pydantic import BaseModel
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
from datetime import date
|
||||
from typing import Optional, List
|
||||
|
||||
@@ -22,7 +22,7 @@ class StudentResp(StudentCreate):
|
||||
|
||||
# ----------------成绩----------------
|
||||
class ScoreCreate(BaseModel):
|
||||
stu_id: int
|
||||
stu_no: str
|
||||
exam_order: int
|
||||
score: float
|
||||
|
||||
@@ -30,6 +30,15 @@ class ScoreResp(ScoreCreate):
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
# 对外出参:成绩表现在直接用学号做主键,stu_no 就是表里的真实字段,
|
||||
# 查到 ORM 对象直接读出来即可,不需要额外挂展示字段。
|
||||
class ScoreOut(BaseModel):
|
||||
stu_no: str
|
||||
exam_order: int
|
||||
score: float
|
||||
|
||||
model_config = ConfigDict(from_attributes=True)
|
||||
|
||||
# ----------------班级----------------
|
||||
class ClassCreate(BaseModel):
|
||||
start_time: Optional[date] = None
|
||||
|
||||
@@ -65,6 +65,9 @@ class EmpTopOut(BaseModel):
|
||||
class_id:Optional[int]=None
|
||||
offer_time:Optional[datetime]=None
|
||||
company_name:Optional[str]=None
|
||||
# 接口是按薪资排序取前 N 名的,薪资也得一起给出来,
|
||||
# 否则前端只能看到"谁排前面"却看不出差了多少钱
|
||||
salary:Optional[int]=None
|
||||
|
||||
class ClassAvgEmpTimeOut(BaseModel):
|
||||
"""每个班级的平均就业时长"""
|
||||
|
||||
Reference in New Issue
Block a user