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