From d47534ad8b056df7928e45a1942113b6631d1a7d Mon Sep 17 00:00:00 2001 From: Wu Clan Date: Wed, 16 Sep 2026 10:46:57 +0800 Subject: [PATCH] Update cursor pagination page size params (#1249) --- backend/common/pagination.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/backend/common/pagination.py b/backend/common/pagination.py index 4b565c35..adb21cfd 100644 --- a/backend/common/pagination.py +++ b/backend/common/pagination.py @@ -34,6 +34,12 @@ class _CustomPageParams(BaseModel, AbstractParams): ) +class _CustomCursorParams(CursorParams): + """自定义游标分页参数""" + + size: int = Query(50, ge=0, le=200, description='每页数量') + + class _Links(BaseModel): """分页链接""" @@ -98,7 +104,7 @@ class _CustomPage(_PageDetails, AbstractPage[T], Generic[T]): class _CustomCursorPage(_CursorPageDetails, AbstractPage[T], Generic[T]): """自定义游标分页类""" - __params_type__ = CursorParams + __params_type__ = _CustomCursorParams @classmethod def create(