diff --git a/src/c3nav/routing/newapi/__init__.py b/src/c3nav/routing/newapi/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/c3nav/routing/newapi/positioning.py b/src/c3nav/routing/newapi/positioning.py new file mode 100644 index 00000000..8e2d78af --- /dev/null +++ b/src/c3nav/routing/newapi/positioning.py @@ -0,0 +1,24 @@ +from ninja import Router as APIRouter + +from c3nav.api.newauth import auth_responses +from c3nav.mapdata.models import Source +from c3nav.mapdata.schemas.responses import BoundsSchema + +positioning_api_router = APIRouter(tags=["positioning"]) + + +@positioning_api_router.post('/locate/', summary="locate based on wifi scans", + response={200: BoundsSchema, **auth_responses}) +def locate(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + } + +@positioning_api_router.get('/locate-test/', summary="get dummy location for debugging", + response={200: BoundsSchema, **auth_responses}) +def locate_test(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + } diff --git a/src/c3nav/routing/newapi/routing.py b/src/c3nav/routing/newapi/routing.py new file mode 100644 index 00000000..df3210ff --- /dev/null +++ b/src/c3nav/routing/newapi/routing.py @@ -0,0 +1,42 @@ +from ninja import Router as APIRouter + +from c3nav.api.newauth import auth_responses +from c3nav.mapdata.models import Source +from c3nav.mapdata.schemas.responses import BoundsSchema + +routing_api_router = APIRouter(tags=["routing"]) + + +@routing_api_router.post('/route/', summary="get route between two locations", + response={200: BoundsSchema, **auth_responses}) +def get_route(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + } + +@routing_api_router.get('/options/', summary="get current route options", + response={200: BoundsSchema, **auth_responses}) +def get_route_options(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + } + + +@routing_api_router.put('/options/', summary="set route options for user or session", + response={200: BoundsSchema, **auth_responses}) +def set_route_options(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + } + + +@routing_api_router.get('/options/form/', summary="get current route options with form definitions (like old API)", + response={200: BoundsSchema, **auth_responses}) +def get_route_options_form(request): + # todo: implement + return { + "bounds": Source.max_bounds(), + }