Files
sdb2-backend/app/api/v1/dashboard.py
JSC 49ad6c8581
Some checks failed
Backend CI / lint (push) Failing after 4m52s
Backend CI / test (push) Failing after 3m42s
feat: Add dashboard API endpoints and service for sound statistics
2025-08-11 11:16:45 +02:00

30 lines
997 B
Python

"""Dashboard API endpoints."""
from typing import Annotated, Any
from fastapi import APIRouter, Depends
from app.core.dependencies import get_current_user, get_dashboard_service
from app.models.user import User
from app.services.dashboard import DashboardService
router = APIRouter(prefix="/dashboard", tags=["dashboard"])
@router.get("/soundboard-statistics")
async def get_soundboard_statistics(
_current_user: Annotated[User, Depends(get_current_user)],
dashboard_service: Annotated[DashboardService, Depends(get_dashboard_service)],
) -> dict[str, Any]:
"""Get soundboard statistics."""
return await dashboard_service.get_soundboard_statistics()
@router.get("/track-statistics")
async def get_track_statistics(
_current_user: Annotated[User, Depends(get_current_user)],
dashboard_service: Annotated[DashboardService, Depends(get_dashboard_service)],
) -> dict[str, Any]:
"""Get track statistics."""
return await dashboard_service.get_track_statistics()