adding the missing files might be smart

This commit is contained in:
Laura Klünder 2023-11-24 16:15:19 +01:00
parent a7a40dcf04
commit 3f8e42d13e
3 changed files with 66 additions and 0 deletions

View file

View file

@ -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(),
}

View file

@ -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(),
}