15 lines
418 B
Python
15 lines
418 B
Python
from fastapi import APIRouter, Depends
|
|
|
|
from app.api.dependencies.factory import Factory
|
|
from app.schemas.count_schema import CountSchema
|
|
from app.services.count_service import CountService
|
|
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("/count", response_model=CountSchema)
|
|
async def get_counts(service: CountService = Depends(Factory().get_count_service)):
|
|
data = await service.get_counts()
|
|
return CountSchema(**data)
|