Pagination contract is not standardized across endpoints

This commit is contained in:
2026-04-28 21:40:22 +02:00
parent ad21590f60
commit a2129bb9bd
13 changed files with 387 additions and 56 deletions

View File

@@ -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