23 lines
793 B
Python
23 lines
793 B
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional
|
|
|
|
|
|
class LocationQueryRequest(BaseModel):
|
|
l_row: int = Field(..., description="行数", ge=1, le=100)
|
|
l_col: int = Field(..., description="列数", ge=1, le=100)
|
|
l_layer: int = Field(..., description="层数", ge=1, le=50)
|
|
l_depth: int = Field(..., description="深度", ge=1, le=50)
|
|
sub_area: str = Field(..., description="子区域标识", min_length=1, max_length=10)
|
|
area_id: Optional[int] = Field(1, description="区域ID")
|
|
|
|
class Config:
|
|
json_schema_extra = {
|
|
"example": {
|
|
"l_row": 5,
|
|
"l_col": 8,
|
|
"l_layer": 6,
|
|
"l_depth": 2,
|
|
"sub_area": "A",
|
|
"area_id": 1
|
|
}
|
|
} |