2021-11-04 17:35:34 +08:00
|
|
|
from rest_framework.pagination import PageNumberPagination
|
|
|
|
|
|
|
|
|
|
|
|
class BasePagination(PageNumberPagination):
|
|
|
|
invalid_page_message = '无效页面'
|
2021-12-12 15:44:39 +08:00
|
|
|
|
|
|
|
|
|
|
|
class LimitedPagination(BasePagination):
|
|
|
|
max_page_size = 16
|
2021-11-04 17:35:34 +08:00
|
|
|
page_size = 16
|
|
|
|
|
|
|
|
|
2021-12-12 15:44:39 +08:00
|
|
|
class InfinitePagination(BasePagination):
|
2021-11-04 17:35:34 +08:00
|
|
|
max_page_size = 999999
|
2021-12-12 15:44:39 +08:00
|
|
|
page_size = 999999
|
2021-11-04 17:35:34 +08:00
|
|
|
|
|
|
|
|
|
|
|
__all__ = [
|
2021-12-12 15:44:39 +08:00
|
|
|
'LimitedPagination', 'InfinitePagination',
|
2021-11-04 17:35:34 +08:00
|
|
|
]
|