Files
goodsAndServicesMicroservice/app/api/v1/B2C/products.py
2025-11-29 23:55:17 +03:00

62 lines
1.6 KiB
Python

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