29 lines
1.1 KiB
Python
29 lines
1.1 KiB
Python
from datetime import date
|
|
|
|
from pydantic import BaseModel, Field, ConfigDict
|
|
from fastapi import FastAPI
|
|
|
|
#请求体模型
|
|
|
|
#student_info
|
|
#动态年龄范围查询:支持用户输入年龄阈值及比较条件(如大于、小于、等于、区间等),动态查询符合条件的学员信息
|
|
class AnalysisStudentInfoAge(BaseModel):
|
|
min_age: int = Field(ge=1, description="查询的最小年龄,若不填则仅查询上限")
|
|
max_age: int = Field(le=100, description="查询的最大年龄,若不填则仅查询下限")
|
|
operator: str = Field("区间", descroption="大于,大于等于,小于,小于等于,区间")
|
|
|
|
class AnalysisStudent_score(BaseModel):
|
|
s_n : int = Field(...,ge=1,le=100,description = "输入分数")
|
|
|
|
class AnalysisStudent_score60(BaseModel):
|
|
n : int = Field(...,ge=0,descriptino = "输入不及格次数")
|
|
|
|
class AnalysisStudent_score_class(BaseModel):
|
|
order : str = Field("desc", description="排序:输入asc则升序 / 输入desc则降序")
|
|
|
|
class AnalysisStudent_employments_salary(BaseModel):
|
|
n : int = Field(10,ge = 1,description = "查询就业薪资排名前n的学生信息")
|
|
|
|
|
|
|