1
0

Fixed errors in Business Logic API and finished it.

This commit is contained in:
Jose
2025-03-16 03:24:33 +01:00
parent 4d613efc33
commit 156fc97e98
2 changed files with 7 additions and 13 deletions

View File

@@ -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)

View File

@@ -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()