[rewrite] Added initial route structure (WIP)

This commit is contained in:
Thastertyn committed 2024-12-02 21:15:25 +01:00
1 parent bb789a75e7
commit 3d00ae0aad
7 files changed
+105 -22

No files matched your search

View File
Whitespace-only changes.
+38
View File
@@ -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
View File
Whitespace-only changes.
+31
View File
@@ -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.")