feat: 添加分页配置

This commit is contained in:
caoqianming 2026-03-13 12:36:46 +08:00
parent eaa37ad5c7
commit 2ce0d75c41
3 changed files with 8 additions and 2 deletions

View File

View File

@ -0,0 +1,6 @@
from rest_framework.pagination import PageNumberPagination
class StandardPagination(PageNumberPagination):
page_size_query_param = 'page_size'
max_page_size = 100

View File

@ -142,8 +142,8 @@ REST_FRAMEWORK = {
'DEFAULT_PERMISSION_CLASSES': (
'rest_framework.permissions.IsAuthenticated',
),
'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.PageNumberPagination',
'PAGE_SIZE': 20,
'DEFAULT_PAGINATION_CLASS': 'config.pagination.StandardPagination',
'PAGE_SIZE': 10,
}
# JWT settings