feat: Add dashboard API endpoints and service for sound statistics
This commit is contained in:
@@ -9,7 +9,9 @@ from app.core.database import get_db
|
||||
from app.core.logging import get_logger
|
||||
from app.models.user import User
|
||||
from app.services.auth import AuthService
|
||||
from app.services.dashboard import DashboardService
|
||||
from app.services.oauth import OAuthService
|
||||
from app.repositories.sound import SoundRepository
|
||||
from app.utils.auth import JWTUtils, TokenUtils
|
||||
|
||||
logger = get_logger(__name__)
|
||||
@@ -184,3 +186,11 @@ async def get_admin_user(
|
||||
detail="Not enough permissions",
|
||||
)
|
||||
return current_user
|
||||
|
||||
|
||||
async def get_dashboard_service(
|
||||
session: Annotated[AsyncSession, Depends(get_db)],
|
||||
) -> DashboardService:
|
||||
"""Get the dashboard service."""
|
||||
sound_repository = SoundRepository(session)
|
||||
return DashboardService(sound_repository)
|
||||
|
||||
Reference in New Issue
Block a user