Merge remote-tracking branch 'origin/conding' into conding
This commit is contained in:
@@ -5,27 +5,27 @@ from dao.cla_dao import add_class_dao,get_class_dao,update_class_dao,delete_clas
|
||||
|
||||
claAPI = APIRouter(prefix="/class", tags=["班级管理"])
|
||||
|
||||
@claAPI.post("/class", summary="新增班级")
|
||||
@claAPI.post("/", summary="新增班级")
|
||||
def add_class(data: claRequest, Session = Depends(get_db)):
|
||||
return add_class_dao(data, Session)
|
||||
|
||||
@claAPI.get("/class/list", summary="查询班级")
|
||||
@claAPI.get("/list", summary="查询班级")
|
||||
def list_class(Session = Depends(get_db)):
|
||||
return get_class_dao(Session)
|
||||
|
||||
@claAPI.put("/class/{class_id}", summary="更新班级信息")
|
||||
@claAPI.put("/{class_id}", summary="更新班级信息")
|
||||
def update_class(class_id: int, data: claRequest, Session = Depends(get_db)):
|
||||
return update_class_dao(class_id, data, Session)
|
||||
|
||||
@claAPI.get("/class/{class_id}", summary="逻辑删除班级信息")
|
||||
@claAPI.delete("/{class_id}", summary="逻辑删除班级信息")
|
||||
def delete_class(class_id: int, Session = Depends(get_db)):
|
||||
return delete_class_dao(class_id, Session)
|
||||
|
||||
@claAPI.get("/class/delete/check/{class_id}", summary="硬删除前查询")
|
||||
@claAPI.get("/delete/check/{class_id}", summary="硬删除前查询")
|
||||
def check_delete(class_id: int, Session = Depends(get_db)):
|
||||
return get_class_for_delete(class_id, Session)
|
||||
|
||||
@claAPI.delete("/class/delete/confirm/{class_id}", summary="删除班级信息")
|
||||
@claAPI.delete("/delete/confirm/{class_id}", summary="删除班级信息")
|
||||
def confirm_delete(class_id: int, Session = Depends(get_db)):
|
||||
return hard_delete_class(class_id, Session)
|
||||
|
||||
|
||||
@@ -2,28 +2,24 @@ from fastapi import APIRouter,Depends,HTTPException
|
||||
|
||||
from dao import employment_dao
|
||||
from dao.employment_dao import get_employment_dao
|
||||
from schema.employment_schema import EmploymentRequest,EmploymentResponse
|
||||
from schema.employment_schema import EmploymentResponse
|
||||
from model.all_model import ClassManagement,Employment_info
|
||||
from util.database import get_db
|
||||
|
||||
emp_api = APIRouter()
|
||||
@emp_api.get('employment/students/{stu_id}',response_model=EmploymentResponse,summary='获取学生就业信息')
|
||||
emp_api = APIRouter(tags=['学生就业管理系统'])
|
||||
@emp_api.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='该学生就业信息不存在')
|
||||
if stu_id:
|
||||
return employment_dao.get_employment_dao(stu_id=stu_id,db=db)
|
||||
raise HTTPException(status_code=404, detail='该学生就业信息不存在')
|
||||
|
||||
@emp_api.get('employment/class/{class_id}',summary='获取班级学生就业信息')
|
||||
@emp_api.get('/employment/class/{class_id}',response_model=EmploymentResponse,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='该班级就业信息不存在')
|
||||
if class_id:
|
||||
return employment_dao.get_employment_dao(class_id=class_id,db=db)
|
||||
raise HTTPException(status_code=404, detail='该班级就业信息不存在')
|
||||
|
||||
# @emp_api.post('employment/students/{stu_id}')
|
||||
# def create_emp_info(stu_id: int,db=Depends(get_db)):
|
||||
# try:
|
||||
# pass
|
||||
# @emp_api.post('/employment/students/{stu_id}')
|
||||
# def create_emp_info(stu_id: int,db=Depends(get_db),response_model=EmploymentResponse):
|
||||
# if stu_id:
|
||||
#
|
||||
# return employment_dao.
|
||||
|
||||
Reference in New Issue
Block a user