Pagination contract is not standardized across endpoints
This commit is contained in:
@@ -7,7 +7,7 @@ from __future__ import annotations
|
||||
|
||||
from pydantic import Field
|
||||
|
||||
from app.models.response import BanGuiBaseModel
|
||||
from app.models.response import BanGuiBaseModel, PaginatedListResponse
|
||||
|
||||
from app.models.ban import TimeRange
|
||||
|
||||
@@ -56,13 +56,15 @@ class HistoryBanItem(BanGuiBaseModel):
|
||||
description="Organisation name associated with the IP.",
|
||||
)
|
||||
|
||||
class HistoryListResponse(BanGuiBaseModel):
|
||||
"""Paginated history ban-list response."""
|
||||
class HistoryListResponse(PaginatedListResponse[HistoryBanItem]):
|
||||
"""Paginated history ban-list response.
|
||||
|
||||
items: list[HistoryBanItem] = Field(default_factory=list)
|
||||
total: int = Field(..., ge=0, description="Total matching records.")
|
||||
page: int = Field(..., ge=1)
|
||||
page_size: int = Field(..., ge=1)
|
||||
Request: ``GET /api/history`` with optional time-range, jail, IP, and
|
||||
origin filters plus pagination parameters.
|
||||
Response: Paginated collection of historical ban records with geolocation.
|
||||
"""
|
||||
|
||||
pass
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Per-IP timeline
|
||||
|
||||
Reference in New Issue
Block a user