From bc377e64059407fb7b428b1dbfde95ed1d8fe6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9F=A9=E6=98=95=E7=9D=BF?= <22371298@buaa.edu.cn> Date: Tue, 6 May 2025 00:36:25 +0800 Subject: [PATCH] =?UTF-8?q?[chore]:=20=E8=B0=83=E6=95=B45=E4=B8=AAurl?= =?UTF-8?q?=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/v1/endpoints/articleDB.py | 2 +- app/api/v1/endpoints/note.py | 4 ++-- app/api/v1/endpoints/user.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/api/v1/endpoints/articleDB.py b/app/api/v1/endpoints/articleDB.py index c502986..9b0e030 100644 --- a/app/api/v1/endpoints/articleDB.py +++ b/app/api/v1/endpoints/articleDB.py @@ -39,7 +39,7 @@ async def upload_article( except Exception as e: raise HTTPException(status_code=500, detail=str(e)) -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_article(get_article: GetArticle = Depends(), db: AsyncSession = Depends(get_db)): """ Get an article from the database. diff --git a/app/api/v1/endpoints/note.py b/app/api/v1/endpoints/note.py index 1f9f984..ff69912 100644 --- a/app/api/v1/endpoints/note.py +++ b/app/api/v1/endpoints/note.py @@ -7,7 +7,7 @@ router = APIRouter() -@router.post("", response_model=dict) +@router.post("/create", response_model=dict) async def create_note(note: NoteCreate, db: AsyncSession = Depends(get_db)): new_note = await create_note_in_db(note, db) return {"msg": "Note created successfully", "note_id": new_note.id} @@ -29,7 +29,7 @@ async def update_note(note_id: int, content: Optional[str] = None, title: Option raise HTTPException(status_code=404, detail="Note not found") return {"msg": "Note updated successfully", "note_id": updated_note.id} -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_notes(note_find: NoteFind = Depends(), db: AsyncSession = Depends(get_db)): notes, total_count = await find_notes_in_db(note_find, db) return { diff --git a/app/api/v1/endpoints/user.py b/app/api/v1/endpoints/user.py index 437f360..d9bca54 100644 --- a/app/api/v1/endpoints/user.py +++ b/app/api/v1/endpoints/user.py @@ -11,7 +11,7 @@ router = APIRouter() # update current user -@router.put("", response_model=dict) +@router.put("/update", response_model=dict) async def update_current_user( username: Optional[str] = Form(None), avatar: Optional[UploadFile] = File(None), @@ -80,7 +80,7 @@ async def change_password( await update_user_password(db, db_user.id, pwd_context.hash(password_update.new_password)) return {"msg": "Password changed successfully"} -@router.get("", response_model=dict) +@router.get("/get", response_model=dict) async def get_user_id( db: AsyncSession = Depends(get_db), current_user: dict = Depends(get_current_user)