重构前保存现有 apps/ 结构基线,供后续各阶段回滚。 Co-Authored-By: Claude <noreply@anthropic.com>
19 lines
938 B
Python
19 lines
938 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
# 栏目表单验证
|
|
class ItemCateForm(BaseModel):
|
|
id: Optional[int] = Field(None, description="栏目ID")
|
|
name: str = Field(..., min_length=1, max_length=150, description="栏目名称")
|
|
pid: Optional[int] = Field(None, description="上级ID")
|
|
item_id: int = Field(..., ge=0, description="站点ID")
|
|
pinyin: str = Field(..., min_length=1, max_length=150, description="拼音全称")
|
|
code: str = Field(..., min_length=1, max_length=150, description="拼音简称")
|
|
is_cover: int = Field(..., ge=1, le=2, description="是否有封面")
|
|
cover: Optional[str] = Field(None, max_length=255, description="栏目封面")
|
|
status: int = Field(..., ge=1, le=2, description="栏目状态")
|
|
sort: int = Field(..., ge=0, le=99999, description="栏目排序")
|
|
note: Optional[str] = Field(None, max_length=255, description="栏目备注")
|
|
|