endpoint setup

This commit is contained in:
exolonConfidental
2026-02-08 11:18:47 +05:30
parent 8fb3b7cf67
commit a77788fc47
33 changed files with 932 additions and 352 deletions

49
app/schemas/map_schema.py Normal file
View File

@@ -0,0 +1,49 @@
from pydantic import BaseModel, Field
class MapQueryParams(BaseModel):
lat: float = Field(..., ge=-90, le=90, description="Latitude")
lon: float = Field(..., ge=-180, le=180, description="Longitude")
radius: int = Field(2000, gt=0, le=50000, description="Search radius in meters")
class LocationResponse(BaseModel):
id: int
# OSM identifiers
place_id: int
osm_id: int
osm_type: str
# Coordinates
latitude: float
longitude: float
# Address info
house_number: str | None = None
road: str
city: str
county: str
state: str
postcode: str
country: str
country_code: str
# Display name
display_name: str
# Bounding box
bbox_lat_min: float
bbox_lat_max: float
bbox_lon_min: float
bbox_lon_max: float
class Config:
from_attributes = True
class MapQueryResponse(BaseModel):
total: int
locations: list[LocationResponse]