26 lines
520 B
Python
26 lines
520 B
Python
from pydantic import BaseModel
|
|
from typing import Optional, List, Any, Generic, TypeVar
|
|
|
|
T = TypeVar('T')
|
|
|
|
class PageParams(BaseModel):
|
|
"""分页参数"""
|
|
page: int = 1
|
|
page_size: int = 20
|
|
|
|
class PageResponse(BaseModel, Generic[T]):
|
|
"""分页响应"""
|
|
total: int
|
|
page: int
|
|
page_size: int
|
|
items: List[T]
|
|
|
|
class BatchImportResponse(BaseModel):
|
|
"""批量导入响应"""
|
|
success: bool
|
|
total: int
|
|
inserted: int
|
|
skipped: int
|
|
skipped_ids: List[str] = []
|
|
message: str
|