重构前保存现有 apps/ 结构基线,供后续各阶段回滚。 Co-Authored-By: Claude <noreply@anthropic.com>
15 lines
628 B
Python
15 lines
628 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# 部门表单验证
|
|
class DeptForm(BaseModel):
|
|
id: Optional[int] = Field(None, description="部门ID")
|
|
name: str = Field(..., min_length=1, max_length=150, description="部门名称")
|
|
code: str = Field(..., min_length=1, max_length=150, description="部门编码")
|
|
type: int = Field(..., ge=1, le=2, description="部门类型")
|
|
pid: Optional[int] = Field(None, description="上级ID")
|
|
sort: int = Field(..., ge=0, le=99999, description="部门排序")
|
|
note: Optional[str] = Field(None, max_length=255, description="部门备注")
|