from pydantic import BaseModel, Field
from typing import Optional


class ProjectInfoIn(BaseModel):
    """项目信息输入"""
    id: Optional[int] = Field(None, description="项目id")
    project_name: Optional[str] = Field(..., description="项目名称")
    type_code: Optional[str] = Field(..., description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")


class ProjectInfoOut(BaseModel):
    """项目信息输出"""
    id: Optional[int] = Field(None, description="项目id")
    project_no: Optional[str] = Field(..., description="项目编号")
    project_name: Optional[str] = Field(..., description="项目名称")
    type_code: Optional[str] = Field(..., description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")
    train_version: Optional[int] = Field(None, description="训练版本号")
    project_status: Optional[str] = Field(None, description="项目状态")

    class Config:
        orm_mode = True


class ProjectInfoPagerOut(BaseModel):
    """项目信息输出"""
    id: Optional[int] = Field(None, description="项目id")
    project_no: Optional[str] = Field(None, description="项目编号")
    project_name: Optional[str] = Field(None, description="项目名称")
    type_code: Optional[str] = Field(None, description="项目类型编码")
    description: Optional[str] = Field(None, description="项目描述")
    train_version: Optional[int] = Field(None, description="训练版本号")
    project_status: Optional[str] = Field(None, description="项目状态")
    mark_count: Optional[int]
    no_mark_count: Optional[int]

    class Config:
        orm_mode = True


class ProjectInfoPager(BaseModel):
    project_name: Optional[str] = Field(None, description="项目名称")
    pagerNum: Optional[int] = Field(1, description="当前页码")
    pagerSize: Optional[int] = Field(10, description="每页数量")

