File size: 543 Bytes
2756f0f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""D6: GET /v1/catalog/metrics?mode=h|p."""

from typing import Annotated, Literal

from fastapi import APIRouter, Query

from app.core.dependencies import CurrentAccount
from app.modules.catalog.schemas import CatalogOut
from app.modules.catalog.service import CatalogService

router = APIRouter(prefix="/v1", tags=["catalog"])


@router.get("/catalog/metrics", response_model=CatalogOut)
async def catalog_metrics(_: CurrentAccount, mode: Annotated[Literal["h", "p"], Query()] = "h") -> CatalogOut:
    return CatalogService().metrics(mode)