|
@@ -1,7 +1,6 @@
|
|
|
package cz.senslog.telemetry.server;
|
|
package cz.senslog.telemetry.server;
|
|
|
|
|
|
|
|
import cz.senslog.telemetry.app.Application;
|
|
import cz.senslog.telemetry.app.Application;
|
|
|
-import cz.senslog.telemetry.database.DataNotFoundException;
|
|
|
|
|
import cz.senslog.telemetry.database.SortType;
|
|
import cz.senslog.telemetry.database.SortType;
|
|
|
import cz.senslog.telemetry.database.repository.SensLogRepository;
|
|
import cz.senslog.telemetry.database.repository.SensLogRepository;
|
|
|
import cz.senslog.telemetry.utils.TernaryCondition;
|
|
import cz.senslog.telemetry.utils.TernaryCondition;
|
|
@@ -9,8 +8,6 @@ import io.vertx.core.http.HttpServerRequest;
|
|
|
import io.vertx.core.json.JsonArray;
|
|
import io.vertx.core.json.JsonArray;
|
|
|
import io.vertx.core.json.JsonObject;
|
|
import io.vertx.core.json.JsonObject;
|
|
|
import io.vertx.ext.web.RoutingContext;
|
|
import io.vertx.ext.web.RoutingContext;
|
|
|
-import org.apache.logging.log4j.LogManager;
|
|
|
|
|
-import org.apache.logging.log4j.Logger;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.time.OffsetDateTime;
|
|
import java.time.OffsetDateTime;
|
|
@@ -24,7 +21,6 @@ import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
|
|
|
import static java.util.stream.Collectors.toList;
|
|
import static java.util.stream.Collectors.toList;
|
|
|
|
|
|
|
|
public class OpenAPIHandler {
|
|
public class OpenAPIHandler {
|
|
|
- private static final Logger logger = LogManager.getLogger(OpenAPIHandler.class);
|
|
|
|
|
|
|
|
|
|
private static final int DEFAULT_MAX_DATA_LIMIT = 500;
|
|
private static final int DEFAULT_MAX_DATA_LIMIT = 500;
|
|
|
private static final ZoneId DEFAULT_ZONE_ID = ZoneId.of("UTC");
|
|
private static final ZoneId DEFAULT_ZONE_ID = ZoneId.of("UTC");
|
|
@@ -48,15 +44,6 @@ public class OpenAPIHandler {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private static final BiConsumer<Throwable, Consumer<Integer>> throwableToStatusCode = (th, handler) -> {
|
|
|
|
|
- if (th instanceof DataNotFoundException) {
|
|
|
|
|
- handler.accept(404);
|
|
|
|
|
- } else {
|
|
|
|
|
- handler.accept(400);
|
|
|
|
|
- }
|
|
|
|
|
- };
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
public void info(RoutingContext rc) {
|
|
public void info(RoutingContext rc) {
|
|
|
rc.response().end(JsonObject.of(
|
|
rc.response().end(JsonObject.of(
|
|
|
"name", Application.PROJECT_NAME,
|
|
"name", Application.PROJECT_NAME,
|
|
@@ -86,7 +73,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> rc.fail(400, th));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdGET(RoutingContext rc) {
|
|
public void campaignIdGET(RoutingContext rc) {
|
|
@@ -112,7 +99,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitsGET(RoutingContext rc) {
|
|
public void campaignIdUnitsGET(RoutingContext rc) {
|
|
@@ -138,7 +125,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(u.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(u.getFromTime(), zone),
|
|
|
"toTime", DATE_TIME_FORMATTER.apply(u.getToTime(), zone)
|
|
"toTime", DATE_TIME_FORMATTER.apply(u.getToTime(), zone)
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitsObservationsGET(RoutingContext rc) {
|
|
public void campaignIdUnitsObservationsGET(RoutingContext rc) {
|
|
@@ -215,7 +202,7 @@ public class OpenAPIHandler {
|
|
|
"altitude", o.getLocation().getAltitude()),
|
|
"altitude", o.getLocation().getAltitude()),
|
|
|
"observedValues", o.getObservedValues()
|
|
"observedValues", o.getObservedValues()
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdObservationsGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdObservationsGET(RoutingContext rc) {
|
|
@@ -292,7 +279,7 @@ public class OpenAPIHandler {
|
|
|
"altitude", o.getLocation().getAltitude()),
|
|
"altitude", o.getLocation().getAltitude()),
|
|
|
"observedValues", o.getObservedValues()
|
|
"observedValues", o.getObservedValues()
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitsObservationsLocationsGET(RoutingContext rc) {
|
|
public void campaignIdUnitsObservationsLocationsGET(RoutingContext rc) {
|
|
@@ -353,7 +340,7 @@ public class OpenAPIHandler {
|
|
|
l.getLocation().getAltitude()
|
|
l.getLocation().getAltitude()
|
|
|
)
|
|
)
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdLocationsGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdLocationsGET(RoutingContext rc) {
|
|
@@ -433,7 +420,7 @@ public class OpenAPIHandler {
|
|
|
l.getLocation().getAltitude()
|
|
l.getLocation().getAltitude()
|
|
|
)
|
|
)
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
} else {
|
|
} else {
|
|
|
// TODO implement filter
|
|
// TODO implement filter
|
|
|
/*
|
|
/*
|
|
@@ -462,7 +449,7 @@ public class OpenAPIHandler {
|
|
|
"imei", u.getImei(),
|
|
"imei", u.getImei(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void unitIdSensorsGET(RoutingContext rc) {
|
|
public void unitIdSensorsGET(RoutingContext rc) {
|
|
@@ -482,7 +469,7 @@ public class OpenAPIHandler {
|
|
|
"name", s.getName(),
|
|
"name", s.getName(),
|
|
|
"type", s.getType()
|
|
"type", s.getType()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void unitsGET(RoutingContext rc) {
|
|
public void unitsGET(RoutingContext rc) {
|
|
@@ -500,7 +487,7 @@ public class OpenAPIHandler {
|
|
|
"name", u.getName(),
|
|
"name", u.getName(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void unitIdCampaignsGET(RoutingContext rc) {
|
|
public void unitIdCampaignsGET(RoutingContext rc) {
|
|
@@ -524,7 +511,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(c.getFromTime(), zone),
|
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
"toTime", DATE_TIME_FORMATTER.apply(c.getToTime(), zone)
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void sensorIdGET(RoutingContext rc) {
|
|
public void sensorIdGET(RoutingContext rc) {
|
|
@@ -548,7 +535,7 @@ public class OpenAPIHandler {
|
|
|
"type", s.getType(),
|
|
"type", s.getType(),
|
|
|
"phenomenon", s.getPhenomenon().getName()
|
|
"phenomenon", s.getPhenomenon().getName()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void sensorsGET(RoutingContext rc) {
|
|
public void sensorsGET(RoutingContext rc) {
|
|
@@ -566,7 +553,7 @@ public class OpenAPIHandler {
|
|
|
"name", s.getName(),
|
|
"name", s.getName(),
|
|
|
"description", s.getDescription()
|
|
"description", s.getDescription()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void sensorIdUnitsGET(RoutingContext rc) {
|
|
public void sensorIdUnitsGET(RoutingContext rc) {
|
|
@@ -586,7 +573,7 @@ public class OpenAPIHandler {
|
|
|
"name", u.getName(),
|
|
"name", u.getName(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void phenomenonIdGET(RoutingContext rc) {
|
|
public void phenomenonIdGET(RoutingContext rc) {
|
|
@@ -607,7 +594,7 @@ public class OpenAPIHandler {
|
|
|
"uom", p.getUom(),
|
|
"uom", p.getUom(),
|
|
|
"uomLink", p.getUomLink()
|
|
"uomLink", p.getUomLink()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void phenomenonsGET(RoutingContext rc) {
|
|
public void phenomenonsGET(RoutingContext rc) {
|
|
@@ -624,7 +611,7 @@ public class OpenAPIHandler {
|
|
|
"id", p.getId(),
|
|
"id", p.getId(),
|
|
|
"name", p.getName()
|
|
"name", p.getName()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void phenomenonIdSensorsGET(RoutingContext rc) {
|
|
public void phenomenonIdSensorsGET(RoutingContext rc) {
|
|
@@ -644,7 +631,7 @@ public class OpenAPIHandler {
|
|
|
"name", s.getName(),
|
|
"name", s.getName(),
|
|
|
"type", s.getType()
|
|
"type", s.getType()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdGET(RoutingContext rc) {
|
|
@@ -675,7 +662,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(u.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(u.getFromTime(), zone),
|
|
|
"toTime", DATE_TIME_FORMATTER.apply(u.getToTime(), zone)
|
|
"toTime", DATE_TIME_FORMATTER.apply(u.getToTime(), zone)
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdSensorsGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdSensorsGET(RoutingContext rc) {
|
|
@@ -696,7 +683,7 @@ public class OpenAPIHandler {
|
|
|
"name", s.getName(),
|
|
"name", s.getName(),
|
|
|
"type", s.getType()
|
|
"type", s.getType()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdSensorIdGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdSensorIdGET(RoutingContext rc) {
|
|
@@ -724,7 +711,7 @@ public class OpenAPIHandler {
|
|
|
"type", s.getType(),
|
|
"type", s.getType(),
|
|
|
"phenomenon", s.getPhenomenon().getName()
|
|
"phenomenon", s.getPhenomenon().getName()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void campaignIdUnitIdSensorIdObservationsGET(RoutingContext rc) {
|
|
public void campaignIdUnitIdSensorIdObservationsGET(RoutingContext rc) {
|
|
@@ -802,7 +789,7 @@ public class OpenAPIHandler {
|
|
|
"latitude", o.getLocation().getLatitude(),
|
|
"latitude", o.getLocation().getLatitude(),
|
|
|
"altitude", o.getLocation().getAltitude())
|
|
"altitude", o.getLocation().getAltitude())
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driversGET(RoutingContext rc) {
|
|
public void driversGET(RoutingContext rc) {
|
|
@@ -819,7 +806,7 @@ public class OpenAPIHandler {
|
|
|
"id", d.getId(),
|
|
"id", d.getId(),
|
|
|
"name", d.getName()
|
|
"name", d.getName()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdGET(RoutingContext rc) {
|
|
public void driverIdGET(RoutingContext rc) {
|
|
@@ -839,7 +826,7 @@ public class OpenAPIHandler {
|
|
|
"id", d.getId(),
|
|
"id", d.getId(),
|
|
|
"name", d.getName()
|
|
"name", d.getName()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdUnitsGET(RoutingContext rc) {
|
|
public void driverIdUnitsGET(RoutingContext rc) {
|
|
@@ -865,7 +852,7 @@ public class OpenAPIHandler {
|
|
|
"name", u.getName(),
|
|
"name", u.getName(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdUnitIdGET(RoutingContext rc) {
|
|
public void driverIdUnitIdGET(RoutingContext rc) {
|
|
@@ -888,7 +875,7 @@ public class OpenAPIHandler {
|
|
|
"imei", u.getImei(),
|
|
"imei", u.getImei(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdUnitIdActionsGET(RoutingContext rc) {
|
|
public void driverIdUnitIdActionsGET(RoutingContext rc) {
|
|
@@ -908,7 +895,7 @@ public class OpenAPIHandler {
|
|
|
"id", a.getId(),
|
|
"id", a.getId(),
|
|
|
"name", a.getName()
|
|
"name", a.getName()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdActionsGET(RoutingContext rc) {
|
|
public void driverIdActionsGET(RoutingContext rc) {
|
|
@@ -927,7 +914,7 @@ public class OpenAPIHandler {
|
|
|
"id", a.getId(),
|
|
"id", a.getId(),
|
|
|
"name", a.getName()
|
|
"name", a.getName()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdActionIdGET(RoutingContext rc) {
|
|
public void driverIdActionIdGET(RoutingContext rc) {
|
|
@@ -948,7 +935,7 @@ public class OpenAPIHandler {
|
|
|
"id", a.getId(),
|
|
"id", a.getId(),
|
|
|
"name", a.getName()
|
|
"name", a.getName()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdActionIdUnitsGET(RoutingContext rc) {
|
|
public void driverIdActionIdUnitsGET(RoutingContext rc) {
|
|
@@ -969,7 +956,7 @@ public class OpenAPIHandler {
|
|
|
"name", u.getName(),
|
|
"name", u.getName(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdActionIdUnitIdGET(RoutingContext rc) {
|
|
public void driverIdActionIdUnitIdGET(RoutingContext rc) {
|
|
@@ -994,7 +981,7 @@ public class OpenAPIHandler {
|
|
|
"imei", u.getImei(),
|
|
"imei", u.getImei(),
|
|
|
"description", u.getDescription()
|
|
"description", u.getDescription()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdUnitIdActionIdGET(RoutingContext rc) {
|
|
public void driverIdUnitIdActionIdGET(RoutingContext rc) {
|
|
@@ -1017,7 +1004,7 @@ public class OpenAPIHandler {
|
|
|
"id", a.getId(),
|
|
"id", a.getId(),
|
|
|
"name", a.getName()
|
|
"name", a.getName()
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void driverIdUnitIdActionIdEventsGET(RoutingContext rc) {
|
|
public void driverIdUnitIdActionIdEventsGET(RoutingContext rc) {
|
|
@@ -1042,7 +1029,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(e.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(e.getFromTime(), zone),
|
|
|
"description", DATE_TIME_FORMATTER.apply(e.getToTime(), zone)
|
|
"description", DATE_TIME_FORMATTER.apply(e.getToTime(), zone)
|
|
|
))).collect(toList())).encode()))
|
|
))).collect(toList())).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void eventIdGET(RoutingContext rc) {
|
|
public void eventIdGET(RoutingContext rc) {
|
|
@@ -1072,7 +1059,7 @@ public class OpenAPIHandler {
|
|
|
"fromTime", DATE_TIME_FORMATTER.apply(e.getFromTime(), zone),
|
|
"fromTime", DATE_TIME_FORMATTER.apply(e.getFromTime(), zone),
|
|
|
"description", DATE_TIME_FORMATTER.apply(e.getToTime(), zone)
|
|
"description", DATE_TIME_FORMATTER.apply(e.getToTime(), zone)
|
|
|
)).encode()))
|
|
)).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void eventIdObservationsGET(RoutingContext rc) {
|
|
public void eventIdObservationsGET(RoutingContext rc) {
|
|
@@ -1148,7 +1135,7 @@ public class OpenAPIHandler {
|
|
|
"altitude", o.getLocation().getAltitude()),
|
|
"altitude", o.getLocation().getAltitude()),
|
|
|
"observedValues", o.getObservedValues()
|
|
"observedValues", o.getObservedValues()
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public void eventIdLocationsGET(RoutingContext rc) {
|
|
public void eventIdLocationsGET(RoutingContext rc) {
|
|
@@ -1223,6 +1210,6 @@ public class OpenAPIHandler {
|
|
|
l.getLocation().getAltitude()
|
|
l.getLocation().getAltitude()
|
|
|
)
|
|
)
|
|
|
)).collect(toList())))).encode()))
|
|
)).collect(toList())))).encode()))
|
|
|
- .onFailure(th -> throwableToStatusCode.accept(th, code -> rc.fail(code, th)));
|
|
|
|
|
|
|
+ .onFailure(rc::fail);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|