added fix script for loops in carta api specs + poc alternative endpoint
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
package SuMoC.backend.carta;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import sumoc.backend.carta.client.api.CartaApi;
|
||||
import sumoc.backend.carta.client.api.MapApi;
|
||||
import sumoc.backend.carta.client.invoker.ApiException;
|
||||
import sumoc.backend.carta.client.model.Direction;
|
||||
|
||||
@Service
|
||||
public class CartaClient {
|
||||
|
||||
private final MapApi mapApi;
|
||||
private final CartaApi cartaApi;
|
||||
|
||||
public CartaClient(MapApi mapApi) {
|
||||
public CartaClient(MapApi mapApi, CartaApi cartaApi) {
|
||||
this.cartaApi = cartaApi;
|
||||
this.mapApi = mapApi;
|
||||
}
|
||||
|
||||
@@ -47,7 +49,7 @@ public class CartaClient {
|
||||
) {
|
||||
try {
|
||||
String uid = null; // Optional user identifier
|
||||
return mapApi.getDirection(
|
||||
return cartaApi.getDirection(
|
||||
origin,
|
||||
destination,
|
||||
mode,
|
||||
@@ -63,7 +65,7 @@ public class CartaClient {
|
||||
location,
|
||||
uid
|
||||
);
|
||||
} catch (ApiException e) {
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user