feat: Add dashboard API endpoints and service for sound statistics
This commit is contained in:
29
app/api/v1/dashboard.py
Normal file
29
app/api/v1/dashboard.py
Normal file
@@ -0,0 +1,29 @@
|
||||
"""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()
|
||||
Reference in New Issue
Block a user