You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
612 B
23 lines
612 B
1 year ago
|
from fastapi import APIRouter, Depends
|
||
|
from sqlalchemy.ext.asyncio import AsyncSession
|
||
|
|
||
|
from api.request.analytics import AnalyticsFilters
|
||
|
from managers.analytics import AnalyticsManager
|
||
|
from server.depends import get_session, PagesPaginationParams
|
||
|
|
||
|
router = APIRouter(prefix="/analytics", tags=['Ride'])
|
||
|
|
||
|
|
||
|
@router.post('/all')
|
||
|
async def get_all_analytics(
|
||
|
filters: AnalyticsFilters,
|
||
|
session: AsyncSession = Depends(get_session),
|
||
|
):
|
||
|
data = await AnalyticsManager.get_by_filters(
|
||
|
session=session,
|
||
|
start_date=filters.start_time,
|
||
|
end_date=filters.end_time
|
||
|
)
|
||
|
|
||
|
return data
|