diff --git a/backend/src/main/java/net/miarma/contaminus/server/DataLayerAPIVerticle.java b/backend/src/main/java/net/miarma/contaminus/server/DataLayerAPIVerticle.java index c42cdd8..01169b1 100644 --- a/backend/src/main/java/net/miarma/contaminus/server/DataLayerAPIVerticle.java +++ b/backend/src/main/java/net/miarma/contaminus/server/DataLayerAPIVerticle.java @@ -28,6 +28,10 @@ import net.miarma.contaminus.database.entities.DeviceSensorHistory; import net.miarma.contaminus.database.entities.DeviceSensorValue; import net.miarma.contaminus.database.entities.Sensor; +/* + * This class is a Verticle that will handle the Data Layer API. + */ + @SuppressWarnings("unused") public class DataLayerAPIVerticle extends AbstractVerticle { private JDBCPool pool; @@ -49,7 +53,7 @@ public class DataLayerAPIVerticle extends AbstractVerticle { .put("password", dbPwd) .put("max_pool_size", poolSize != null ? poolSize : 10); - this.pool = JDBCPool.pool(Vertx.vertx(), dbConfig);; + this.pool = JDBCPool.pool(Vertx.vertx(), dbConfig); } @Override @@ -177,13 +181,7 @@ public class DataLayerAPIVerticle extends AbstractVerticle { private void updateActuator(RoutingContext context) { context.response().end("TODO"); } - - /* - * A PARTIR DE AQUI LO HACEMOS ÁLVARO Y YO - * NO RAYARSE - * - */ - + private void getLatestValuesView(RoutingContext context) { String query = QueryBuilder .select(DeviceLatestValuesView.class) diff --git a/backend/src/main/java/net/miarma/contaminus/server/LogicLayerAPIVerticle.java b/backend/src/main/java/net/miarma/contaminus/server/LogicLayerAPIVerticle.java index db4d208..4620334 100644 --- a/backend/src/main/java/net/miarma/contaminus/server/LogicLayerAPIVerticle.java +++ b/backend/src/main/java/net/miarma/contaminus/server/LogicLayerAPIVerticle.java @@ -55,19 +55,15 @@ public class LogicLayerAPIVerticle extends AbstractVerticle { .allowCredentials(true) .allowedHeaders(allowedHeaders) .allowedMethods(allowedMethods)); + router.route().handler(BodyHandler.create()); - // Group Routes router.route(HttpMethod.GET, Constants.GET_GROUP_DEVICES).handler(this::getGroupDevices); - - // Device Routes router.route(HttpMethod.GET, Constants.GET_DEVICE_SENSORS).handler(this::getDeviceSensors); router.route(HttpMethod.GET, Constants.GET_DEVICE_ACTUATORS).handler(this::getDeviceActuators); router.route(HttpMethod.GET, Constants.GET_DEVICE_LATEST_VALUES).handler(this::getDeviceLatestValues); router.route(HttpMethod.GET, Constants.GET_DEVICE_POLLUTION_MAP).handler(this::getDevicePollutionMap); router.route(HttpMethod.GET, Constants.GET_DEVICE_HISTORY).handler(this::getDeviceHistory); - - // Sensor Routes router.route(HttpMethod.GET, Constants.GET_SENSOR_VALUES).handler(this::getSensorValues); vertx.createHttpServer()