30 lines
997 B
Python
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()
|