Skip to content

Commit

Permalink
Initial attempt at stub route for geoencoder
Browse files Browse the repository at this point in the history
  • Loading branch information
dmannarino committed Dec 17, 2024
1 parent 7be61b9 commit b94f3fa
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from .routes.analysis import analysis
from .routes.assets import asset, assets
from .routes.authentication import authentication
from .routes.thematic import geoencoder
from .routes.datasets import asset as version_asset
from .routes.datasets import (
dataset,
Expand Down Expand Up @@ -128,6 +129,13 @@ async def rve_error_handler(
app.include_router(r, prefix="/dataset")


################
# THEMATIC API #
################

app.include_router(geoencoder.router, prefix="/thematic")


###############
# ASSET API
###############
Expand Down
2 changes: 2 additions & 0 deletions app/routes/thematic/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"""
"""
38 changes: 38 additions & 0 deletions app/routes/thematic/geoencoder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
from fastapi import APIRouter, Request as FastApiRequest


router = APIRouter()


@router.get(
"/geoencoder/{country}/{region}/{subregion}",
# response_class=RedirectResponse,
status_code=200,
)
async def geoencoder(
*,
# dataset_version: Tuple[str, str] = Depends(dataset_version_dependency),
request: FastApiRequest,
):
"""
"""
return {
"adminVersion": "4.1",
"matches": [
{
"country": {
"id": "HND",
"name": "Honduras"
},
"region": {
"id": 1,
"name": "Atlántida"
},
"subregion": {
"id": 4,
"name": "Jutiapa"
}
}
]
}

0 comments on commit b94f3fa

Please sign in to comment.