mirror of
http://88.130.71.182:3000/BlitTech/badoHair_be.git
synced 2026-06-12 23:23:22 +00:00
Initial Commit
This commit is contained in:
10
app/core/pagination.py
Normal file
10
app/core/pagination.py
Normal file
@@ -0,0 +1,10 @@
|
||||
from typing import Annotated
|
||||
from fastapi import Query
|
||||
|
||||
|
||||
def pagination_params(
|
||||
page: Annotated[int, Query(ge=1)] = 1,
|
||||
per_page: Annotated[int, Query(ge=1, le=100)] = 20,
|
||||
) -> tuple[int, int, int]:
|
||||
offset = (page - 1) * per_page
|
||||
return page, per_page, offset
|
||||
Reference in New Issue
Block a user