From 70523587c2207b05ebb66676cd9bfa79b90053c5 Mon Sep 17 00:00:00 2001 From: sunfree <17315650350@163.com> Date: Sun, 30 Jun 2024 22:47:17 +0800 Subject: [PATCH] add new --- routers/classticmanage.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/routers/classticmanage.py b/routers/classticmanage.py index 9171cb7..d0091fa 100644 --- a/routers/classticmanage.py +++ b/routers/classticmanage.py @@ -44,7 +44,7 @@ async def classtic_put(classtic:Classtic,id: str = Path(description="语录id")) execute_query(update_query, update_data) return response_success("classtic update sucess") -# 语录修改 +# 语录删除 @router.delete("/delete/{id}") async def classtic_del(id: str = Path(description="语录id")): update_query = ( @@ -54,4 +54,9 @@ async def classtic_del(id: str = Path(description="语录id")): execute_query(update_query, update_data) return response_success() -# 根据id查询 \ No newline at end of file +# 根据id查询语录 +@router.get("/list/search/{id}") +async def classtic_search_id(id:str=Path(description="语录id")): + select_query="SELECT * FROM classtics WHERE id=%s" + classtic_query=fetch_one(select_query,(id,)) + return response_success(data=classtic_query,message="classtic search success") \ No newline at end of file