修改put和delete的路径参数为stu_id
This commit is contained in:
@@ -6,6 +6,14 @@ from util.database import get_db
|
||||
from typing import Optional
|
||||
emp_api = APIRouter(tags=['学生就业管理模块'])
|
||||
|
||||
@emp_api.get('/employment/student/{stu_id}',response_model=list[EmploymentResponse],summary='获取学生就业信息')
|
||||
def get_emp_info1(stu_id: Optional[int]=Path(description='学生编号')
|
||||
,db=Depends(get_db)):
|
||||
e = employment_dao.get_emp_dao(stu_id=stu_id, db=db)
|
||||
if e:
|
||||
return e
|
||||
raise HTTPException(status_code=404, detail='该学生就业信息不存在')
|
||||
|
||||
@emp_api.get('/employment/class/{class_id}',response_model=list[EmploymentResponse],summary='获取班级学生就业信息')
|
||||
def get_emp_info1(class_id: Optional[int]=Path(description='班级编号')
|
||||
,db=Depends(get_db)):
|
||||
@@ -14,8 +22,8 @@ def get_emp_info1(class_id: Optional[int]=Path(description='班级编号')
|
||||
return e1
|
||||
raise HTTPException(status_code=404, detail='该班级就业信息不存在')
|
||||
|
||||
@emp_api.get('/employment/students/{stu_id}',response_model=list[EmploymentResponse],summary='按照学⽣编号,公司名字,⼯资范围查询学⽣就业信息')
|
||||
def get_emp_info2(stu_id:int = Path(description='学生编号')
|
||||
@emp_api.get('/employment/students',response_model=list[EmploymentResponse],summary='按照学⽣编号,公司名字,⼯资范围查询学⽣就业信息')
|
||||
def get_emp_info2(stu_id:int|None = Query(None,description='学生编号')
|
||||
,company_name: str|None = Query(None,description='公司名称')
|
||||
,min_salary: float|None = Query(None,ge=0,description='最低工资')
|
||||
,max_salary: float|None = Query(None,ge=0,description='最高工资')
|
||||
|
||||
@@ -3,7 +3,7 @@ from datetime import date
|
||||
from typing import Optional
|
||||
|
||||
class EmploymentRequest(BaseModel):
|
||||
stu_id: int=Field(ge=1,description='学生编号')
|
||||
stu_id: int=Field(ge=1, description='学生编号')
|
||||
email: Optional[str] = Field(None, description='邮箱')
|
||||
employment_opening_date:Optional[date] = Field(None, description='就业开放日期')
|
||||
offer_issuance_date:Optional[date] = Field(None, description='offer下发日期')
|
||||
|
||||
Reference in New Issue
Block a user