Files
CosScene/server/app/schemas/common.py
T
2026-05-09 16:40:29 +08:00

21 lines
351 B
Python

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]