From 5ef2c32b8e591a94ed2f52cb4c1711e2acbafff6 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Fri, 1 Mar 2024 22:36:06 +0800 Subject: [PATCH 01/10] Setup common module dependencies --- eventmesh-dashboard-common/pom.xml | 20 +++- eventmesh-dashboard-core/pom.xml | 103 ------------------ .../core/EventMeshDashboardApplication.java | 32 ------ .../src/main/resources/application-dev.yml | 91 ++++++---------- .../src/main/resources/application.yml | 40 ------- eventmesh-dashboard-service/pom.xml | 13 ++- 6 files changed, 62 insertions(+), 237 deletions(-) delete mode 100644 eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java delete mode 100644 eventmesh-dashboard-core/src/main/resources/application.yml diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 52255b0a..6b7da6b2 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -16,14 +16,32 @@ 1.8 UTF-8 UTF-8 - 2.7.6 + org.projectlombok lombok + + org.apache.commons + commons-lang3 + 3.13.0 + + + com.alibaba.fastjson2 + fastjson2 + 2.0.40 + + + + + org.mockito + mockito-core + 5.5.0 + test + \ No newline at end of file diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml index 651cad83..c8866524 100644 --- a/eventmesh-dashboard-core/pom.xml +++ b/eventmesh-dashboard-core/pom.xml @@ -37,56 +37,14 @@ 1.8 UTF-8 UTF-8 - 2.7.6 - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-devtools - runtime - true - - - org.springframework.boot - spring-boot-configuration-processor - true - - - org.springframework.boot - spring-boot-starter-test - test - - - org.apache.eventmesh.dashboard.common eventmesh-dashboard-common 0.0.1-SNAPSHOT - - org.apache.commons - commons-lang3 - 3.13.0 - - - com.alibaba.fastjson2 - fastjson2 - 2.0.40 - - - - - org.mockito - mockito-core - 5.5.0 - test - @@ -101,66 +59,5 @@ rocketmq-client 4.9.7 - - - - com.alibaba - druid-spring-boot-starter - 1.2.21 - - - com.baomidou - mybatis-plus-boot-starter - 3.5.5 - - - com.mysql - mysql-connector-j - runtime - - - - - - org.springframework.boot - spring-boot-dependencies - ${spring-boot.version} - pom - import - - - - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.1 - - 1.8 - 1.8 - UTF-8 - - - - org.springframework.boot - spring-boot-maven-plugin - ${spring-boot.version} - - org.apache.eventmesh.dashboard.core.EventMeshDashboardApplication - true - - - - repackage - - repackage - - - - - - \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java deleted file mode 100644 index 7caeddb7..00000000 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplication.java +++ /dev/null @@ -1,32 +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.core; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.web.servlet.ServletComponentScan; - -@ServletComponentScan // Druid Monitor -@SpringBootApplication -public class EventMeshDashboardApplication { - - public static void main(String[] args) { - SpringApplication.run(EventMeshDashboardApplication.class, args); - } - -} diff --git a/eventmesh-dashboard-core/src/main/resources/application-dev.yml b/eventmesh-dashboard-core/src/main/resources/application-dev.yml index f61a3c39..b3c870aa 100644 --- a/eventmesh-dashboard-core/src/main/resources/application-dev.yml +++ b/eventmesh-dashboard-core/src/main/resources/application-dev.yml @@ -14,62 +14,37 @@ # See the License for the specific language governing permissions and # limitations under the License. # -spring: - datasource: - type: com.alibaba.druid.pool.DruidDataSource - druid: - driver-class-name: com.mysql.cj.jdbc.Driver - url: jdbc:mysql://localhost:3306/eventmesh-dashboard?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8 - username: root - password: root - initial-size: 1 - max-active: 50 - min-idle: 5 - max-wait: 6000 - validation-query: select 'x' - validation-query-timeout: 15 - test-on-borrow: false - test-while-idle: true - min-evictable-idle-time-millis: 300000 - - stat-view-servlet: - enabled: true - url-pattern: /druid/* - filter: - wall: - config: - multi-statement-allow: true # corresponds to allowMultiQueries - -eventmesh: - meta: - # registry type: nacos, etcd - type: nacos - nacos: - addr: 127.0.0.1:8848 - namespace: # namespace id, empty by default - authEnabled: false - protocol: http # http or https - username: - password: - # Alibaba Cloud MSE Nacos auth, not nacos.token.secret.key - accessKey: - secretKey: - etcd: - addr: # TODO - # timeout for admin client - timeoutMs: 5000 - store: - # Event Store type, should be consistent with the EventMesh Runtime configuration. - type: rocketmq - standalone: - # TODO - rocketmq: - namesrvAddr: 127.0.0.1:9876;127.0.0.1:9876 - clusterName: DefaultCluster - accessKey: '********' - secretKey: '********' - kafka: - namesrvAddr: localhost:9092;localhost:9092 - partitions: 1 - replicationFactors: 1 \ No newline at end of file +# eventmesh cluster configs are stored in DB and below is a example which can be deleted after config mgmt completed +#eventmesh: +# meta: +# # registry type: nacos, etcd +# type: nacos +# nacos: +# addr: 127.0.0.1:8848 +# namespace: # namespace id, empty by default +# authEnabled: false +# protocol: http # http or https +# username: +# password: +# # Alibaba Cloud MSE Nacos auth, not nacos.token.secret.key +# accessKey: +# secretKey: +# etcd: +# addr: # TODO +# # timeout for admin client +# timeoutMs: 5000 +# store: +# # Event Store type, should be consistent with the EventMesh Runtime configuration. +# type: rocketmq +# standalone: +# # TODO +# rocketmq: +# namesrvAddr: 127.0.0.1:9876;127.0.0.1:9876 +# clusterName: DefaultCluster +# accessKey: '********' +# secretKey: '********' +# kafka: +# namesrvAddr: localhost:9092;localhost:9092 +# partitions: 1 +# replicationFactors: 1 \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/resources/application.yml b/eventmesh-dashboard-core/src/main/resources/application.yml deleted file mode 100644 index 434cf55a..00000000 --- a/eventmesh-dashboard-core/src/main/resources/application.yml +++ /dev/null @@ -1,40 +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. -# -spring: - application: - name: eventmesh-dashboard - profiles: - active: dev - -server: - port: 8080 - servlet: - encoding: - charset: UTF-8 - enabled: true - force: true - -logging: - config: classpath:logback.xml - -mybatis-plus: - mapper-locations: classpath*:mappers/**/*.xml # Default value - typeAliasesPackage: org.apache.eventmesh.dashboard.entity - configuration: - call-setters-on-nulls: true # Display fields with null values in query results - map-underscore-to-camel-case: true # Convert database underscore naming convention to camel case (default is true) -# log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # Output SQL execution logs to console (for debugging) \ No newline at end of file diff --git a/eventmesh-dashboard-service/pom.xml b/eventmesh-dashboard-service/pom.xml index f445adaf..e64ecb58 100644 --- a/eventmesh-dashboard-service/pom.xml +++ b/eventmesh-dashboard-service/pom.xml @@ -8,14 +8,21 @@ eventmesh-dashboard 0.0.1-SNAPSHOT - org.apache.eventmesh.dashboard.service eventmesh-dashboard-service + 0.0.1-SNAPSHOT + eventmesh-dashboard-core - 8 - 8 + 1.8 UTF-8 + + + org.apache.eventmesh.dashboard.common + eventmesh-dashboard-common + 0.0.1-SNAPSHOT + + \ No newline at end of file From 7545495222fdb541f4d1da521fc91c44dd348532 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Fri, 1 Mar 2024 22:53:58 +0800 Subject: [PATCH 02/10] 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; From 21eca5fb93cc4d9d42f2fe4cc2765d98396ba612 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 00:08:06 +0800 Subject: [PATCH 03/10] move springboot dependencies to common module --- eventmesh-dashboard-common/pom.xml | 11 ++++ eventmesh-dashboard-console/pom.xml | 11 ---- .../exception/GlobalExceptionHandler.java | 5 +- .../src/main/resources/logback.xml | 50 ------------------- eventmesh-dashboard-core/pom.xml | 11 ---- .../core/config/AdminProperties.java | 5 ++ .../dashboard/core/config/BeanTypeConfig.java | 8 +-- .../meta/NacosSubscriptionService.java | 2 +- .../service/store/RocketmqTopicService.java | 2 +- .../src/main/resources/logback.xml | 50 ------------------- 10 files changed, 26 insertions(+), 129 deletions(-) rename {eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/exception/GlobalExceptionHandler.java (95%) delete mode 100644 eventmesh-dashboard-console/src/main/resources/logback.xml delete mode 100644 eventmesh-dashboard-core/src/main/resources/logback.xml diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 9c1e227b..bb686e9a 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -19,6 +19,17 @@ + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-test + test + + org.projectlombok diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index 9f154be2..d059fcb4 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -19,17 +19,6 @@ - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - org.springframework diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/exception/GlobalExceptionHandler.java similarity index 95% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/exception/GlobalExceptionHandler.java index 9d31eacd..891255d6 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/exception/GlobalExceptionHandler.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/exception/GlobalExceptionHandler.java @@ -15,11 +15,12 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.exception; +package org.apache.eventmesh.dashboard.console.exception; -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 org.apache.eventmesh.dashboard.common.enums.Status; +import org.apache.eventmesh.dashboard.common.exception.BaseException; import javax.servlet.http.HttpServletRequest; diff --git a/eventmesh-dashboard-console/src/main/resources/logback.xml b/eventmesh-dashboard-console/src/main/resources/logback.xml deleted file mode 100644 index c9925d33..00000000 --- a/eventmesh-dashboard-console/src/main/resources/logback.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n - - - - - ${user.home}/logs/eventmesh-dashboard.log - true - - ${user.home}/logs/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log - - - 104857600 - - 10 - - - [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n - UTF-8 - - - - - - - - - \ No newline at end of file diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml index fbe1ba17..61d9a01d 100644 --- a/eventmesh-dashboard-core/pom.xml +++ b/eventmesh-dashboard-core/pom.xml @@ -52,17 +52,6 @@ 0.0.1-SNAPSHOT - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.boot - spring-boot-starter-test - test - - com.alibaba.nacos 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 5a2a6265..127d2e3c 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 @@ -24,6 +24,11 @@ import lombok.Data; +/** + * TODO get configs from DB (console module's work) + */ + +@Deprecated @Data @Component @ConfigurationProperties(prefix = ConfigConst.ADMIN_PROPS_PREFIX) 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 18a74be7..92266b6f 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 @@ -18,14 +18,14 @@ package org.apache.eventmesh.dashboard.core.config; 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; import org.apache.eventmesh.dashboard.core.service.meta.NacosSubscriptionService; import org.apache.eventmesh.dashboard.core.service.store.RocketmqTopicService; +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.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -33,7 +33,9 @@ /** * Use different registry SDK depending on the configured meta type; * Use different storage SDK depending on the configured storage type. + * TODO get configs from DB (console module's work) */ +@Deprecated @Configuration public class BeanTypeConfig { 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 41db2788..4d385cd3 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 @@ -23,13 +23,13 @@ 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.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.core.config.AdminProperties; import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; import java.util.ArrayList; 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 fff59ee3..57b4ade5 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 @@ -17,8 +17,8 @@ package org.apache.eventmesh.dashboard.core.service.store; -import org.apache.eventmesh.dashboard.core.config.AdminProperties; import org.apache.eventmesh.dashboard.common.model.TopicProperties; +import org.apache.eventmesh.dashboard.core.config.AdminProperties; import org.apache.eventmesh.dashboard.service.store.TopicService; import java.util.List; diff --git a/eventmesh-dashboard-core/src/main/resources/logback.xml b/eventmesh-dashboard-core/src/main/resources/logback.xml deleted file mode 100644 index 447ace7c..00000000 --- a/eventmesh-dashboard-core/src/main/resources/logback.xml +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n - - - - - ${user.home}/logs/eventmesh-dashboard.log - true - - ${user.home}/logs/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log - - - 104857600 - - 10 - - - [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n - UTF-8 - - - - - - - - - \ No newline at end of file From 22182eb60776a28b8d93d7d31f0326e1f4d590ac Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 00:15:48 +0800 Subject: [PATCH 04/10] move Request classes to console module --- .../dashboard/common/enums/Status.java | 2 +- .../console/controller/TopicController.java | 4 +-- .../console}/dto/CreateTopicRequest.java | 6 +++- .../console}/dto/DeleteTopicRequest.java | 6 +++- .../console/service/group/GroupService.java | 1 - .../console/health/HealthExecutorTest.java | 4 ++- .../console/health/HealthServiceTest.java | 1 + .../check/impl/StorageRedisCheckTest.java | 3 +- .../health/HealthServiceIntegrateTest.java | 4 ++- .../connection/ConnectionMapperTest.java | 1 - .../health/HealthCheckResultMapperTest.java | 6 ++-- .../console/mapper/meta/MetaMapperTest.java | 1 + .../console/unit/group/TestGroupMapper.java | 1 - .../dashboard/core/config/BeanTypeConfig.java | 10 +++---- .../meta/EtcdConnectionService.java | 2 +- .../meta/EtcdSubscriptionService.java | 2 +- .../meta/NacosConnectionService.java | 2 +- .../meta/NacosSubscriptionService.java | 2 +- .../store/RocketmqTopicService.java | 2 +- .../EventMeshDashboardApplicationTest.java | 29 ------------------- 20 files changed, 37 insertions(+), 52 deletions(-) rename {eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/dto/CreateTopicRequest.java (90%) rename {eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common => eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console}/dto/DeleteTopicRequest.java (90%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/{service => }/meta/EtcdConnectionService.java (94%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/{service => }/meta/EtcdSubscriptionService.java (96%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/{service => }/meta/NacosConnectionService.java (95%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/{service => }/meta/NacosSubscriptionService.java (99%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/{service => }/store/RocketmqTopicService.java (96%) delete mode 100644 eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java index c0a1e3b7..4a6036f5 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/Status.java @@ -74,7 +74,7 @@ public enum Category { SUCCESS("Successfully received and processed"), - SDK_CONFIG_ERR("The Meta SDK config in EventMeshAdmin application.yml error"), + SDK_CONFIG_ERR("Meta SDK config error"), META_COM_ERR("Network communication to Meta error"), ; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java index 553215b5..61108616 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java @@ -17,10 +17,10 @@ package org.apache.eventmesh.dashboard.console.controller; -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.console.dto.CreateTopicRequest; +import org.apache.eventmesh.dashboard.console.dto.DeleteTopicRequest; import org.apache.eventmesh.dashboard.service.store.TopicService; import java.util.List; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.java similarity index 90% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.java index e3f8e55a..c84cee47 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/CreateTopicRequest.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.java @@ -15,13 +15,17 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.dto; +package org.apache.eventmesh.dashboard.console.dto; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +/** + * TODO this class is copied from storage plugin, needs update + */ + @Data public class CreateTopicRequest { diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.java similarity index 90% rename from eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.java index d1e22de9..da793b32 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/dto/DeleteTopicRequest.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.java @@ -15,13 +15,17 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.common.dto; +package org.apache.eventmesh.dashboard.console.dto; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import lombok.Data; +/** + * TODO this class is copied from storage plugin, needs update + */ + @Data public class DeleteTopicRequest { diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/group/GroupService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/group/GroupService.java index e5a80c56..2afda6e9 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/group/GroupService.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/group/GroupService.java @@ -20,7 +20,6 @@ import org.apache.eventmesh.dashboard.console.entity.group.GroupEntity; import org.apache.eventmesh.dashboard.console.entity.groupmember.GroupMemberEntity; - import java.util.List; /** diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthExecutorTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthExecutorTest.java index 2c5e49c8..d7626ed6 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthExecutorTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthExecutorTest.java @@ -22,7 +22,6 @@ import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.ArgumentMatchers.any; -import java.util.concurrent.CompletableFuture; import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckStatus; @@ -31,6 +30,9 @@ import org.apache.eventmesh.dashboard.console.health.check.AbstractHealthCheckService; import org.apache.eventmesh.dashboard.console.health.check.config.HealthCheckObjectConfig; import org.apache.eventmesh.dashboard.console.service.health.impl.HealthDataServiceDatabaseImpl; + +import java.util.concurrent.CompletableFuture; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthServiceTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthServiceTest.java index 06343fd8..9a2c3939 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthServiceTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/HealthServiceTest.java @@ -21,6 +21,7 @@ import org.apache.eventmesh.dashboard.console.health.check.AbstractHealthCheckService; import org.apache.eventmesh.dashboard.console.health.check.config.HealthCheckObjectConfig; import org.apache.eventmesh.dashboard.console.service.health.HealthDataService; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/check/impl/StorageRedisCheckTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/check/impl/StorageRedisCheckTest.java index d7c5a585..74ac54cb 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/check/impl/StorageRedisCheckTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/health/check/impl/StorageRedisCheckTest.java @@ -17,8 +17,9 @@ package org.apache.eventmesh.dashboard.console.health.check.impl; -import org.apache.eventmesh.dashboard.console.health.check.config.HealthCheckObjectConfig; import org.apache.eventmesh.dashboard.console.health.callback.HealthCheckCallback; +import org.apache.eventmesh.dashboard.console.health.check.config.HealthCheckObjectConfig; + import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java index 7afb52f0..e8fdb5ff 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/integration/health/HealthServiceIntegrateTest.java @@ -17,13 +17,15 @@ package org.apache.eventmesh.dashboard.console.integration.health; -import java.util.List; import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; import org.apache.eventmesh.dashboard.console.enums.health.HealthCheckType; import org.apache.eventmesh.dashboard.console.health.CheckResultCache; import org.apache.eventmesh.dashboard.console.health.HealthService; import org.apache.eventmesh.dashboard.console.health.check.config.HealthCheckObjectConfig; import org.apache.eventmesh.dashboard.console.service.health.HealthDataService; + +import java.util.List; + import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapperTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapperTest.java index 7087e007..4f282297 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapperTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/connection/ConnectionMapperTest.java @@ -24,7 +24,6 @@ import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.connection.ConnectionEntity; - import java.util.Arrays; import java.util.List; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/health/HealthCheckResultMapperTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/health/HealthCheckResultMapperTest.java index d91cd229..1ceb8fce 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/health/HealthCheckResultMapperTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/health/HealthCheckResultMapperTest.java @@ -19,14 +19,16 @@ import static org.junit.jupiter.api.Assertions.*; +import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; +import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; + import java.sql.Timestamp; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.Date; import java.util.List; -import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; -import org.apache.eventmesh.dashboard.console.entity.health.HealthCheckResultEntity; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapperTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapperTest.java index 42e58f46..9d05b401 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapperTest.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/mapper/meta/MetaMapperTest.java @@ -19,6 +19,7 @@ import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; import org.apache.eventmesh.dashboard.console.entity.meta.MetaEntity; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/unit/group/TestGroupMapper.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/unit/group/TestGroupMapper.java index f247c3fb..f02fcafc 100644 --- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/unit/group/TestGroupMapper.java +++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/unit/group/TestGroupMapper.java @@ -1,7 +1,6 @@ package org.apache.eventmesh.dashboard.console.unit.group; import org.apache.eventmesh.dashboard.console.EventMeshDashboardApplication; - import org.apache.eventmesh.dashboard.console.entity.group.GroupEntity; import org.apache.eventmesh.dashboard.console.mapper.group.OprGroupMapper; 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 92266b6f..44d376ad 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 @@ -18,11 +18,11 @@ package org.apache.eventmesh.dashboard.core.config; import org.apache.eventmesh.dashboard.common.constant.ConfigConst; -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; -import org.apache.eventmesh.dashboard.core.service.meta.NacosSubscriptionService; -import org.apache.eventmesh.dashboard.core.service.store.RocketmqTopicService; +import org.apache.eventmesh.dashboard.core.meta.EtcdConnectionService; +import org.apache.eventmesh.dashboard.core.meta.EtcdSubscriptionService; +import org.apache.eventmesh.dashboard.core.meta.NacosConnectionService; +import org.apache.eventmesh.dashboard.core.meta.NacosSubscriptionService; +import org.apache.eventmesh.dashboard.core.store.RocketmqTopicService; import org.apache.eventmesh.dashboard.service.meta.ConnectionService; import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; import org.apache.eventmesh.dashboard.service.store.TopicService; 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/meta/EtcdConnectionService.java similarity index 94% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdConnectionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionService.java index 7828d845..76a77521 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/meta/EtcdConnectionService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service.meta; +package org.apache.eventmesh.dashboard.core.meta; import org.apache.eventmesh.dashboard.service.meta.ConnectionService; 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/meta/EtcdSubscriptionService.java similarity index 96% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/EtcdSubscriptionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionService.java index cb408bf4..0db282b3 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/meta/EtcdSubscriptionService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service.meta; +package org.apache.eventmesh.dashboard.core.meta; import org.apache.eventmesh.dashboard.common.dto.Result; import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; 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/meta/NacosConnectionService.java similarity index 95% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosConnectionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionService.java index 5ffc82cd..ef1f26fe 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/meta/NacosConnectionService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service.meta; +package org.apache.eventmesh.dashboard.core.meta; import org.apache.eventmesh.dashboard.core.config.AdminProperties; import org.apache.eventmesh.dashboard.service.meta.ConnectionService; 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/meta/NacosSubscriptionService.java similarity index 99% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/meta/NacosSubscriptionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionService.java index 4d385cd3..8c2349d8 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/meta/NacosSubscriptionService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service.meta; +package org.apache.eventmesh.dashboard.core.meta; 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; 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/store/RocketmqTopicService.java similarity index 96% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/service/store/RocketmqTopicService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicService.java index 57b4ade5..bd5c5d1b 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/store/RocketmqTopicService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.service.store; +package org.apache.eventmesh.dashboard.core.store; import org.apache.eventmesh.dashboard.common.model.TopicProperties; import org.apache.eventmesh.dashboard.core.config.AdminProperties; diff --git a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java b/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java deleted file mode 100644 index cde38a47..00000000 --- a/eventmesh-dashboard-core/src/test/java/org/apache/eventmesh/dashboard/core/EventMeshDashboardApplicationTest.java +++ /dev/null @@ -1,29 +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.core; - -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class EventMeshDashboardApplicationTest { - -// @Test -// void contextLoads() { -// } - -} From 14be41dbe24dd83aef2f7fb74bab84ffe2566c18 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 00:38:24 +0800 Subject: [PATCH 05/10] Add not passed test scope artifact --- eventmesh-dashboard-common/pom.xml | 12 ++---------- eventmesh-dashboard-console/pom.xml | 6 ++++++ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index bb686e9a..6fc3e3bf 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -19,7 +19,7 @@ - + org.springframework.boot spring-boot-starter-web @@ -30,7 +30,7 @@ test - + org.projectlombok lombok @@ -49,14 +49,6 @@ fastjson2 2.0.40 - - - - org.mockito - mockito-core - 5.5.0 - test - \ No newline at end of file diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index d059fcb4..0ffc18d9 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -90,6 +90,12 @@ + + + org.springframework.boot + spring-boot-starter-test + test + From 2bd0807831a4b54b3351973d6ee589fb450af87f Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 00:49:36 +0800 Subject: [PATCH 06/10] recover logback.xml --- .../src/main/resources/logback.xml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 eventmesh-dashboard-console/src/main/resources/logback.xml diff --git a/eventmesh-dashboard-console/src/main/resources/logback.xml b/eventmesh-dashboard-console/src/main/resources/logback.xml new file mode 100644 index 00000000..c9925d33 --- /dev/null +++ b/eventmesh-dashboard-console/src/main/resources/logback.xml @@ -0,0 +1,50 @@ + + + + + + + [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n + + + + + ${user.home}/logs/eventmesh-dashboard.log + true + + ${user.home}/logs/eventmesh-dashboard-%d{yyyy-MM-dd}.%i.log + + + 104857600 + + 10 + + + [%d{yyyy-MM-dd HH:mm:ss.SSS}] %p %t - %m%n + UTF-8 + + + + + + + + + \ No newline at end of file From e99e9039873bdfcf9bfa4326df26f65a3352766a Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 01:28:59 +0800 Subject: [PATCH 07/10] console must scan&depend core to use @autowired --- eventmesh-dashboard-console/pom.xml | 30 +++++++++-------- .../EventMeshDashboardApplication.java | 4 +-- .../controller/ConnectionController.java | 4 +-- .../controller/SubscriptionController.java | 8 ++--- .../console/controller/TopicController.java | 10 +++--- .../src/main/resources/application-dev.yml | 4 +-- .../dashboard/core/config/BeanTypeConfig.java | 32 +++++++++---------- ...onService.java => EtcdConnectionCore.java} | 4 +-- ...Service.java => EtcdSubscriptionCore.java} | 4 +-- ...nService.java => NacosConnectionCore.java} | 6 ++-- ...ervice.java => NacosSubscriptionCore.java} | 6 ++-- ...picService.java => RocketmqTopicCore.java} | 6 ++-- eventmesh-dashboard-service/pom.xml | 1 + ...ectionService.java => ConnectionCore.java} | 2 +- ...tionService.java => SubscriptionCore.java} | 2 +- .../{TopicService.java => TopicCore.java} | 2 +- 16 files changed, 65 insertions(+), 60 deletions(-) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{EtcdConnectionService.java => EtcdConnectionCore.java} (87%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{EtcdSubscriptionService.java => EtcdSubscriptionCore.java} (90%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{NacosConnectionService.java => NacosConnectionCore.java} (83%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{NacosSubscriptionService.java => NacosSubscriptionCore.java} (97%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/{RocketmqTopicService.java => RocketmqTopicCore.java} (88%) rename eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/{ConnectionService.java => ConnectionCore.java} (96%) rename eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/{SubscriptionService.java => SubscriptionCore.java} (97%) rename eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/{TopicService.java => TopicCore.java} (97%) diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index 0ffc18d9..9013082d 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -19,11 +19,27 @@ + + + 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.apache.eventmesh.dashboard.core + eventmesh-dashboard-core + 0.0.1-SNAPSHOT + + org.springframework spring-aspects - 5.1.2.RELEASE @@ -38,18 +54,6 @@ 1.7.0 - - - org.apache.eventmesh.dashboard.common - eventmesh-dashboard-common - 0.0.1-SNAPSHOT - - - org.apache.eventmesh.dashboard.service - eventmesh-dashboard-service - 0.0.1-SNAPSHOT - - com.alibaba diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java index 117dd062..4472036a 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java @@ -24,14 +24,14 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@SpringBootApplication +@SpringBootApplication(scanBasePackages = {"org.apache.eventmesh.dashboard.console", "org.apache.eventmesh.dashboard.core"}) @EnableTransactionManagement public class EventMeshDashboardApplication { public static void main(String[] args) { try { SpringApplication.run(EventMeshDashboardApplication.class, args); - log.info("{} Successfully booted.", EventMeshDashboardApplication.class.getSimpleName()); + log.info("{} Boot Successful!", EventMeshDashboardApplication.class.getSimpleName()); } catch (Exception e) { log.error(e.getMessage(), e); } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java index cfd7e390..847a24a0 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.console.controller; -import org.apache.eventmesh.dashboard.service.meta.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -31,7 +31,7 @@ public class ConnectionController { @Autowired - ConnectionService connectionService; + ConnectionCore connectionCore; /** * Query Connection List diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java index c2b96a7c..026a5245 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java @@ -19,7 +19,7 @@ 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 org.apache.eventmesh.dashboard.service.meta.SubscriptionCore; import java.util.List; @@ -34,7 +34,7 @@ public class SubscriptionController { @Autowired - SubscriptionService subscriptionService; + SubscriptionCore subscriptionCore; // the subscription dataId naming pattern of EventMesh clients: ip-protocol private static final String CLIENT_DATA_ID_PATTERN = "*.*.*.*-*"; @@ -48,7 +48,7 @@ public class SubscriptionController { */ @GetMapping("/subscription") public Result retrieveSubscription(@RequestParam("dataId") String dataId, @RequestParam("group") String group) { - return Result.success(subscriptionService.retrieveConfig(dataId, group)); + return Result.success(subscriptionCore.retrieveConfig(dataId, group)); } /** @@ -66,7 +66,7 @@ public Result> listSubscriptions( @RequestParam(name = "size", defaultValue = "10") Integer size, @RequestParam(name = "dataId", defaultValue = CLIENT_DATA_ID_PATTERN) String dataId, @RequestParam(name = "group", defaultValue = "") String group) { - return Result.success(subscriptionService.retrieveConfigs(page, size, dataId, group)); + return Result.success(subscriptionCore.retrieveConfigs(page, size, dataId, group)); } } diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java index 61108616..a005d46c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java @@ -21,7 +21,7 @@ import org.apache.eventmesh.dashboard.common.model.TopicProperties; import org.apache.eventmesh.dashboard.console.dto.CreateTopicRequest; import org.apache.eventmesh.dashboard.console.dto.DeleteTopicRequest; -import org.apache.eventmesh.dashboard.service.store.TopicService; +import org.apache.eventmesh.dashboard.service.store.TopicCore; import java.util.List; @@ -41,7 +41,7 @@ public class TopicController { @Autowired - TopicService topicService; + TopicCore topicCore; /** * TODO Is OPTIONS method and @CrossOrigin necessary? @@ -60,7 +60,7 @@ public ResponseEntity preflight() { @CrossOrigin @GetMapping public Result> getList() { - List topicList = topicService.getTopic(); + List topicList = topicCore.getTopic(); return Result.success(topicList); } @@ -68,7 +68,7 @@ public Result> getList() { @PostMapping public Result create(@RequestBody CreateTopicRequest createTopicRequest) { String topicName = createTopicRequest.getName(); - topicService.createTopic(topicName); + topicCore.createTopic(topicName); return Result.success(); } @@ -76,7 +76,7 @@ public Result create(@RequestBody CreateTopicRequest createTopicRequest) @DeleteMapping public Result delete(@RequestBody DeleteTopicRequest deleteTopicRequest) { String topicName = deleteTopicRequest.getName(); - topicService.deleteTopic(topicName); + topicCore.deleteTopic(topicName); return Result.success(); } } \ No newline at end of file diff --git a/eventmesh-dashboard-console/src/main/resources/application-dev.yml b/eventmesh-dashboard-console/src/main/resources/application-dev.yml index d411315a..3074e0c5 100644 --- a/eventmesh-dashboard-console/src/main/resources/application-dev.yml +++ b/eventmesh-dashboard-console/src/main/resources/application-dev.yml @@ -31,8 +31,8 @@ spring: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/eventmesh_dashboard?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true - username: ${DB_USERNAME} - password: ${DB_PASSWORD} + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:password} initial-size: 1 max-active: 50 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 44d376ad..03193f1a 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 @@ -18,14 +18,14 @@ package org.apache.eventmesh.dashboard.core.config; import org.apache.eventmesh.dashboard.common.constant.ConfigConst; -import org.apache.eventmesh.dashboard.core.meta.EtcdConnectionService; -import org.apache.eventmesh.dashboard.core.meta.EtcdSubscriptionService; -import org.apache.eventmesh.dashboard.core.meta.NacosConnectionService; -import org.apache.eventmesh.dashboard.core.meta.NacosSubscriptionService; -import org.apache.eventmesh.dashboard.core.store.RocketmqTopicService; -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.meta.EtcdConnectionCore; +import org.apache.eventmesh.dashboard.core.meta.EtcdSubscriptionCore; +import org.apache.eventmesh.dashboard.core.meta.NacosConnectionCore; +import org.apache.eventmesh.dashboard.core.meta.NacosSubscriptionCore; +import org.apache.eventmesh.dashboard.core.store.RocketmqTopicCore; +import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore; +import org.apache.eventmesh.dashboard.service.store.TopicCore; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -46,36 +46,36 @@ public BeanTypeConfig(AdminProperties adminProperties) { } @Bean - public ConnectionService connectionService() { + public ConnectionCore connectionCore() { switch (adminProperties.getMeta().getType()) { case ConfigConst.META_TYPE_NACOS: - return new NacosConnectionService(adminProperties); + return new NacosConnectionCore(adminProperties); case ConfigConst.META_TYPE_ETCD: - return new EtcdConnectionService(); + return new EtcdConnectionCore(); default: throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType()); } } @Bean - public SubscriptionService subscriptionService() { + public SubscriptionCore subscriptionCore() { switch (adminProperties.getMeta().getType()) { case ConfigConst.META_TYPE_NACOS: - return new NacosSubscriptionService(adminProperties); + return new NacosSubscriptionCore(adminProperties); case ConfigConst.META_TYPE_ETCD: - return new EtcdSubscriptionService(); + return new EtcdSubscriptionCore(); default: throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType()); } } @Bean - public TopicService topicService() { + public TopicCore topicCore() { switch (adminProperties.getStore().getType()) { case ConfigConst.STORE_TYPE_STANDALONE: return null; // TODO StandaloneTopicService case ConfigConst.STORE_TYPE_ROCKETMQ: - return new RocketmqTopicService(adminProperties); + return new RocketmqTopicCore(adminProperties); case ConfigConst.STORE_TYPE_KAFKA: return null; // TODO KafkaTopicService default: diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java similarity index 87% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java index 76a77521..65f836b0 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java @@ -17,7 +17,7 @@ package org.apache.eventmesh.dashboard.core.meta; -import org.apache.eventmesh.dashboard.service.meta.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; import org.springframework.stereotype.Service; @@ -25,6 +25,6 @@ @Slf4j @Service -public class EtcdConnectionService implements ConnectionService { +public class EtcdConnectionCore implements ConnectionCore { } diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java similarity index 90% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java index 0db282b3..7fdd9571 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java @@ -19,7 +19,7 @@ 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 org.apache.eventmesh.dashboard.service.meta.SubscriptionCore; import java.util.List; @@ -29,7 +29,7 @@ @Slf4j @Service -public class EtcdSubscriptionService implements SubscriptionService { +public class EtcdSubscriptionCore implements SubscriptionCore { @Override public String retrieveConfig(String dataId, String group) { diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java similarity index 83% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java index ef1f26fe..a9e62ad1 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java @@ -18,7 +18,7 @@ package org.apache.eventmesh.dashboard.core.meta; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.service.meta.ConnectionService; +import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; import org.springframework.stereotype.Service; @@ -26,9 +26,9 @@ @Slf4j @Service -public class NacosConnectionService implements ConnectionService { +public class NacosConnectionCore implements ConnectionCore { - public NacosConnectionService(AdminProperties adminProperties) { + public NacosConnectionCore(AdminProperties adminProperties) { } } diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java similarity index 97% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java index 8c2349d8..d4436e0d 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java @@ -30,7 +30,7 @@ import org.apache.eventmesh.dashboard.common.exception.MetaException; import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.service.meta.SubscriptionService; +import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore; import java.util.ArrayList; import java.util.Base64; @@ -58,7 +58,7 @@ @Slf4j @Service -public class NacosSubscriptionService implements SubscriptionService { +public class NacosSubscriptionCore implements SubscriptionCore { AdminProperties adminProperties; @@ -68,7 +68,7 @@ public class NacosSubscriptionService implements SubscriptionService { private static String HTTP_PREFIX = ConfigConst.HTTP_PREFIX; - public NacosSubscriptionService(AdminProperties adminProperties) { + public NacosSubscriptionCore(AdminProperties adminProperties) { this.adminProperties = adminProperties; nacosProps.setProperty(PropertyKeyConst.SERVER_ADDR, adminProperties.getMeta().getNacos().getAddr()); diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicService.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java similarity index 88% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicService.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java index bd5c5d1b..5dba4c23 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicService.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/store/RocketmqTopicCore.java @@ -19,7 +19,7 @@ import org.apache.eventmesh.dashboard.common.model.TopicProperties; import org.apache.eventmesh.dashboard.core.config.AdminProperties; -import org.apache.eventmesh.dashboard.service.store.TopicService; +import org.apache.eventmesh.dashboard.service.store.TopicCore; import java.util.List; @@ -33,11 +33,11 @@ @Slf4j @Service -public class RocketmqTopicService implements TopicService { +public class RocketmqTopicCore implements TopicCore { AdminProperties adminProperties; - public RocketmqTopicService(AdminProperties adminProperties) { + public RocketmqTopicCore(AdminProperties adminProperties) { this.adminProperties = adminProperties; } diff --git a/eventmesh-dashboard-service/pom.xml b/eventmesh-dashboard-service/pom.xml index e64ecb58..ebcd1113 100644 --- a/eventmesh-dashboard-service/pom.xml +++ b/eventmesh-dashboard-service/pom.xml @@ -19,6 +19,7 @@ + org.apache.eventmesh.dashboard.common eventmesh-dashboard-common diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionCore.java similarity index 96% rename from eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionCore.java index 6fa0bdf7..7fbed105 100644 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/ConnectionCore.java @@ -23,6 +23,6 @@ * reported by the connector. */ -public interface ConnectionService { +public interface ConnectionCore { } diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionCore.java similarity index 97% rename from eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionCore.java index bff44390..2512a95a 100644 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/meta/SubscriptionCore.java @@ -28,7 +28,7 @@ * reported by the EventMesh runtime. */ -public interface SubscriptionService { +public interface SubscriptionCore { String retrieveConfig(String dataId, String group); diff --git a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java similarity index 97% rename from eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java rename to eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java index c68c9ae3..2b37e53f 100644 --- a/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicService.java +++ b/eventmesh-dashboard-service/src/main/java/org/apache/eventmesh/dashboard/service/store/TopicCore.java @@ -25,7 +25,7 @@ * Manage topics of eventmesh-storage-plugin (EventMesh Store). */ -public interface TopicService { +public interface TopicCore { /** * TODO rename to getTopics after being implemented From bc517290aa89ac244b74a64f7a3ae6d297e2d9f3 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 16:14:02 +0800 Subject: [PATCH 08/10] implement classes in core are not Service Beans --- eventmesh-dashboard-common/pom.xml | 5 -- eventmesh-dashboard-console/pom.xml | 5 -- .../EventMeshDashboardApplication.java | 2 +- .../controller/ConnectionController.java | 5 +- .../console/controller/MetricsController.java | 2 + .../controller/SubscriptionController.java | 5 +- .../console/controller/TopicController.java | 5 +- .../dashboard/core/config/BeanTypeConfig.java | 85 ------------------- .../{ => connection}/EtcdConnectionCore.java | 5 +- .../{ => connection}/NacosConnectionCore.java | 9 +- .../EtcdSubscriptionCore.java | 5 +- .../NacosSubscriptionCore.java | 6 +- 12 files changed, 17 insertions(+), 122 deletions(-) delete mode 100644 eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{ => connection}/EtcdConnectionCore.java (90%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{ => connection}/NacosConnectionCore.java (79%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{ => subscription}/EtcdSubscriptionCore.java (92%) rename eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/{ => subscription}/NacosSubscriptionCore.java (98%) diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 6fc3e3bf..29011722 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -24,11 +24,6 @@ org.springframework.boot spring-boot-starter-web - - org.springframework.boot - spring-boot-starter-test - test - diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index 9013082d..b071854f 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -30,11 +30,6 @@ eventmesh-dashboard-service 0.0.1-SNAPSHOT - - org.apache.eventmesh.dashboard.core - eventmesh-dashboard-core - 0.0.1-SNAPSHOT - diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java index 4472036a..53a951ae 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/EventMeshDashboardApplication.java @@ -24,7 +24,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@SpringBootApplication(scanBasePackages = {"org.apache.eventmesh.dashboard.console", "org.apache.eventmesh.dashboard.core"}) +@SpringBootApplication @EnableTransactionManagement public class EventMeshDashboardApplication { diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java index 847a24a0..37e9049d 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/ConnectionController.java @@ -19,7 +19,6 @@ import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -30,7 +29,9 @@ @RestController public class ConnectionController { - @Autowired + /** + * TODO expose implement by FunctionManager + */ ConnectionCore connectionCore; /** diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java index 38f5b1af..689f833c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/MetricsController.java @@ -24,8 +24,10 @@ @RestController public class MetricsController { + @GetMapping("/druid/stat") public Object druidStat() { return DruidStatManagerFacade.getInstance().getDataSourceStatDataList(); } + } \ No newline at end of file diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java index 026a5245..1af09aee 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/SubscriptionController.java @@ -23,7 +23,6 @@ import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -33,7 +32,9 @@ @RequestMapping("/api/v1") public class SubscriptionController { - @Autowired + /** + * TODO expose implement by FunctionManager + */ SubscriptionCore subscriptionCore; // the subscription dataId naming pattern of EventMesh clients: ip-protocol diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java index a005d46c..1f6c601b 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/TopicController.java @@ -25,7 +25,6 @@ import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; @@ -40,7 +39,9 @@ @RequestMapping("/topic") public class TopicController { - @Autowired + /** + * TODO expose implement by FunctionManager + */ TopicCore topicCore; /** 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 deleted file mode 100644 index 03193f1a..00000000 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/config/BeanTypeConfig.java +++ /dev/null @@ -1,85 +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.core.config; - -import org.apache.eventmesh.dashboard.common.constant.ConfigConst; -import org.apache.eventmesh.dashboard.core.meta.EtcdConnectionCore; -import org.apache.eventmesh.dashboard.core.meta.EtcdSubscriptionCore; -import org.apache.eventmesh.dashboard.core.meta.NacosConnectionCore; -import org.apache.eventmesh.dashboard.core.meta.NacosSubscriptionCore; -import org.apache.eventmesh.dashboard.core.store.RocketmqTopicCore; -import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; -import org.apache.eventmesh.dashboard.service.meta.SubscriptionCore; -import org.apache.eventmesh.dashboard.service.store.TopicCore; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * Use different registry SDK depending on the configured meta type; - * Use different storage SDK depending on the configured storage type. - * TODO get configs from DB (console module's work) - */ -@Deprecated -@Configuration -public class BeanTypeConfig { - - private final AdminProperties adminProperties; - - public BeanTypeConfig(AdminProperties adminProperties) { - this.adminProperties = adminProperties; - } - - @Bean - public ConnectionCore connectionCore() { - switch (adminProperties.getMeta().getType()) { - case ConfigConst.META_TYPE_NACOS: - return new NacosConnectionCore(adminProperties); - case ConfigConst.META_TYPE_ETCD: - return new EtcdConnectionCore(); - default: - throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType()); - } - } - - @Bean - public SubscriptionCore subscriptionCore() { - switch (adminProperties.getMeta().getType()) { - case ConfigConst.META_TYPE_NACOS: - return new NacosSubscriptionCore(adminProperties); - case ConfigConst.META_TYPE_ETCD: - return new EtcdSubscriptionCore(); - default: - throw new IllegalArgumentException("Unsupported EventMesh Meta type: " + adminProperties.getMeta().getType()); - } - } - - @Bean - public TopicCore topicCore() { - switch (adminProperties.getStore().getType()) { - case ConfigConst.STORE_TYPE_STANDALONE: - return null; // TODO StandaloneTopicService - case ConfigConst.STORE_TYPE_ROCKETMQ: - return new RocketmqTopicCore(adminProperties); - case ConfigConst.STORE_TYPE_KAFKA: - return null; // TODO KafkaTopicService - default: - throw new IllegalArgumentException("Unsupported EventMesh Store type: " + adminProperties.getStore().getType()); - } - } -} \ No newline at end of file diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/EtcdConnectionCore.java similarity index 90% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/EtcdConnectionCore.java index 65f836b0..0a994bc7 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdConnectionCore.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/EtcdConnectionCore.java @@ -15,16 +15,13 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.meta; +package org.apache.eventmesh.dashboard.core.meta.connection; import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; -import org.springframework.stereotype.Service; - import lombok.extern.slf4j.Slf4j; @Slf4j -@Service public class EtcdConnectionCore implements ConnectionCore { } diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/NacosConnectionCore.java similarity index 79% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/NacosConnectionCore.java index a9e62ad1..6f026525 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosConnectionCore.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/connection/NacosConnectionCore.java @@ -15,20 +15,13 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.meta; +package org.apache.eventmesh.dashboard.core.meta.connection; -import org.apache.eventmesh.dashboard.core.config.AdminProperties; import org.apache.eventmesh.dashboard.service.meta.ConnectionCore; -import org.springframework.stereotype.Service; - import lombok.extern.slf4j.Slf4j; @Slf4j -@Service public class NacosConnectionCore implements ConnectionCore { - public NacosConnectionCore(AdminProperties adminProperties) { - } - } diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java similarity index 92% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java index 7fdd9571..4fd39c81 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/EtcdSubscriptionCore.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/EtcdSubscriptionCore.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.meta; +package org.apache.eventmesh.dashboard.core.meta.subscription; import org.apache.eventmesh.dashboard.common.dto.Result; import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo; @@ -23,12 +23,9 @@ import java.util.List; -import org.springframework.stereotype.Service; - import lombok.extern.slf4j.Slf4j; @Slf4j -@Service public class EtcdSubscriptionCore implements SubscriptionCore { @Override diff --git a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/NacosSubscriptionCore.java similarity index 98% rename from eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java rename to eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/NacosSubscriptionCore.java index d4436e0d..0d665c69 100644 --- a/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/NacosSubscriptionCore.java +++ b/eventmesh-dashboard-core/src/main/java/org/apache/eventmesh/dashboard/core/meta/subscription/NacosSubscriptionCore.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.eventmesh.dashboard.core.meta; +package org.apache.eventmesh.dashboard.core.meta.subscription; 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; @@ -42,7 +42,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Service; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; @@ -57,7 +56,6 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@Service public class NacosSubscriptionCore implements SubscriptionCore { AdminProperties adminProperties; @@ -114,7 +112,7 @@ public String retrieveConfig(String dataId, String group) { /** * Retrieve a list of configs with Nacos OpenAPI, because Nacos SDK doesn't support listing and fuzzy matching. - * + *

* TODO Granularity should be based on subscriptions rather than Runtime; * retrieve all subscriptions for each Runtime, rather than retrieving subscriptions for each individual Runtime. */ From 2da3e5ef2b66e84525b2695db4392c48932c7586 Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 16:20:14 +0800 Subject: [PATCH 09/10] remove redundant artifact which is included in spring-boot-starter-web --- eventmesh-dashboard-common/pom.xml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 29011722..108b059b 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -30,10 +30,6 @@ org.projectlombok lombok - - com.fasterxml.jackson.core - jackson-annotations - org.apache.commons commons-lang3 From 9e450a4c593e766621827aaddc8815c0ad7facdc Mon Sep 17 00:00:00 2001 From: Pil0tXia Date: Sat, 2 Mar 2024 17:40:24 +0800 Subject: [PATCH 10/10] chore: db test default auth env --- .../src/test/resources/application-test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eventmesh-dashboard-console/src/test/resources/application-test.yml b/eventmesh-dashboard-console/src/test/resources/application-test.yml index b70a657c..ee44e7c2 100644 --- a/eventmesh-dashboard-console/src/test/resources/application-test.yml +++ b/eventmesh-dashboard-console/src/test/resources/application-test.yml @@ -22,8 +22,8 @@ spring: druid: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/eventmesh_dashboard_test?useSSL=false&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&allowPublicKeyRetrieval=true - username: root - password: password + username: ${DB_USERNAME:root} + password: ${DB_PASSWORD:password} initial-size: 1 max-active: 50