from typing import Optional from pydantic import Field from domain.dtos.base_dto import DtoBase class SysPostBaseDto(DtoBase): post_name: str = Field(..., title="岗位名称", max_length=30) post_code: str = Field(..., title="岗位编码", max_length=60) status: int = Field(0, title="状态", ge=0, le=1) remark: Optional[str] = Field(None, title="备注", max_length=500) class Config: from_attributes = True class SysPostDto(SysPostBaseDto): id: int = Field(..., title="岗位ID", gt=0) class SysPostCreateDto(SysPostBaseDto): post_name: str = Field(..., title="岗位名称", max_length=30) post_code: str = Field(..., title="岗位编码", max_length=60) class SysPostUpdateDto(SysPostBaseDto): id: int = Field(..., title="岗位ID", gt=0) post_code: Optional[str] = Field(None, title="岗位编码", max_length=60)