Files
SST/PythonProject/api/employment_api.py
T
2026-09-21 17:47:50 +08:00

31 lines
1.1 KiB
Python

from fastapi import FastAPI,APIRouter,Depends,HTTPException
from dao import employment_dao
from dao.employment_dao import get_employment_dao
from schema.employment_schema import EmlpoymentRequest,EmploymentResponse
from model.all_model import ClassManagement,Employment_info
from util.database import get_db
app = FastAPI()
@app.get('employment/students/{stu_id}',response_model=EmploymentResponse,summary='获取学生就业信息')
def get_emp_info1(stu_id: int,db=Depends(get_db)):
try:
if stu_id:
return employment_dao.get_employment_info()
except:
raise HTTPException(status_code=404, detail='就业信息不存在')
@app.get('employment/class/{class_id}',summary='获取班级学生就业信息')
def get_emp_info2(class_id: int,db=Depends(get_db)):
try:
if class_id:
return employment_dao.get_employment_info()
except:
raise HTTPException(status_code=404, detail='就业信息不存在')
@app.post('employment/students/{stu_id}')
def create_emp_info(stu_id: int,db=Depends(get_db)):
pass