Skip to content

Commit bc377e6

Browse files
committed
[chore]: 调整5个url定义
1 parent 405645b commit bc377e6

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/api/v1/endpoints/articleDB.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ async def upload_article(
3939
except Exception as e:
4040
raise HTTPException(status_code=500, detail=str(e))
4141

42-
@router.get("", response_model=dict)
42+
@router.get("/get", response_model=dict)
4343
async def get_article(get_article: GetArticle = Depends(), db: AsyncSession = Depends(get_db)):
4444
"""
4545
Get an article from the database.

app/api/v1/endpoints/note.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
router = APIRouter()
99

10-
@router.post("", response_model=dict)
10+
@router.post("/create", response_model=dict)
1111
async def create_note(note: NoteCreate, db: AsyncSession = Depends(get_db)):
1212
new_note = await create_note_in_db(note, db)
1313
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
2929
raise HTTPException(status_code=404, detail="Note not found")
3030
return {"msg": "Note updated successfully", "note_id": updated_note.id}
3131

32-
@router.get("", response_model=dict)
32+
@router.get("/get", response_model=dict)
3333
async def get_notes(note_find: NoteFind = Depends(), db: AsyncSession = Depends(get_db)):
3434
notes, total_count = await find_notes_in_db(note_find, db)
3535
return {

app/api/v1/endpoints/user.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
router = APIRouter()
1212

1313
# update current user
14-
@router.put("", response_model=dict)
14+
@router.put("/update", response_model=dict)
1515
async def update_current_user(
1616
username: Optional[str] = Form(None),
1717
avatar: Optional[UploadFile] = File(None),
@@ -80,7 +80,7 @@ async def change_password(
8080
await update_user_password(db, db_user.id, pwd_context.hash(password_update.new_password))
8181
return {"msg": "Password changed successfully"}
8282

83-
@router.get("", response_model=dict)
83+
@router.get("/get", response_model=dict)
8484
async def get_user_id(
8585
db: AsyncSession = Depends(get_db),
8686
current_user: dict = Depends(get_current_user)

0 commit comments

Comments
 (0)