Старт
This commit is contained in:
12
backend/app/routes/stats.py
Normal file
12
backend/app/routes/stats.py
Normal file
@@ -0,0 +1,12 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user