Merge remote-tracking branch 'origin/conding' into conding

This commit is contained in:
msj
2026-09-22 22:37:35 +08:00
3 changed files with 26 additions and 19 deletions
+5 -5
View File
@@ -7,15 +7,15 @@ from typing import Optional
emp_api = APIRouter(tags=['学生就业管理模块'])
@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)):
e2 = employment_dao.get_emp_dao(class_id=class_id, db=db)
if e2:
return e2
e1 = employment_dao.get_emp_dao(class_id=class_id, db=db)
if e1:
return e1
raise HTTPException(status_code=404, detail='该班级就业信息不存在')
@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='公司名称')
,min_salary: float|None = Query(None,ge=0,description='最低工资')
,max_salary: float|None = Query(None,ge=0,description='最高工资')
+7 -6
View File
@@ -19,6 +19,13 @@ def get_grade(stu_id: int,db=Depends(get_db)):
except Exception as e:
raise HTTPException(status_code=500,detail=f'数据库查询异常:{str(e)}')
@gradeAPI.delete('/{stu_id}',summary='删除成绩')
def delete_grade(stu_id:int,db=Depends(get_db)):
r = delete_grade_dao(stu_id=stu_id,db=db)
if not r:
raise HTTPException(status_code=404,detail='删除失败')
return {'code':200,'totals':r,'detail':'删除成功'}
@gradeAPI.post('/grade',summary='添加学生成绩')
def post_grade(o:GradeRequest,db=Depends(get_db)):
d=o.model_dump()
@@ -72,9 +79,3 @@ def put_grade(
return {"code": 200, "totals": rows, "detail": "更新成功"}
@gradeAPI.delete('/{score_id}',summary='删除成绩')
def delete_grade(score_id:int,db=Depends(get_db)):
r = delete_grade_dao(stu_id=score_id,db=db)
if not r:
raise HTTPException(status_code=404,detail='删除失败')
return {'code':200,'totals':r,'detail':'删除成功'}