# _*_ coding : UTF-8 _*_
# @Time : 2025/01/19 01:44
# @UpdateTime : 2025/01/19 01:44
# @Author : sonder
# @File : common.py
# @Software : PyCharm
# @Comment : 本程序
from typing import List

from pydantic import BaseModel, Field


class BaseResponse(BaseModel):
    """
    基础响应模型
    """
    code: int = Field(default=200, description="响应码")
    msg: str = Field(default="操作成功！", description="响应信息")
    data: dict = Field(default=None, description="响应数据")
    success: bool = Field(default=True, description="操作是否成功")
    time: str = Field(default="", description="响应时间")


class ListQueryResult(BaseModel):
    """
    列表查询结果
    """
    result: List = Field(default=[], description="列表数据")
    total: int = Field(default=0, description="总条数")
    page: int = Field(default=1, description="当前页码")
    pageSize: int = Field(default=10, description="每页数量")


class DeleteListParams(BaseModel):
    """
    批量删除参数
    """
    ids: List[str] = Field(default=[], description="删除ID列表")

    class Config:
        json_schema_extra = {
            "example": {
                "ids": [
                    "1",
                    "2",
                    "3"
                ]
            }
        }
