13 lines
446 B
Python
13 lines
446 B
Python
|
|
"""Dashboard API"""
|
||
|
|
from fastapi import APIRouter, Depends
|
||
|
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||
|
|
from app.core.database import get_db
|
||
|
|
from app.services.dashboard_service import get_dashboard_stats, DashboardStats
|
||
|
|
|
||
|
|
router = APIRouter(prefix="/dashboard", tags=["管理看板"])
|
||
|
|
|
||
|
|
|
||
|
|
@router.get("/stats", response_model=DashboardStats)
|
||
|
|
async def dashboard_stats(db: AsyncSession = Depends(get_db)):
|
||
|
|
return await get_dashboard_stats(db)
|