adding the missing files might be smart
This commit is contained in:
parent
a7a40dcf04
commit
3f8e42d13e
3 changed files with 66 additions and 0 deletions
0
src/c3nav/routing/newapi/__init__.py
Normal file
0
src/c3nav/routing/newapi/__init__.py
Normal file
24
src/c3nav/routing/newapi/positioning.py
Normal file
24
src/c3nav/routing/newapi/positioning.py
Normal 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(),
|
||||||
|
}
|
42
src/c3nav/routing/newapi/routing.py
Normal file
42
src/c3nav/routing/newapi/routing.py
Normal 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(),
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue