This commit is contained in:
2025-11-29 23:54:29 +03:00
parent f1220ce7e0
commit 316e8aea69
16 changed files with 117 additions and 295 deletions

View File

36
app/api/v1/B2B/admin.py Normal file
View File

@@ -0,0 +1,36 @@
from fastapi import APIRouter, Query, Header
router = APIRouter(
prefix="/b2b",
tags=["b2b"]
)
@router.post("/products/{id}")
def create_product(
id: int,
token: str = Header(..., description="Authorization token", alias="Authorization"),
) -> dict:
pass
@router.put("/products/{id}")
def update_product(
id: int,
token: str = Header(..., description="Authorization token", alias="Authorization"),
) -> dict:
pass
@router.delete("/products/{id}")
def delete_product(
id: int,
token: str = Header(..., description="Authorization token", alias="Authorization"),
) -> dict:
pass
@router.post("/products/{id}/related")
def create_related(
id: int,
token: str = Header(..., description="Authorization token", alias="Authorization"),
) -> dict:
pass

View File

View File

@@ -0,0 +1,61 @@
from fastapi import APIRouter, Query, Header
router = APIRouter(
prefix="/b2c",
tags=["b2c"]
)
@router.get("/products")
def get_products(
page: str = Query(..., description="page", alias="Page"),
limit: str = Query(..., description="limit of the items", alias="Limit"),
) -> list[dict]:
# cache goes here
pass
@router.get("/products/{id}")
def get_product_by_id(
id: int,
page: str = Query(..., description="page", alias="Page"),
limit: str = Query(..., description="limit of the items", alias="Limit"),
) -> list[dict]:
# cache goes here
pass
@router.get("/products/search")
def search(
search_query: str = Query(..., description="Search query"),
filters: str = Query(..., description="Filters"),
categories: str = Query(..., description="Categories")
) -> list[dict]:
# cache goes here
pass
@router.get("/products/{id}/related")
def get_related(
id: int,
page: str = Query(..., description="page", alias="Page"),
limit: str = Query(..., description="limit of the items", alias="Limit"),
) -> list[dict]:
# cache goes here
pass
@router.get("/products/featured")
def get_promo(
page: str = Query(..., description="page", alias="Page"),
limit: str = Query(..., description="limit of the items", alias="Limit"),
) -> list[dict]:
# cache goes here
pass
@router.get("/discounted")
def get_discount(
page: str = Query(..., description="page", alias="Page"),
limit: str = Query(..., description="limit of the items", alias="Limit"),
) -> list[dict]:
# cache goes here
pass

0
app/api/v1/__init__.py Normal file
View File