Compare commits
9
Commits
4e99cfd3b1
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
79da6dc3a0 | ||
|
|
1af01f94ee | ||
|
|
fd1f9f71de | ||
|
|
4849e73771 | ||
|
|
da935f93bd | ||
|
|
92b98226d8 | ||
|
|
e13ace8616 | ||
|
|
46faa300a8 | ||
|
|
26429d6b6f |
@@ -7,15 +7,15 @@ from typing import Optional
|
|||||||
emp_api = APIRouter(tags=['学生就业管理模块'])
|
emp_api = APIRouter(tags=['学生就业管理模块'])
|
||||||
|
|
||||||
@emp_api.get('/employment/class/{class_id}',response_model=list[EmploymentResponse],summary='获取班级学生就业信息')
|
@emp_api.get('/employment/class/{class_id}',response_model=list[EmploymentResponse],summary='获取班级学生就业信息')
|
||||||
def get_emp_info2(class_id: Optional[int]=Path(description='班级编号')
|
def get_emp_info1(class_id: Optional[int]=Path(description='班级编号')
|
||||||
,db=Depends(get_db)):
|
,db=Depends(get_db)):
|
||||||
e2 = employment_dao.get_emp_dao(class_id=class_id, db=db)
|
e1 = employment_dao.get_emp_dao(class_id=class_id, db=db)
|
||||||
if e2:
|
if e1:
|
||||||
return e2
|
return e1
|
||||||
raise HTTPException(status_code=404, detail='该班级就业信息不存在')
|
raise HTTPException(status_code=404, detail='该班级就业信息不存在')
|
||||||
|
|
||||||
@emp_api.get('/employment/students/{stu_id}',response_model=list[EmploymentResponse],summary='按照学⽣编号,公司名字,⼯资范围查询学⽣就业信息')
|
@emp_api.get('/employment/students/{stu_id}',response_model=list[EmploymentResponse],summary='按照学⽣编号,公司名字,⼯资范围查询学⽣就业信息')
|
||||||
def get_emp_info3(stu_id:int = Path(description='学生编号')
|
def get_emp_info2(stu_id:int = Path(description='学生编号')
|
||||||
,company_name: str|None = Query(None,description='公司名称')
|
,company_name: str|None = Query(None,description='公司名称')
|
||||||
,min_salary: float|None = Query(None,ge=0,description='最低工资')
|
,min_salary: float|None = Query(None,ge=0,description='最低工资')
|
||||||
,max_salary: float|None = Query(None,ge=0,description='最高工资')
|
,max_salary: float|None = Query(None,ge=0,description='最高工资')
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ def update_students(stu_id:int
|
|||||||
raise HTTPException(status_code=404, detail='学生不存在或已被删除,更新失败')
|
raise HTTPException(status_code=404, detail='学生不存在或已被删除,更新失败')
|
||||||
return {'code':200,'totals':r,'detail':'更新成功'}
|
return {'code':200,'totals':r,'detail':'更新成功'}
|
||||||
|
|
||||||
@StudentAPI.delete('/students/{stu_id}',response_model= StugetResponse,summary='学生信息删除接口',description='删除学生信息')
|
@StudentAPI.delete('/students/{stu_id}',response_model= StudelResponse,summary='学生信息删除接口',description='删除学生信息')
|
||||||
def del_students(stu_id:int
|
def del_students(stu_id:int
|
||||||
,db=Depends(get_db)):
|
,db=Depends(get_db)):
|
||||||
rows=delete_student_dao( stu_id=stu_id,db=db )
|
rows=delete_student_dao( stu_id=stu_id,db=db )
|
||||||
|
|||||||
@@ -99,4 +99,10 @@ class StuPageResponse(BaseModel):
|
|||||||
totals: int
|
totals: int
|
||||||
data: List[StugetResponse]
|
data: List[StugetResponse]
|
||||||
|
|
||||||
|
class StudelResponse(BaseModel):
|
||||||
|
code: int = 200
|
||||||
|
detail: str = "ok"
|
||||||
|
totals: int
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user