Merge pull request 'api,models consultant.py已更新完毕' (#30) from bx into main
Reviewed-on: #30
This commit was merged in pull request #30.
This commit is contained in:
+5
-7
@@ -9,8 +9,7 @@ router = APIRouter()
|
||||
|
||||
@router.get(
|
||||
path="/consultants",
|
||||
tags=['顾问管理模块']
|
||||
)
|
||||
tags=['顾问管理模块'],summary='顾问模糊分页查询')
|
||||
def read_consultants(
|
||||
db: Session = Depends(get_db),
|
||||
page:int=1,
|
||||
@@ -22,7 +21,7 @@ def read_consultants(
|
||||
|
||||
|
||||
|
||||
@router.post("/consultants", response_model=ConsultantResponse,tags=['顾问管理模块'])
|
||||
@router.post("/consultants", response_model=ConsultantResponse,tags=['顾问管理模块'],summary='顾问增加')
|
||||
def create_consultant(
|
||||
obj_in: ConsultantCreate,
|
||||
db: Session = Depends(get_db)
|
||||
@@ -30,7 +29,7 @@ def create_consultant(
|
||||
return dao_consultant.create_consultant(db, obj_in)
|
||||
|
||||
|
||||
@router.get("/consultants/{id}", response_model=ConsultantResponse,tags=['顾问管理模块'])
|
||||
@router.get("/consultants/{id}", response_model=ConsultantResponse,tags=['顾问管理模块'],summary='顾问查询')
|
||||
def read_consultant(id: int, db: Session = Depends(get_db)):
|
||||
res = dao_consultant.get_consultant_by_id(db, cid=id)
|
||||
if res is None:
|
||||
@@ -41,8 +40,7 @@ def read_consultant(id: int, db: Session = Depends(get_db)):
|
||||
@router.put(
|
||||
path="/consultants/{id}",
|
||||
response_model=ConsultantResponse,
|
||||
tags=['顾问管理模块']
|
||||
)
|
||||
tags=['顾问管理模块'],summary='顾问更新')
|
||||
def update_consultant(
|
||||
id: int,
|
||||
obj_in: ConsultantUpdate,
|
||||
@@ -57,7 +55,7 @@ def update_consultant(
|
||||
|
||||
|
||||
|
||||
@router.delete("/consultants/{id}", response_model=ConsultantResponse,tags=['顾问管理模块'])
|
||||
@router.delete("/consultants/{id}", response_model=ConsultantResponse,tags=['顾问管理模块'],summary='顾问删除')
|
||||
def delete_consultant(id: int, db: Session = Depends(get_db)):
|
||||
res = dao_consultant.delete_consultant(db, cid=id)
|
||||
if res is None:
|
||||
|
||||
Reference in New Issue
Block a user