up
This commit is contained in:
@@ -418,7 +418,7 @@ public class MainVerticle extends AbstractVerticle {
|
||||
.onFailure(err -> rc.response().setStatusCode(500).end(err.getMessage()));
|
||||
});
|
||||
|
||||
new IikoHandler(vertx, router, db, restaurantService);
|
||||
new IikoHandler(vertx, router, db, restaurantService, authHandler);
|
||||
|
||||
return router;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import io.vertx.sqlclient.Row;
|
||||
import io.vertx.sqlclient.Tuple;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import su.xserver.iikocon.handler.AdminHandler;
|
||||
import su.xserver.iikocon.handler.AuthHandler;
|
||||
import su.xserver.iikocon.service.DataBaseService;
|
||||
import su.xserver.iikocon.service.RestaurantService;
|
||||
|
||||
@@ -20,7 +22,7 @@ public class IikoHandler {
|
||||
private final Vertx vertx;
|
||||
private final RestaurantService restaurantService;
|
||||
|
||||
public IikoHandler(Vertx vertx, Router router, DataBaseService db, RestaurantService restaurantService) {
|
||||
public IikoHandler(Vertx vertx, Router router, DataBaseService db, RestaurantService restaurantService, AuthHandler authHandler) {
|
||||
this.vertx = vertx;
|
||||
this.restaurantService = restaurantService;
|
||||
this.db = db;
|
||||
@@ -29,9 +31,10 @@ public class IikoHandler {
|
||||
log.error("Failed to initialize database", err);
|
||||
});
|
||||
|
||||
router.route("/api/reports/olap/*").handler(authHandler::requireAuth);
|
||||
router.get("/api/reports/olap/columns").handler(this::getColumns);
|
||||
router.delete("/api/reports/olap/columns/:fieldKey").handler(this::deleteColumn);
|
||||
router.post("/api/reports/olap/initialize").handler(this::postInitialize);
|
||||
router.delete("/api/reports/olap/columns/:fieldKey").handler(AdminHandler::requireAdmin).handler(this::deleteColumn);
|
||||
router.post("/api/reports/olap/initialize").handler(AdminHandler::requireAdmin).handler(this::postInitialize);
|
||||
}
|
||||
|
||||
private void getColumns(RoutingContext ctx) {
|
||||
|
||||
Reference in New Issue
Block a user