54 lines
1.6 KiB
Python
54 lines
1.6 KiB
Python
"""B06 종횡단 생성 요청·응답 검증 모델."""
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
class SectionGenerateRequest(BaseModel):
|
|
"""종횡단 생성 실행 요청."""
|
|
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
route_id: int = Field(gt=0, description="종횡단을 생성할 확정 경로 routes.id")
|
|
filter_key: str = Field(description="지면 필터 키 (grid_min_z/csf/pmf)")
|
|
method: str = Field(default="dtm", description="지표면 표현")
|
|
smooth: bool = Field(default=False)
|
|
crs: str | None = Field(default=None, description="좌표계 (예: EPSG:5178)")
|
|
|
|
# 측점/횡단 옵션 (미지정 시 config 기본값)
|
|
station_interval_m: float | None = Field(default=None, gt=0)
|
|
cross_half_width_m: float | None = Field(default=None, gt=0)
|
|
cross_sample_interval_m: float | None = Field(default=None, gt=0)
|
|
long_sample_interval_m: float | None = Field(default=None, gt=0)
|
|
|
|
|
|
class SectionGenerateResponse(BaseModel):
|
|
"""종횡단 생성 결과."""
|
|
|
|
status: str = "success"
|
|
project_id: str
|
|
route_id: int
|
|
longitudinal_id: int
|
|
cross_section_count: int
|
|
length_m: float
|
|
longitudinal_file_path: str
|
|
|
|
|
|
class SectionConfirmResponse(BaseModel):
|
|
"""종횡단 확정 결과."""
|
|
|
|
status: str = "success"
|
|
project_id: str
|
|
route_id: int
|
|
confirmed: bool = True
|
|
|
|
|
|
class SectionSummaryResponse(BaseModel):
|
|
"""종횡단 요약 조회 결과."""
|
|
|
|
status: str = "success"
|
|
project_id: str
|
|
route_id: int
|
|
longitudinal: dict[str, Any] | None = None
|