22 lines
421 B
Python
22 lines
421 B
Python
from typing import Generic, TypeVar, Optional
|
|
from pydantic import BaseModel
|
|
|
|
T = TypeVar("T")
|
|
|
|
|
|
class MetaSchema(BaseModel):
|
|
total_page: int
|
|
current_page: int
|
|
total_data: int
|
|
total_all_data: int
|
|
|
|
|
|
class ResponseSchema(BaseModel, Generic[T]):
|
|
message: str
|
|
data: Optional[T] = None
|
|
meta: Optional[MetaSchema] = None
|
|
|
|
class Config:
|
|
from_attributes = True
|
|
exclude_none = True
|