|
|
|
@ -20,14 +20,14 @@ QueryStr = constr(pattern=r"^[ -~]+$", min_length=1)
|
|
|
|
def common_parameters(
|
|
|
|
def common_parameters(
|
|
|
|
db_session: DbSession, # type: ignore
|
|
|
|
db_session: DbSession, # type: ignore
|
|
|
|
current_user: QueryStr = Query(None, alias="currentUser"), # type: ignore
|
|
|
|
current_user: QueryStr = Query(None, alias="currentUser"), # type: ignore
|
|
|
|
page: int = Query(1, gt=0, lt=2147483647),
|
|
|
|
page: int = Query(1, gt=0, le=1000000),
|
|
|
|
items_per_page: int = Query(5, alias="itemsPerPage", gt=-2, lt=2147483647),
|
|
|
|
items_per_page: int = Query(5, alias="itemsPerPage", gt=-2, le=1000000),
|
|
|
|
query_str: QueryStr = Query(None, alias="q"), # type: ignore
|
|
|
|
query_str: QueryStr = Query(None, alias="q"), # type: ignore
|
|
|
|
filter_spec: QueryStr = Query(None, alias="filter"), # type: ignore
|
|
|
|
filter_spec: QueryStr = Query(None, alias="filter"), # type: ignore
|
|
|
|
sort_by: List[str] = Query([], alias="sortBy[]"),
|
|
|
|
sort_by: List[str] = Query([], alias="sortBy[]"),
|
|
|
|
descending: List[bool] = Query([], alias="descending[]"),
|
|
|
|
descending: List[bool] = Query([], alias="descending[]"),
|
|
|
|
exclude: List[str] = Query([], alias="exclude[]"),
|
|
|
|
exclude: List[str] = Query([], alias="exclude[]"),
|
|
|
|
all: int = Query(0),
|
|
|
|
all: int = Query(0, ge=0, le=1000000),
|
|
|
|
# role: QueryStr = Depends(get_current_role),
|
|
|
|
# role: QueryStr = Depends(get_current_role),
|
|
|
|
):
|
|
|
|
):
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
|