mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-23 01:49:58 +00:00
refactor: Refactor storage system (#937)
This commit is contained in:
14
dbgpt/util/pagination_utils.py
Normal file
14
dbgpt/util/pagination_utils.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from typing import TypeVar, Generic, List
|
||||
from dbgpt._private.pydantic import BaseModel, Field
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class PaginationResult(BaseModel, Generic[T]):
|
||||
"""Pagination result"""
|
||||
|
||||
items: List[T] = Field(..., description="The items in the current page")
|
||||
total_count: int = Field(..., description="Total number of items")
|
||||
total_pages: int = Field(..., description="total number of pages")
|
||||
page: int = Field(..., description="Current page number")
|
||||
page_size: int = Field(..., description="Number of items per page")
|
Reference in New Issue
Block a user