From 7545495222fdb541f4d1da521fc91c44dd348532 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Fri, 1 Mar 2024 22:53:58 +0800 Subject: [PATCH] split core to other modules --- eventmesh-dashboard-common/pom.xml | 4 +++ .../common}/constant/ConfigConst.java | 2 +- .../common}/constant/NacosConst.java | 2 +- .../common}/dto/CreateTopicRequest.java | 2 +- .../common}/dto/DeleteTopicRequest.java | 2 +- .../dashboard/common}/dto/Result.java | 18 ++++++------- .../dashboard/common}/enums/Status.java | 4 +-- .../common}/exception/BaseException.java | 8 +++--- .../exception/EventMeshAdminException.java | 4 +-- .../common}/exception/EventMeshException.java | 2 +- .../exception/GlobalExceptionHandler.java | 9 ++++--- .../common}/exception/MetaException.java | 4 +-- .../common}/model/ConnectionInfo.java | 2 +- .../common}/model/SubscriptionInfo.java | 2 +- .../common}/model/TopicProperties.java | 2 +- .../dashboard/common}/util/ExceptionUtil.java | 2 +- eventmesh-dashboard-console/pom.xml | 9 ++++--- .../controller/ConnectionController.java | 4 +-- .../controller/MetricsController.java | 2 +- .../controller/SubscriptionController.java | 8 +++--- .../console}/controller/TopicController.java | 12 ++++----- .../connection/ConnectionController.java | 25 ------------------- eventmesh-dashboard-core/pom.xml | 17 +++++++++++++ .../core/config/AdminProperties.java | 2 +- .../dashboard/core/config/BeanTypeConfig.java | 8 +++--- .../service/meta/EtcdConnectionService.java | 2 +- .../service/meta/EtcdSubscriptionService.java | 6 ++--- .../service/meta/NacosConnectionService.java | 2 +- .../meta/NacosSubscriptionService.java | 24 +++++++++--------- .../service/store/RocketmqTopicService.java | 4 +-- .../eventmesh/dashboard/service/Main.java | 23 ----------------- .../service/meta}/ConnectionService.java | 2 +- .../service/meta}/SubscriptionService.java | 6 ++--- .../service/store}/TopicService.java | 4 +-- 34 files changed, 101 insertions(+), 128 deletions(-) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/constant/ConfigConst.java (96%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/constant/NacosConst.java (97%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/dto/CreateTopicRequest.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/dto/DeleteTopicRequest.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/dto/Result.java (89%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/enums/Status.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/exception/BaseException.java (85%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/exception/EventMeshAdminException.java (91%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/exception/EventMeshException.java (94%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/exception/GlobalExceptionHandler.java (87%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/exception/MetaException.java (91%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/model/ConnectionInfo.java (94%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/model/SubscriptionInfo.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/model/TopicProperties.java (96%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common}/util/ExceptionUtil.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/controller/ConnectionController.java (93%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/controller/MetricsController.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/controller/SubscriptionController.java (91%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/controller/TopicController.java (87%) delete mode 100644 eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java delete mode 100644 eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service => eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta}/ConnectionService.java (95%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service => eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta}/SubscriptionService.java (87%) rename {eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service => eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store}/TopicService.java (90%) diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 6b7da6b2..9c1e227b 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -24,6 +24,10 @@ org.projectlombok lombok + + com.fasterxml.jackson.core + jackson-annotations + org.apache.commons commons-lang3 diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java similarity index 96% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java index c58ab18e..f13a40ee 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/ConfigConst.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/ConfigConst.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.constant; +package org.apache.eventmesh.dashboard.common.constant; public class ConfigConst { diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java similarity index 97% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java index a03181db..b23a8d3d 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/constant/NacosConst.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/NacosConst.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.constant; +package org.apache.eventmesh.dashboard.common.constant; public class NacosConst { diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/CreateTopicRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/CreateTopicRequest.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java index 4a94be02..e3f8e55a 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/CreateTopicRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.dto; +package org.apache.eventmesh.dashboard.common.dto; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/DeleteTopicRequest.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/DeleteTopicRequest.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java index dea2d15e..d1e22de9 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/DeleteTopicRequest.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.dto; +package org.apache.eventmesh.dashboard.common.dto; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/Result.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java similarity index 89% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/Result.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java index b468318e..1ea4c520 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/dto/Result.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/Result.java @@ -15,12 +15,10 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.dto; +package org.apache.eventmesh.dashboard.common.dto; -import static org.apache.eventmesh.dashboard.core.enums.Status.SUCCESS; - -import org.apache.eventmesh.dashboard.core.enums.Status; -import org.apache.eventmesh.dashboard.core.exception.BaseException; +import org.apache.eventmesh.dashboard.common.enums.Status; +import org.apache.eventmesh.dashboard.common.exception.BaseException; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -59,16 +57,16 @@ public Result(T data, Integer pages) { * The request is valid and the result is wrapped in {@link Result}. */ public static Result success() { - return new Result<>(new StatusMessage(SUCCESS)); + return new Result<>(new StatusMessage(Status.SUCCESS)); } public static Result success(Result result) { - result.setMessage(new StatusMessage(SUCCESS)); + result.setMessage(new StatusMessage(Status.SUCCESS)); return result; } public static Result success(T data) { - return new Result<>(data, null, new StatusMessage(SUCCESS)); + return new Result<>(data, null, new StatusMessage(Status.SUCCESS)); } /** @@ -76,11 +74,11 @@ public static Result success(T data) { * Logic issues should use 422 Unprocessable Entity instead of 200 OK. */ public static ResponseEntity> ok() { - return ResponseEntity.ok(new Result<>(new StatusMessage(SUCCESS))); + return ResponseEntity.ok(new Result<>(new StatusMessage(Status.SUCCESS))); } public static ResponseEntity> ok(Result result) { - result.setMessage(new StatusMessage(SUCCESS)); + result.setMessage(new StatusMessage(Status.SUCCESS)); return ResponseEntity.ok(result); } diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/enums/Status.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/enums/Status.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java index da3cb0bb..c0a1e3b7 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/enums/Status.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.enums; +package org.apache.eventmesh.dashboard.common.enums; -import static org.apache.eventmesh.dashboard.core.constant.ConfigConst.COLON; +import static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON; import org.springframework.http.HttpStatus; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/BaseException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java similarity index 85% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/BaseException.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java index 3258f42d..c3364018 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/BaseException.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/BaseException.java @@ -15,12 +15,12 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.exception; +package org.apache.eventmesh.dashboard.common.exception; -import static org.apache.eventmesh.dashboard.core.constant.ConfigConst.COLON; +import static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON; -import org.apache.eventmesh.dashboard.core.enums.Status; -import org.apache.eventmesh.dashboard.core.util.ExceptionUtil; +import org.apache.eventmesh.dashboard.common.enums.Status; +import org.apache.eventmesh.dashboard.common.util.ExceptionUtil; import lombok.Getter; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshAdminException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java similarity index 91% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshAdminException.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java index 93607db7..f0ce811c 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshAdminException.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshAdminException.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.exception; +package org.apache.eventmesh.dashboard.common.exception; -import org.apache.eventmesh.dashboard.core.enums.Status; +import org.apache.eventmesh.dashboard.common.enums.Status; /** * EventMeshAdmin Application side exception diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java similarity index 94% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshException.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java index aadc45ae..444e5301 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/EventMeshException.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/EventMeshException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.exception; +package org.apache.eventmesh.dashboard.common.exception; /** * EventMesh Runtime side exception diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/GlobalExceptionHandler.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java similarity index 87% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/GlobalExceptionHandler.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java index 2bfba1c6..9d31eacd 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/GlobalExceptionHandler.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.exception; +package org.apache.eventmesh.dashboard.common.exception; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.dto.Result.StatusMessage; +import org.apache.eventmesh.dashboard.common.enums.Status; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.dto.Result.StatusMessage; import javax.servlet.http.HttpServletRequest; @@ -29,7 +30,7 @@ import lombok.extern.slf4j.Slf4j; /** - * This class, in conjunction with {@linkplain org.apache.eventmesh.dashboard.core.enums.Status Status} and {@link BaseException}, + * This class, in conjunction with {@linkplain Status Status} and {@link BaseException}, * collectively implements customized error reporting. */ diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/MetaException.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java similarity index 91% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/MetaException.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java index 734251ea..b479fc6d 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/exception/MetaException.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/MetaException.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.exception; +package org.apache.eventmesh.dashboard.common.exception; -import org.apache.eventmesh.dashboard.core.enums.Status; +import org.apache.eventmesh.dashboard.common.enums.Status; /** * Meta side exception with EventMeshAdmin Application diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/ConnectionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java similarity index 94% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/ConnectionInfo.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java index 9325b839..3934e8f6 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/ConnectionInfo.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/ConnectionInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.model; +package org.apache.eventmesh.dashboard.common.model; public class ConnectionInfo { diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/SubscriptionInfo.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/SubscriptionInfo.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java index 524d9f5b..6052d6c0 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/SubscriptionInfo.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/SubscriptionInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.model; +package org.apache.eventmesh.dashboard.common.model; import lombok.Builder; import lombok.Data; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/TopicProperties.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java similarity index 96% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/TopicProperties.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java index 7461bc42..49decb7c 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/model/TopicProperties.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/model/TopicProperties.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.model; +package org.apache.eventmesh.dashboard.common.model; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/util/ExceptionUtil.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/util/ExceptionUtil.java rename to eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java index f1a86358..a9bd0e08 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/util/ExceptionUtil.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/util/ExceptionUtil.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.util; +package org.apache.eventmesh.dashboard.common.util; public class ExceptionUtil { diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index ac0bc7cd..9f154be2 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -29,14 +29,15 @@ spring-boot-starter-test test - + + org.springframework spring-aspects 5.1.2.RELEASE - + org.springdoc springdoc-openapi-ui @@ -48,7 +49,7 @@ 1.7.0 - + org.apache.eventmesh.dashboard.common eventmesh-dashboard-common @@ -77,7 +78,7 @@ - + org.apache.eventmesh eventmesh-sdk-java diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java similarity index 93% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java index 34037d1d..cfd7e390 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/ConnectionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.controller; +package org.apache.eventmesh.dashboard.console.controller; -import org.apache.eventmesh.dashboard.core.service.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java index fbf7dcb9..38f5b1af 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/MetricsController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.controller; +package org.apache.eventmesh.dashboard.console.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java similarity index 91% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java index 3b48763a..c2b96a7c 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/SubscriptionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.controller; +package org.apache.eventmesh.dashboard.console.controller; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.model.SubscriptionInfo; -import org.apache.eventmesh.dashboard.core.service.SubscriptionService; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; import java.util.List; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java similarity index 87% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java index f95ffbbe..553215b5 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/controller/TopicController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java @@ -15,13 +15,13 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.controller; +package org.apache.eventmesh.dashboard.console.controller; -import org.apache.eventmesh.dashboard.core.dto.CreateTopicRequest; -import org.apache.eventmesh.dashboard.core.dto.DeleteTopicRequest; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.model.TopicProperties; -import org.apache.eventmesh.dashboard.core.service.TopicService; +import org.apache.eventmesh.dashboard.common.dto.CreateTopicRequest; +import org.apache.eventmesh.dashboard.common.dto.DeleteTopicRequest; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.model.TopicProperties; +import org.apache.eventmesh.dashboard.service.store.TopicService; import java.util.List; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java deleted file mode 100644 index 72d407ed..00000000 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/connection/ConnectionController.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.eventmesh.dashboard.console.controller.connection; - -import org.springframework.web.bind.annotation.RestController; - -@RestController -public class ConnectionController { - -} diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml index c8866524..fbe1ba17 100644 --- a/eventmesh-dashboard-core/pom.xml +++ b/eventmesh-dashboard-core/pom.xml @@ -40,11 +40,28 @@ + org.apache.eventmesh.dashboard.common eventmesh-dashboard-common 0.0.1-SNAPSHOT + + org.apache.eventmesh.dashboard.service + eventmesh-dashboard-service + 0.0.1-SNAPSHOT + + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java index b693d58f..5a2a6265 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/AdminProperties.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.core.config; -import org.apache.eventmesh.dashboard.core.constant.ConfigConst; +import org.apache.eventmesh.dashboard.common.constant.ConfigConst; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.stereotype.Component; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java index 2176a645..18a74be7 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java @@ -17,10 +17,10 @@ package org.apache.eventmesh.dashboard.core.config; -import org.apache.eventmesh.dashboard.core.constant.ConfigConst; -import org.apache.eventmesh.dashboard.core.service.ConnectionService; -import org.apache.eventmesh.dashboard.core.service.SubscriptionService; -import org.apache.eventmesh.dashboard.core.service.TopicService; +import org.apache.eventmesh.dashboard.common.constant.ConfigConst; +import org.apache.eventmesh.dashboard.service.meta.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; +import org.apache.eventmesh.dashboard.service.store.TopicService; import org.apache.eventmesh.dashboard.core.service.meta.EtcdConnectionService; import org.apache.eventmesh.dashboard.core.service.meta.EtcdSubscriptionService; import org.apache.eventmesh.dashboard.core.service.meta.NacosConnectionService; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdConnectionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdConnectionService.java index 3bad3a27..7828d845 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdConnectionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdConnectionService.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.core.service.meta; -import org.apache.eventmesh.dashboard.core.service.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionService; import org.springframework.stereotype.Service; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdSubscriptionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdSubscriptionService.java index 9b110483..cb408bf4 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdSubscriptionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdSubscriptionService.java @@ -17,9 +17,9 @@ package org.apache.eventmesh.dashboard.core.service.meta; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.model.SubscriptionInfo; -import org.apache.eventmesh.dashboard.core.service.SubscriptionService; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; import java.util.List; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosConnectionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosConnectionService.java index ef0219a5..5ffc82cd 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosConnectionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosConnectionService.java @@ -18,7 +18,7 @@ package org.apache.eventmesh.dashboard.core.service.meta; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.core.service.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionService; import org.springframework.stereotype.Service; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosSubscriptionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosSubscriptionService.java index 3122103d..41db2788 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosSubscriptionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosSubscriptionService.java @@ -17,20 +17,20 @@ package org.apache.eventmesh.dashboard.core.service.meta; -import static org.apache.eventmesh.dashboard.core.enums.Status.NACOS_EMPTY_RESP_ERR; -import static org.apache.eventmesh.dashboard.core.enums.Status.NACOS_GET_CONFIGS_ERR; -import static org.apache.eventmesh.dashboard.core.enums.Status.NACOS_LOGIN_EMPTY_RESP_ERR; -import static org.apache.eventmesh.dashboard.core.enums.Status.NACOS_LOGIN_ERR; -import static org.apache.eventmesh.dashboard.core.enums.Status.NACOS_SDK_CONFIG_ERR; +import static org.apache.eventmesh.dashboard.common.enums.Status.NACOS_EMPTY_RESP_ERR; +import static org.apache.eventmesh.dashboard.common.enums.Status.NACOS_GET_CONFIGS_ERR; +import static org.apache.eventmesh.dashboard.common.enums.Status.NACOS_LOGIN_EMPTY_RESP_ERR; +import static org.apache.eventmesh.dashboard.common.enums.Status.NACOS_LOGIN_ERR; +import static org.apache.eventmesh.dashboard.common.enums.Status.NACOS_SDK_CONFIG_ERR; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.core.constant.ConfigConst; -import org.apache.eventmesh.dashboard.core.constant.NacosConst; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.exception.EventMeshAdminException; -import org.apache.eventmesh.dashboard.core.exception.MetaException; -import org.apache.eventmesh.dashboard.core.model.SubscriptionInfo; -import org.apache.eventmesh.dashboard.core.service.SubscriptionService; +import org.apache.eventmesh.dashboard.common.constant.ConfigConst; +import org.apache.eventmesh.dashboard.common.constant.NacosConst; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.exception.EventMeshAdminException; +import org.apache.eventmesh.dashboard.common.exception.MetaException; +import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; import java.util.ArrayList; import java.util.Base64; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/store/RocketmqTopicService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/store/RocketmqTopicService.java index bc0b7bf3..fff59ee3 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/store/RocketmqTopicService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/store/RocketmqTopicService.java @@ -18,8 +18,8 @@ package org.apache.eventmesh.dashboard.core.service.store; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.core.model.TopicProperties; -import org.apache.eventmesh.dashboard.core.service.TopicService; +import org.apache.eventmesh.dashboard.common.model.TopicProperties; +import org.apache.eventmesh.dashboard.service.store.TopicService; import java.util.List; diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java deleted file mode 100644 index 926f48c5..00000000 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/Main.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.eventmesh.dashboard.service; - -public class Main { - public static void main(String[] args) { - } -} \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/ConnectionService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/ConnectionService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java index 106421cf..6fa0bdf7 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/ConnectionService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service; +package org.apache.eventmesh.dashboard.service.meta; /** * "Connection" refers to the subscription relationship between connectors. diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/SubscriptionService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java similarity index 87% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/SubscriptionService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java index 72b07cc6..bff44390 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/SubscriptionService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java @@ -15,10 +15,10 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service; +package org.apache.eventmesh.dashboard.service.meta; -import org.apache.eventmesh.dashboard.core.dto.Result; -import org.apache.eventmesh.dashboard.core.model.SubscriptionInfo; +import org.apache.eventmesh.dashboard.common.dto.Result; +import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; import java.util.List; diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/TopicService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java similarity index 90% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/TopicService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java index 980aed35..c68c9ae3 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/TopicService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service; +package org.apache.eventmesh.dashboard.service.store; -import org.apache.eventmesh.dashboard.core.model.TopicProperties; +import org.apache.eventmesh.dashboard.common.model.TopicProperties; import java.util.List;