This commit is contained in:
2026-05-04 13:22:25 +03:00
parent f39d9ff11e
commit a61c527ef9
36 changed files with 794 additions and 29 deletions

View File

@@ -38,6 +38,7 @@ public class MainVerticle extends AbstractVerticle {
private UserService userService;
private RestaurantService restaurantService;
private ExternalDataBaseService externalDataBaseService;
private SettingsService settingsService;
@Override
@@ -64,6 +65,7 @@ public class MainVerticle extends AbstractVerticle {
userService = new UserService(db.getPool());
restaurantService = new RestaurantService(db.getPool());
settingsService = new SettingsService(db.getPool());
externalDataBaseService = new ExternalDataBaseService(db.getPool(), vertx);
userService.initDatabase().onFailure(err -> {
log.error("Failed to initialize database", err);
@@ -77,6 +79,10 @@ public class MainVerticle extends AbstractVerticle {
log.error("Failed to initialize database", err);
startPromise.fail(err);
});
externalDataBaseService.initDatabase().onFailure(err -> {
log.error("Failed to initialize database", err);
startPromise.fail(err);
});
createRouterAndStartHttp(startPromise);
@@ -418,6 +424,8 @@ public class MainVerticle extends AbstractVerticle {
.onFailure(err -> rc.response().setStatusCode(500).end(err.getMessage()));
});
externalDataBaseService.handleRoute(router);
new IikoHandler(vertx, router, db, restaurantService, authHandler);
return router;