13 lines
373 B
Python
13 lines
373 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
from .. import crud, schemas
|
|
from ..database import get_db
|
|
|
|
router = APIRouter(prefix="/stats", tags=["stats"])
|
|
|
|
@router.get("/", response_model=schemas.SuccessResponse)
|
|
def get_stats(db: Session = Depends(get_db)):
|
|
stats = crud.get_stats(db)
|
|
|
|
return schemas.SuccessResponse(data=stats)
|