mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
testing pipe
This commit is contained in:
@@ -2,7 +2,8 @@
|
||||
from fastapi import APIRouter, Depends
|
||||
from sqlalchemy.orm import Session
|
||||
from ..database import get_db
|
||||
from ..crud import statistics
|
||||
from ..crud import requests
|
||||
from ..models.employee import Employee
|
||||
from ..utils.auth import get_current_admin
|
||||
|
||||
router = APIRouter()
|
||||
@@ -10,7 +11,11 @@ router = APIRouter()
|
||||
@router.get("/")
|
||||
def get_statistics(
|
||||
db: Session = Depends(get_db),
|
||||
_: dict = Depends(get_current_admin)
|
||||
current_admin: Employee = Depends(get_current_admin)
|
||||
):
|
||||
"""Get system statistics"""
|
||||
return statistics.get_request_statistics(db)
|
||||
"""Get request statistics (admin only)"""
|
||||
stats = requests.get_statistics(db)
|
||||
return {
|
||||
"total": stats["total"],
|
||||
"by_status": stats["by_status"]
|
||||
}
|
Reference in New Issue
Block a user