重构前保存现有 apps/ 结构基线,供后续各阶段回滚。 Co-Authored-By: Claude <noreply@anthropic.com>
19 lines
1001 B
Python
19 lines
1001 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# 城市表单验证
|
|
class CityForm(BaseModel):
|
|
id: Optional[int] = Field(None, description="城市ID")
|
|
name: str = Field(..., min_length=1, max_length=150, description="城市名称")
|
|
short_name: str = Field(..., min_length=1, max_length=150, description="城市简称")
|
|
pinyin: str = Field(..., min_length=1, max_length=150, description="城市拼音")
|
|
city_code: str = Field(..., min_length=1, max_length=6, description="城市区号")
|
|
area_code: str = Field(..., min_length=1, max_length=20, description="行政编码")
|
|
zip_code: str = Field(..., min_length=1, max_length=6, description="城市邮编")
|
|
level: int = Field(..., ge=1, le=4, description="城市级别")
|
|
lng: str = Field(..., min_length=1, max_length=150, description="城市经度")
|
|
lat: str = Field(..., min_length=1, max_length=150, description="城市纬度")
|
|
pid: Optional[int] = Field(None, description="上级ID")
|