初始化
This commit is contained in:
25
app/schemas/common.py
Normal file
25
app/schemas/common.py
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
Reference in New Issue
Block a user