第四版_完整
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
# scheme/employ.py
|
||||
# 本文件定义 学生就业信息 接口层所用到的 请求体、响应体
|
||||
# author:王博
|
||||
from datetime import date
|
||||
from decimal import Decimal
|
||||
from typing import List
|
||||
|
||||
from pydantic import Field, model_validator, BaseModel
|
||||
|
||||
# ---------- -------------------------------请求模型 ------------------------------------------------
|
||||
|
||||
@@ -5,15 +5,10 @@ from typing import Optional, List
|
||||
|
||||
|
||||
# ---------- 请求模型 ----------
|
||||
class StatsScoreRequest(BaseModel):
|
||||
choose: int = Field(..., ge=0, le=3)
|
||||
|
||||
email: EmailStr
|
||||
full_name: Optional[str] = Field(None, max_length=100)
|
||||
|
||||
# ---------- 响应模型 ----------
|
||||
# 多维度班级统计
|
||||
class StatsResponse(BaseModel):
|
||||
class ClassGenderDistributionItem(BaseModel):
|
||||
cls_id: str
|
||||
total_cnt: int
|
||||
man_cnt: int
|
||||
|
||||
@@ -9,7 +9,7 @@ class StudentCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=20, description="姓名")
|
||||
gender: str = Field(..., min_length=1, max_length=1, description="性别")
|
||||
age: int = Field(..., ge=1, le=100, description="年龄")
|
||||
hometown: Optional[str] = Field(None, min_length=3, max_length=50, description="籍贯")
|
||||
hometown: Optional[str] = Field(None, min_length=1, max_length=50, description="籍贯")
|
||||
grad_school: str = Field(..., min_length=1, max_length=50, description="毕业院校")
|
||||
major: str = Field(..., min_length=1, max_length=50, description="专业名称")
|
||||
education: str = Field(..., min_length=1, max_length=20, description="学历")
|
||||
|
||||
Reference in New Issue
Block a user