Initial project commit
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
from typing import Generic, TypeVar
|
||||
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
class ResponseBase(BaseModel):
|
||||
code: int = 0
|
||||
message: str = "success"
|
||||
|
||||
|
||||
class PageParams(BaseModel):
|
||||
page: int = 1
|
||||
page_size: int = Field(default=20, le=100)
|
||||
|
||||
|
||||
class PageResponse(ResponseBase, Generic[T]):
|
||||
total: int
|
||||
items: list[T]
|
||||
Reference in New Issue
Block a user