FastAPI service backed by PostgreSQL+PostGIS: cities/places/place_content schema (normalized per-language, per-length content for easy future re-ingestion), Alembic migration, an iterative-radius-expansion nearby search endpoint, a name-search fallback for denied-location flows, and a YAML seed loader CLI. Verified end-to-end against a live Docker Postgres+PostGIS instance (migration, city seed, place/content CRUD, and nearby radius expansion all confirmed working via curl). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
32 lines
696 B
Python
32 lines
696 B
Python
from pydantic import BaseModel
|
|
|
|
from app.models.enums import ContentLanguage, ContentLength, PlaceCategory
|
|
from app.schemas.common import LatLon
|
|
|
|
|
|
class ContentOut(BaseModel):
|
|
language: ContentLanguage
|
|
length: ContentLength
|
|
title: str
|
|
body: str
|
|
|
|
|
|
class PlaceListItem(BaseModel):
|
|
id: int
|
|
slug: str
|
|
category: PlaceCategory
|
|
name: str
|
|
location: LatLon
|
|
|
|
|
|
class PlaceDetail(BaseModel):
|
|
id: int
|
|
slug: str
|
|
category: PlaceCategory
|
|
location: LatLon
|
|
address: str | None = None
|
|
district: str | None = None
|
|
built_year: str | None = None
|
|
architect_builder: str | None = None
|
|
architectural_style: str | None = None
|
|
content: ContentOut
|