Fixed errors in Business Logic API and finished it.
This commit is contained in:
@@ -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
|
||||
@@ -178,12 +182,6 @@ public class DataLayerAPIVerticle extends AbstractVerticle {
|
||||
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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user