[REPO REFACTOR]: changed to a better git repository structure with branches
This commit is contained in:
1
microservices/core/.gitignore
vendored
Normal file
1
microservices/core/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
/target/
|
||||
54
microservices/core/pom.xml
Normal file
54
microservices/core/pom.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>net.miarma.api</groupId>
|
||||
<artifactId>core</artifactId>
|
||||
<version>1.2.0</version>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>23</maven.compiler.source>
|
||||
<maven.compiler.target>23</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>MiarmaGit</id>
|
||||
<url>https://git.miarma.net/api/packages/Gallardo7761/maven</url>
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>net.miarma.api</groupId>
|
||||
<artifactId>backlib</artifactId>
|
||||
<version>1.2.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>ME-Core</finalName>
|
||||
<plugins>
|
||||
<!-- Maven Shade Plugin -->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.5.3</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||
<transformers>
|
||||
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||
<mainClass>net.miarma.api.microservices.core.verticles.CoreMainVerticle</mainClass>
|
||||
</transformer>
|
||||
</transformers>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.miarma.api.microservices.core.routing;
|
||||
|
||||
import io.vertx.core.Vertx;
|
||||
import io.vertx.ext.web.Router;
|
||||
import io.vertx.ext.web.handler.BodyHandler;
|
||||
import io.vertx.sqlclient.Pool;
|
||||
import net.miarma.api.backlib.Constants.CoreUserRole;
|
||||
import net.miarma.api.backlib.core.handlers.FileDataHandler;
|
||||
import net.miarma.api.backlib.core.handlers.UserDataHandler;
|
||||
import net.miarma.api.backlib.core.services.UserService;
|
||||
import net.miarma.api.microservices.core.routing.middlewares.CoreAuthGuard;
|
||||
|
||||
public class CoreDataRouter {
|
||||
public static void mount(Router router, Vertx vertx, Pool pool) {
|
||||
UserDataHandler hUserData = new UserDataHandler(pool);
|
||||
FileDataHandler hFileData = new FileDataHandler(pool);
|
||||
UserService userService = new UserService(pool);
|
||||
CoreAuthGuard authGuard = new CoreAuthGuard(userService);
|
||||
|
||||
router.route().handler(BodyHandler.create());
|
||||
|
||||
router.get(CoreEndpoints.USERS).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserData::getAll);
|
||||
router.get(CoreEndpoints.USER).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserData::getById);
|
||||
router.post(CoreEndpoints.USERS).handler(hUserData::create);
|
||||
router.put(CoreEndpoints.USER).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserData::update);
|
||||
router.delete(CoreEndpoints.USER).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserData::delete);
|
||||
|
||||
router.get(CoreEndpoints.FILES).handler(authGuard.check()).handler(hFileData::getAll);
|
||||
router.get(CoreEndpoints.FILE).handler(authGuard.check()).handler(hFileData::getById);
|
||||
router.post(CoreEndpoints.FILE_UPLOAD).handler(authGuard.check()).handler(hFileData::create);
|
||||
router.put(CoreEndpoints.FILE).handler(authGuard.check()).handler(hFileData::update);
|
||||
router.delete(CoreEndpoints.FILE).handler(authGuard.check()).handler(hFileData::delete);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package net.miarma.api.microservices.core.routing;
|
||||
|
||||
import net.miarma.api.backlib.Constants;
|
||||
|
||||
public class CoreEndpoints {
|
||||
|
||||
/*
|
||||
* RUTAS DE LA API DE DATOS
|
||||
* DE NEGOCIO DEL SSO
|
||||
*/
|
||||
|
||||
// Usuarios
|
||||
public static final String USERS = Constants.CORE_PREFIX + "/users"; // GET, POST, PUT, DELETE
|
||||
public static final String USER = Constants.CORE_PREFIX + "/users/:user_id"; // GET, PUT, DELETE
|
||||
public static final String USER_STATUS = Constants.CORE_PREFIX + "/users/:user_id/status"; // GET, PUT
|
||||
public static final String USER_ROLE = Constants.CORE_PREFIX + "/users/:user_id/role"; // GET, PUT
|
||||
public static final String USER_EXISTS = Constants.CORE_PREFIX + "/users/:user_id/exists"; // GET
|
||||
public static final String USER_AVATAR = Constants.CORE_PREFIX + "/users/:user_id/avatar"; // GET, PUT
|
||||
public static final String USER_INFO = Constants.CORE_PREFIX + "/users/me"; // GET
|
||||
|
||||
// Archivos
|
||||
public static final String FILES = Constants.CORE_PREFIX + "/files"; // GET, POST
|
||||
public static final String FILE = Constants.CORE_PREFIX + "/files/:file_id"; // GET, PUT, DELETE
|
||||
public static final String FILE_UPLOAD = Constants.CORE_PREFIX + "/files/upload"; // POST
|
||||
public static final String FILE_DOWNLOAD = Constants.CORE_PREFIX + "/files/:file_id/download"; // GET
|
||||
public static final String USER_FILES = Constants.CORE_PREFIX + "/files/myfiles"; // GET
|
||||
|
||||
/*
|
||||
* RUTAS DE LA API DE LOGICA
|
||||
* DE NEGOCIO DEL SSO
|
||||
*/
|
||||
public static final String LOGIN = Constants.AUTH_PREFIX + "/login"; // POST
|
||||
public static final String LOGIN_VALID = Constants.AUTH_PREFIX + "/login/validate"; // POST
|
||||
public static final String REGISTER = Constants.AUTH_PREFIX + "/register"; // POST
|
||||
public static final String CHANGE_PASSWORD = Constants.AUTH_PREFIX + "/change-password"; // POST
|
||||
public static final String VALIDATE_TOKEN = Constants.AUTH_PREFIX + "/validate-token"; // POST
|
||||
public static final String REFRESH_TOKEN = Constants.AUTH_PREFIX + "/refresh-token"; // POST
|
||||
public static final String SCREENSHOT = Constants.CORE_PREFIX + "/screenshot"; // GET
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package net.miarma.api.microservices.core.routing;
|
||||
|
||||
import io.vertx.core.Vertx;
|
||||
import io.vertx.ext.web.Router;
|
||||
import io.vertx.ext.web.handler.BodyHandler;
|
||||
import io.vertx.sqlclient.Pool;
|
||||
import net.miarma.api.backlib.Constants.CoreUserRole;
|
||||
import net.miarma.api.backlib.core.handlers.FileLogicHandler;
|
||||
import net.miarma.api.backlib.core.handlers.ScreenshotHandler;
|
||||
import net.miarma.api.backlib.core.handlers.UserLogicHandler;
|
||||
import net.miarma.api.backlib.core.services.UserService;
|
||||
import net.miarma.api.microservices.core.routing.middlewares.CoreAuthGuard;
|
||||
|
||||
public class CoreLogicRouter {
|
||||
public static void mount(Router router, Vertx vertx, Pool pool) {
|
||||
UserLogicHandler hUserLogic = new UserLogicHandler(vertx);
|
||||
FileLogicHandler hFileLogic = new FileLogicHandler(vertx);
|
||||
ScreenshotHandler hScreenshot = new ScreenshotHandler(vertx);
|
||||
UserService userService = new UserService(pool);
|
||||
CoreAuthGuard authGuard = new CoreAuthGuard(userService);
|
||||
|
||||
router.route().handler(BodyHandler.create());
|
||||
|
||||
router.post(CoreEndpoints.LOGIN).handler(hUserLogic::login);
|
||||
router.get(CoreEndpoints.USER_INFO).handler(authGuard.check()).handler(hUserLogic::getInfo);
|
||||
router.post(CoreEndpoints.REGISTER).handler(hUserLogic::register);
|
||||
router.post(CoreEndpoints.CHANGE_PASSWORD).handler(authGuard.check()).handler(hUserLogic::changePassword);
|
||||
router.post(CoreEndpoints.LOGIN_VALID).handler(hUserLogic::loginValidate);
|
||||
router.get(CoreEndpoints.VALIDATE_TOKEN).handler(hUserLogic::validateToken);
|
||||
router.get(CoreEndpoints.REFRESH_TOKEN).handler(hUserLogic::refreshToken);
|
||||
|
||||
router.get(CoreEndpoints.USER_EXISTS).handler(authGuard.check()).handler(hUserLogic::exists);
|
||||
router.get(CoreEndpoints.USER_STATUS).handler(authGuard.check()).handler(hUserLogic::getStatus);
|
||||
router.put(CoreEndpoints.USER_STATUS).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserLogic::updateStatus);
|
||||
router.get(CoreEndpoints.USER_ROLE).handler(authGuard.check()).handler(hUserLogic::getRole);
|
||||
router.put(CoreEndpoints.USER_ROLE).handler(authGuard.check(CoreUserRole.ADMIN)).handler(hUserLogic::updateRole);
|
||||
router.get(CoreEndpoints.USER_AVATAR).handler(authGuard.check()).handler(hUserLogic::getAvatar);
|
||||
|
||||
router.get(CoreEndpoints.FILE_DOWNLOAD).handler(authGuard.check()).handler(hFileLogic::downloadFile);
|
||||
router.get(CoreEndpoints.USER_FILES).handler(authGuard.check()).handler(hFileLogic::getUserFiles);
|
||||
|
||||
router.get(CoreEndpoints.SCREENSHOT).handler(hScreenshot::getScreenshot);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package net.miarma.api.microservices.core.routing.middlewares;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import io.vertx.ext.web.RoutingContext;
|
||||
import net.miarma.api.backlib.Constants.CoreUserRole;
|
||||
import net.miarma.api.backlib.middlewares.AbstractAuthGuard;
|
||||
import net.miarma.api.backlib.core.entities.UserEntity;
|
||||
import net.miarma.api.backlib.core.services.UserService;
|
||||
|
||||
public class CoreAuthGuard extends AbstractAuthGuard<UserEntity, CoreUserRole> {
|
||||
private final UserService userService;
|
||||
|
||||
public CoreAuthGuard(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CoreUserRole parseRole(String roleStr) {
|
||||
return CoreUserRole.valueOf(roleStr.toUpperCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void getUserEntity(int userId, RoutingContext ctx, Consumer<UserEntity> callback) {
|
||||
userService.getById(userId).onComplete(ar -> {
|
||||
if (ar.succeeded()) callback.accept(ar.result());
|
||||
else callback.accept(null);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean hasPermission(UserEntity user, CoreUserRole role) {
|
||||
return user.getGlobal_role() == CoreUserRole.ADMIN;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,197 @@
|
||||
package net.miarma.api.microservices.core.verticles;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.core.json.JsonObject;
|
||||
import io.vertx.ext.web.Router;
|
||||
import io.vertx.ext.web.handler.BodyHandler;
|
||||
import io.vertx.sqlclient.Pool;
|
||||
import net.miarma.api.backlib.ConfigManager;
|
||||
import net.miarma.api.backlib.Constants;
|
||||
import net.miarma.api.backlib.Constants.CoreUserGlobalStatus;
|
||||
import net.miarma.api.backlib.Constants.CoreUserRole;
|
||||
import net.miarma.api.backlib.core.entities.UserEntity;
|
||||
import net.miarma.api.backlib.core.services.FileService;
|
||||
import net.miarma.api.backlib.core.services.UserService;
|
||||
import net.miarma.api.backlib.db.DatabaseProvider;
|
||||
import net.miarma.api.backlib.util.EventBusUtil;
|
||||
import net.miarma.api.backlib.util.RouterUtil;
|
||||
import net.miarma.api.microservices.core.routing.CoreDataRouter;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class CoreDataVerticle extends AbstractVerticle {
|
||||
private ConfigManager configManager;
|
||||
private UserService userService;
|
||||
private FileService fileService;
|
||||
|
||||
@Override
|
||||
public void start(Promise<Void> startPromise) {
|
||||
configManager = ConfigManager.getInstance();
|
||||
Pool pool = DatabaseProvider.createPool(vertx, configManager);
|
||||
userService = new UserService(pool);
|
||||
fileService = new FileService(pool);
|
||||
Router router = Router.router(vertx);
|
||||
RouterUtil.attachLogger(router);
|
||||
CoreDataRouter.mount(router, vertx, pool);
|
||||
registerLogicVerticleConsumer();
|
||||
|
||||
vertx.createHttpServer()
|
||||
.requestHandler(router)
|
||||
.listen(configManager.getIntProperty("sso.data.port"), res -> {
|
||||
if (res.succeeded()) startPromise.complete();
|
||||
else startPromise.fail(res.cause());
|
||||
});
|
||||
}
|
||||
|
||||
private void registerLogicVerticleConsumer() {
|
||||
vertx.eventBus().consumer(Constants.AUTH_EVENT_BUS, message -> {
|
||||
JsonObject body = (JsonObject) message.body();
|
||||
String action = body.getString("action");
|
||||
|
||||
switch (action) {
|
||||
case "login" -> {
|
||||
String email = body.getString("email");
|
||||
String userName = body.getString("userName");
|
||||
String password = body.getString("password");
|
||||
boolean keepLoggedIn = body.getBoolean("keepLoggedIn", false);
|
||||
|
||||
userService.login(email != null ? email : userName, password, keepLoggedIn)
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "register" -> {
|
||||
UserEntity user = new UserEntity();
|
||||
user.setUser_name(body.getString("userName"));
|
||||
user.setEmail(body.getString("email"));
|
||||
user.setDisplay_name(body.getString("displayName"));
|
||||
user.setPassword(body.getString("password"));
|
||||
|
||||
userService.register(user)
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "changePassword" -> {
|
||||
Integer userId = body.getInteger("userId");
|
||||
String newPassword = body.getString("newPassword");
|
||||
|
||||
userService.changePassword(userId, newPassword)
|
||||
.onSuccess(user -> {
|
||||
String userJson = Constants.GSON.toJson(user);
|
||||
message.reply(new JsonObject(userJson));
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "validateToken" -> {
|
||||
String token = body.getString("token");
|
||||
|
||||
userService.validateToken(token)
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "getInfo", "getById" -> {
|
||||
Integer userId = body.getInteger("userId");
|
||||
|
||||
userService.getById(userId)
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "userExists" -> {
|
||||
Integer userId = body.getInteger("userId");
|
||||
|
||||
userService.getById(userId)
|
||||
.onSuccess(user -> {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("user_id", userId);
|
||||
result.put("exists", user != null);
|
||||
message.reply(result);
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
case "getByEmail" -> userService.getByEmail(body.getString("email"))
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getByUserName" -> userService.getByUserName(body.getString("userName"))
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getStatus" -> userService.getById(body.getInteger("userId"))
|
||||
.onSuccess(user -> {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("user_id", user.getUser_id());
|
||||
result.put("status", user.getGlobal_status());
|
||||
message.reply(result);
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getRole" -> userService.getById(body.getInteger("userId"))
|
||||
.onSuccess(user -> {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("user_id", user.getUser_id());
|
||||
result.put("role", user.getGlobal_role());
|
||||
message.reply(result);
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getAvatar" -> userService.getById(body.getInteger("userId"))
|
||||
.onSuccess(user -> {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
result.put("user_id", user.getUser_id());
|
||||
result.put("avatar", user.getAvatar());
|
||||
message.reply(result);
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "updateStatus" -> userService.updateStatus(
|
||||
body.getInteger("userId"),
|
||||
CoreUserGlobalStatus.fromInt(body.getInteger("status")))
|
||||
.onSuccess(res -> message.reply("Status updated successfully"))
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "updateRole" -> userService.updateRole(
|
||||
body.getInteger("userId"),
|
||||
CoreUserRole.fromInt(body.getInteger("role")))
|
||||
.onSuccess(res -> message.reply("Role updated successfully"))
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getUserFiles" -> fileService.getUserFiles(body.getInteger("userId"))
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "downloadFile" -> fileService.downloadFile(body.getInteger("fileId"))
|
||||
.onSuccess(message::reply)
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "getUserById" -> userService.getById(body.getInteger("userId"))
|
||||
.onSuccess(user -> {
|
||||
String userJson = Constants.GSON.toJson(user);
|
||||
message.reply(new JsonObject(userJson));
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
|
||||
case "loginValidate" -> {
|
||||
Integer userId = body.getInteger("userId");
|
||||
String password = body.getString("password");
|
||||
|
||||
userService.loginValidate(userId, password)
|
||||
.onSuccess(user -> {
|
||||
String userJson = Constants.GSON.toJson(user);
|
||||
message.reply(new JsonObject(userJson));
|
||||
})
|
||||
.onFailure(EventBusUtil.fail(message));
|
||||
}
|
||||
|
||||
default -> EventBusUtil.fail(message);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package net.miarma.api.microservices.core.verticles;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.ext.web.Router;
|
||||
import io.vertx.ext.web.handler.BodyHandler;
|
||||
import io.vertx.sqlclient.Pool;
|
||||
import net.miarma.api.backlib.ConfigManager;
|
||||
import net.miarma.api.backlib.db.DatabaseProvider;
|
||||
import net.miarma.api.backlib.util.RouterUtil;
|
||||
import net.miarma.api.microservices.core.routing.CoreLogicRouter;
|
||||
|
||||
public class CoreLogicVerticle extends AbstractVerticle {
|
||||
ConfigManager configManager;
|
||||
|
||||
@Override
|
||||
public void start(Promise<Void> startPromise) {
|
||||
configManager = ConfigManager.getInstance();
|
||||
Pool pool = DatabaseProvider.createPool(vertx, configManager);
|
||||
Router router = Router.router(vertx);
|
||||
RouterUtil.attachLogger(router);
|
||||
CoreLogicRouter.mount(router, vertx, pool);
|
||||
|
||||
|
||||
vertx.createHttpServer()
|
||||
.requestHandler(router)
|
||||
.listen(configManager.getIntProperty("sso.logic.port"), res -> {
|
||||
if (res.succeeded()) startPromise.complete();
|
||||
else startPromise.fail(res.cause());
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package net.miarma.api.microservices.core.verticles;
|
||||
|
||||
import io.vertx.core.AbstractVerticle;
|
||||
import io.vertx.core.DeploymentOptions;
|
||||
import io.vertx.core.Promise;
|
||||
import io.vertx.core.ThreadingModel;
|
||||
import net.miarma.api.backlib.ConfigManager;
|
||||
import net.miarma.api.backlib.Constants;
|
||||
import net.miarma.api.backlib.LogAccumulator;
|
||||
import net.miarma.api.backlib.util.DeploymentUtil;
|
||||
|
||||
public class CoreMainVerticle extends AbstractVerticle {
|
||||
|
||||
private ConfigManager configManager;
|
||||
|
||||
@Override
|
||||
public void start(Promise<Void> startPromise) {
|
||||
try {
|
||||
this.configManager = ConfigManager.getInstance();
|
||||
deployVerticles();
|
||||
startPromise.complete();
|
||||
} catch (Exception e) {
|
||||
Constants.LOGGER.error(DeploymentUtil.failMessage(CoreMainVerticle.class, e));
|
||||
startPromise.fail(e);
|
||||
}
|
||||
}
|
||||
|
||||
private void deployVerticles() {
|
||||
final DeploymentOptions options = new DeploymentOptions()
|
||||
.setThreadingModel(ThreadingModel.WORKER);
|
||||
|
||||
vertx.deployVerticle(new CoreDataVerticle(), options, result -> {
|
||||
if (result.succeeded()) {
|
||||
String message = String.join("\n\r ",
|
||||
DeploymentUtil.successMessage(CoreDataVerticle.class),
|
||||
DeploymentUtil.apiUrlMessage(
|
||||
configManager.getHost(),
|
||||
configManager.getIntProperty("sso.data.port")
|
||||
)
|
||||
);
|
||||
LogAccumulator.add(message);
|
||||
} else {
|
||||
LogAccumulator.add(DeploymentUtil.failMessage(CoreDataVerticle.class, result.cause()));
|
||||
}
|
||||
});
|
||||
|
||||
vertx.deployVerticle(new CoreLogicVerticle(), options, result -> {
|
||||
if (result.succeeded()) {
|
||||
String message = String.join("\n\r ",
|
||||
DeploymentUtil.successMessage(CoreLogicVerticle.class),
|
||||
DeploymentUtil.apiUrlMessage(
|
||||
configManager.getHost(),
|
||||
configManager.getIntProperty("sso.logic.port")
|
||||
)
|
||||
);
|
||||
LogAccumulator.add(message);
|
||||
} else {
|
||||
LogAccumulator.add(DeploymentUtil.failMessage(CoreLogicVerticle.class, result.cause()));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user