From a375136e23edd2fc9b9c5638a9de0bf5f8f0150f Mon Sep 17 00:00:00 2001 From: "lambert@arch" Date: Sun, 7 Apr 2024 12:31:31 +0800 Subject: [PATCH] fix: Optimize style --- eventmesh-dashboard-common/pom.xml | 2 +- .../common/constant/StoreTypeConstant.java | 2 - .../health/HealthCheckTypeConstant.java | 4 +- .../dashboard/common/enums/StoreType.java | 4 -- .../metadata/MetadataServiceTypeEnum.java | 39 ------------------- .../enums/metadata/MetadataTypeEnum.java | 37 ------------------ eventmesh-dashboard-console/pom.xml | 6 +++ .../health/annotation/HealthCheckType.java | 2 +- .../rocketmq4/Rocketmq4BrokerCheck.java | 5 --- .../rocketmq4/Rocketmq4NameServerCheck.java | 2 +- .../rocketmq4/Rocketmq4TopicCheck.java | 3 -- eventmesh-dashboard-core/pom.xml | 6 --- 12 files changed, 10 insertions(+), 102 deletions(-) delete mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java delete mode 100644 eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java diff --git a/eventmesh-dashboard-common/pom.xml b/eventmesh-dashboard-common/pom.xml index 6265eadf..6c895104 100644 --- a/eventmesh-dashboard-common/pom.xml +++ b/eventmesh-dashboard-common/pom.xml @@ -19,11 +19,11 @@ + org.springframework.boot spring-boot-starter-web - provided diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java index 8f9249f2..dfa3711c 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/StoreTypeConstant.java @@ -23,8 +23,6 @@ public class StoreTypeConstant { public static final String STORE_TYPE_REDIS = "redis"; public static final String STORE_TYPE_MYSQL = "mysql"; public static final String STORE_TYPE_ROCKETMQ = "rocketmq4"; - public static final String STORE_SUBTYPE_ROCKETMQ_BROKER = "rocketmq4-broker"; - public static final String STORE_SUBTYPE_ROCKETMQ_NAMESERVER = "rocketmq4-nameserver"; public static final String STORE_TYPE_KAFKA = "kafka"; public static final String STORE_TYPE_PULSAR = "pulsar"; public static final String STORE_TYPE_RABBITMQ = "rabbitmq"; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java index c676c78f..5252899e 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/constant/health/HealthCheckTypeConstant.java @@ -32,9 +32,7 @@ public class HealthCheckTypeConstant { public static final String HEALTH_CHECK_SUBTYPE_REDIS = StoreTypeConstant.STORE_TYPE_REDIS; public static final String HEALTH_CHECK_SUBTYPE_MYSQL = StoreTypeConstant.STORE_TYPE_MYSQL; - public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER = StoreTypeConstant.STORE_SUBTYPE_ROCKETMQ_BROKER; - public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_NAMESERVER = StoreTypeConstant.STORE_SUBTYPE_ROCKETMQ_NAMESERVER; - public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ_TOPIC = "rocketmq4-topic"; + public static final String HEALTH_CHECK_SUBTYPE_ROCKETMQ = StoreTypeConstant.STORE_TYPE_ROCKETMQ; public static final String HEALTH_CHECK_SUBTYPE_NACOS_CONFIG = "nacos-config"; public static final String HEALTH_CHECK_SUBTYPE_NACOS_REGISTRY = "nacos-registry"; diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java index c1a01856..ed15a868 100644 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java +++ b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/StoreType.java @@ -17,8 +17,6 @@ package org.apache.eventmesh.dashboard.common.enums; -import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_SUBTYPE_ROCKETMQ_BROKER; -import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_SUBTYPE_ROCKETMQ_NAMESERVER; import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_TYPE_KAFKA; import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_TYPE_PULSAR; import static org.apache.eventmesh.dashboard.common.constant.StoreTypeConstant.STORE_TYPE_RABBITMQ; @@ -34,8 +32,6 @@ public enum StoreType { STANDALONE(0, STORE_TYPE_STANDALONE), ROCKETMQ(1, STORE_TYPE_ROCKETMQ), - ROCKETMQ_BROKER(11, STORE_SUBTYPE_ROCKETMQ_BROKER), - ROCKETMQ_NAMESERVER(12, STORE_SUBTYPE_ROCKETMQ_NAMESERVER), KAFKA(2, STORE_TYPE_KAFKA), PULSAR(3, STORE_TYPE_PULSAR), RABBITMQ(4, STORE_TYPE_RABBITMQ), diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java deleted file mode 100644 index a810b0e4..00000000 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataServiceTypeEnum.java +++ /dev/null @@ -1,39 +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.common.enums.metadata; - -public enum MetadataServiceTypeEnum { - - RUNTIME, - - CENTER_ETCD, - - META_NACOS, - - TOPIC, - - CLUSTER, - - CLIENT, - - GROUP, - - CONNECTION, - - -} diff --git a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java b/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java deleted file mode 100644 index 90a3e458..00000000 --- a/eventmesh-dashboard-common/src/main/java/org/apache/eventmesh/dashboard/common/enums/metadata/MetadataTypeEnum.java +++ /dev/null @@ -1,37 +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.common.enums.metadata; - -public enum MetadataTypeEnum { - - CENTER, - - CLUSTER, - - RUNTIME, - - TOPIC, - - GROUP, - - SUBSCRIPTION, - - STORE - ; - -} diff --git a/eventmesh-dashboard-console/pom.xml b/eventmesh-dashboard-console/pom.xml index 02240a94..016215da 100644 --- a/eventmesh-dashboard-console/pom.xml +++ b/eventmesh-dashboard-console/pom.xml @@ -19,6 +19,12 @@ + + + org.springframework.boot + spring-boot-starter-web + + org.apache.eventmesh.dashboard.common diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/annotation/HealthCheckType.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/annotation/HealthCheckType.java index 7a23b902..0d3750ca 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/annotation/HealthCheckType.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/annotation/HealthCheckType.java @@ -24,7 +24,7 @@ /** * This annotation is used to mark the type of health check service implement. - * @see org.apache.eventmesh.dashboard.console.enums.health.HealthCheckType + * @see org.apache.eventmesh.dashboard.common.enums.health.HealthCheckType */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java index 7f8e56c7..b60a73ce 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4BrokerCheck.java @@ -17,10 +17,6 @@ package org.apache.eventmesh.dashboard.console.function.health.check.impl.storage.rocketmq4; -import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER; -import static org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE; - -import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; import org.apache.eventmesh.dashboard.console.function.health.check.config.HealthCheckObjectConfig; @@ -36,7 +32,6 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@HealthCheckType(type = HEALTH_CHECK_TYPE_STORAGE, subType = HEALTH_CHECK_SUBTYPE_ROCKETMQ_BROKER) public class Rocketmq4BrokerCheck extends AbstractHealthCheckService { private RemotingClient remotingClient; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java index e855ba18..7ba3667e 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4NameServerCheck.java @@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@HealthCheckType(type = HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE, subType = HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ_NAMESERVER) +@HealthCheckType(type = HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE, subType = HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ) public class Rocketmq4NameServerCheck extends AbstractHealthCheckService { private RemotingClient remotingClient; diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java index 739ac445..6656589c 100644 --- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java +++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/check/impl/storage/rocketmq4/Rocketmq4TopicCheck.java @@ -19,9 +19,7 @@ import static org.apache.rocketmq.client.producer.SendStatus.SEND_OK; -import org.apache.eventmesh.dashboard.common.constant.health.HealthCheckTypeConstant; import org.apache.eventmesh.dashboard.common.constant.health.HealthConstant; -import org.apache.eventmesh.dashboard.console.function.health.annotation.HealthCheckType; import org.apache.eventmesh.dashboard.console.function.health.callback.HealthCheckCallback; import org.apache.eventmesh.dashboard.console.function.health.check.AbstractHealthCheckService; import org.apache.eventmesh.dashboard.console.function.health.check.config.HealthCheckObjectConfig; @@ -57,7 +55,6 @@ import lombok.extern.slf4j.Slf4j; @Slf4j -@HealthCheckType(type = HealthCheckTypeConstant.HEALTH_CHECK_TYPE_STORAGE, subType = HealthCheckTypeConstant.HEALTH_CHECK_SUBTYPE_ROCKETMQ_TOPIC) public class Rocketmq4TopicCheck extends AbstractHealthCheckService { private RemotingClient remotingClient; diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml index 853579ee..ca133402 100644 --- a/eventmesh-dashboard-core/pom.xml +++ b/eventmesh-dashboard-core/pom.xml @@ -40,12 +40,6 @@ - - - org.springframework.boot - spring-boot-starter-web - - org.apache.eventmesh.dashboard.common