[rewrite] Added initial route structure (WIP)
This commit is contained in:
1 parent
bb789a75e7
commit
3d00ae0aad
7 files changed
+105
-22
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,38 @@
|
||||
from fastapi import APIRouter, Query
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/cart",
|
||||
tags=["Cart"]
|
||||
)
|
||||
|
||||
|
||||
@router.get("/")
|
||||
async def show_cart():
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@router.put("/add/{product_id}")
|
||||
async def add_to_cart(
|
||||
product_id: int,
|
||||
count: int = Query(
|
||||
1, ge=1, description="Count must be greater than or equal to 1")
|
||||
):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@router.delete("/remove/{product_id}")
|
||||
async def remove_from_cart(product_id: int):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@router.put("/update/{product_id}")
|
||||
async def update_count_in_cart(
|
||||
product_id: int,
|
||||
count: int = Query(..., description="Count must be provided")
|
||||
):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
@router.get("/purchase")
|
||||
async def purchase():
|
||||
raise NotImplementedError
|
||||
Whitespace-only changes.
@@ -0,0 +1,31 @@
|
||||
from fastapi import APIRouter, Body
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/user",
|
||||
tags=["User"]
|
||||
)
|
||||
|
||||
|
||||
@router.delete("/delete", summary="Delete user")
|
||||
async def delete_user():
|
||||
raise NotImplementedError("delete_user() needs to be implemented.")
|
||||
|
||||
|
||||
@router.post("/login", summary="User login")
|
||||
async def login(data: dict = Body(...)):
|
||||
raise NotImplementedError("login() needs to be implemented.")
|
||||
|
||||
|
||||
@router.delete("/logout", summary="User logout")
|
||||
async def logout():
|
||||
raise NotImplementedError("logout() needs to be implemented.")
|
||||
|
||||
|
||||
@router.post("/register", summary="Register new user")
|
||||
async def register(data: dict = Body(...)):
|
||||
raise NotImplementedError("register() needs to be implemented.")
|
||||
|
||||
|
||||
@router.put("/update", summary="Update user details")
|
||||
async def update_user(data: dict = Body(...)):
|
||||
raise NotImplementedError("update_user() needs to be implemented.")
|
||||
Reference in new issue
Block a user