base structs as agreed upon
This commit is contained in:
@@ -10,6 +10,10 @@ from typing import List
|
||||
app = FastAPI()
|
||||
|
||||
|
||||
# TODO: needs a global variable to store the landmarks accross function calls
|
||||
# linked_tour = []
|
||||
|
||||
|
||||
# Assuming frontend is calling like this :
|
||||
#"http://127.0.0.1:8000/process?param1={param1}¶m2={param2}"
|
||||
@app.post("/optimizer_coords/{start_lat}/{start_lon}/{finish_lat}/{finish_lon}")
|
||||
@@ -50,11 +54,22 @@ def main1(start_lat: float, start_lon: float, preferences: Preferences = Body(..
|
||||
|
||||
# Second stage optimization
|
||||
refined_tour = refine_optimization(landmarks, base_tour, max_walking_time*60+detour, True)
|
||||
|
||||
|
||||
# TODO: should look something like this
|
||||
# # set time to reach and transform into fully functional linked list
|
||||
# linked_tour += link(refined_tour)
|
||||
# return {
|
||||
# 'city_name': 'Paris',
|
||||
# 'n_stops': len(linked_tour),
|
||||
# 'first_landmark_uuid': linked_tour[0].uuid,
|
||||
# }
|
||||
|
||||
return refined_tour
|
||||
|
||||
|
||||
|
||||
|
||||
# input city, country in the form of 'Paris, France'
|
||||
@app.post("/test2/{city_country}")
|
||||
def test2(city_country: str, preferences: Preferences = Body(...)) -> List[Landmark]:
|
||||
@@ -67,4 +82,9 @@ def test2(city_country: str, preferences: Preferences = Body(...)) -> List[Landm
|
||||
|
||||
|
||||
|
||||
@app.get("/landmark/{landmark_uuid}")
|
||||
def get_landmark(landmark_uuid: str) -> Landmark:
|
||||
#cherche dans linked_tour et retourne le landmark correspondant
|
||||
pass
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user