This is an automated email from the ASF dual-hosted git repository.

xiatian pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/eventmesh-dashboard.git


The following commit(s) were added to refs/heads/main by this push:
     new e38db0f  [ISSUE #119] Introduce dependencies for a unified return 
front-end format (#120)
e38db0f is described below

commit e38db0f2f01e32ae3b9f0f4dc31ea234589dddae
Author: zzx <[email protected]>
AuthorDate: Wed Apr 17 22:52:57 2024 +0800

    [ISSUE #119] Introduce dependencies for a unified return front-end format 
(#120)
    
    * Add view controller
    
    * Some fixes to the position of the dynamic properties in the request, 
changes to the controller, and added comments to the config table
    
    * improve somme method name
    
    * Sync the modification of #85
    
    * Sync the modification of #85
    
    * Removed the use of delete annotations
    
    * Introduce dependencies for a unified return front-end format
    
    * resolve error
    
    * improve some mistake
    
    * improve some mistake
    
    * improve some mistake
    
    ---------
    
    Co-authored-by: 周倬贤 <[email protected]>
---
 eventmesh-dashboard-common/pom.xml                 |  1 +
 eventmesh-dashboard-console/pom.xml                | 89 +++++++++-------------
 .../dashboard/console/dto/ConnectionResponse.java  | 69 -----------------
 .../dashboard/console/dto/CreateTopicRequest.java  | 39 ----------
 .../dashboard/console/dto/DeleteTopicRequest.java  | 39 ----------
 .../console/modle/dto/topic/CreateTopicDTO.java    |  3 +-
 .../console/service/topic/TopicServiceImpl.java    |  2 +-
 .../src/main/resources/application-dev.yml         |  7 ++
 .../src/main/resources/eventmesh-dashboard.sql     |  1 +
 eventmesh-dashboard-core/pom.xml                   |  7 +-
 10 files changed, 51 insertions(+), 206 deletions(-)

diff --git a/eventmesh-dashboard-common/pom.xml 
b/eventmesh-dashboard-common/pom.xml
index 892093b..2f531fd 100644
--- a/eventmesh-dashboard-common/pom.xml
+++ b/eventmesh-dashboard-common/pom.xml
@@ -41,6 +41,7 @@
         <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-web</artifactId>
+            <scope>provided</scope>
         </dependency>
 
         <!-- Utility -->
diff --git a/eventmesh-dashboard-console/pom.xml 
b/eventmesh-dashboard-console/pom.xml
index 511671d..a39ae57 100644
--- a/eventmesh-dashboard-console/pom.xml
+++ b/eventmesh-dashboard-console/pom.xml
@@ -36,21 +36,15 @@
     </properties>
 
     <dependencies>
-        <!-- Spring Boot Starter -->
-        <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-web</artifactId>
-        </dependency>
-
         <!-- EventMesh Dashboard modules -->
         <dependency>
-            <groupId>org.apache.eventmesh.dashboard.common</groupId>
-            <artifactId>eventmesh-dashboard-common</artifactId>
+            <groupId>org.apache.eventmesh.dashboard.core</groupId>
+            <artifactId>eventmesh-dashboard-core</artifactId>
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
-            <groupId>org.apache.eventmesh.dashboard.core</groupId>
-            <artifactId>eventmesh-dashboard-core</artifactId>
+            <groupId>org.apache.eventmesh.dashboard.common</groupId>
+            <artifactId>eventmesh-dashboard-common</artifactId>
             <version>0.0.1-SNAPSHOT</version>
         </dependency>
         <dependency>
@@ -65,17 +59,16 @@
             <artifactId>spring-aspects</artifactId>
         </dependency>
 
-        <!-- Unit Test -->
+        <!-- mybatis laohu-->
         <dependency>
-            <groupId>org.springframework.boot</groupId>
-            <artifactId>spring-boot-starter-test</artifactId>
-            <scope>test</scope>
+            <groupId>io.github.githublaohu</groupId>
+            <artifactId>mybatis-dependent</artifactId>
+            <version>0.1.4</version>
         </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.13.2</version>
-            <scope>test</scope>
+         <dependency>
+            <groupId>com.github.pagehelper</groupId>
+            <artifactId>pagehelper-spring-boot-starter</artifactId>
+            <version>2.1.0</version>
         </dependency>
 
         <!-- Swagger -->
@@ -90,46 +83,38 @@
             <version>1.8.0</version>
         </dependency>
 
-        <!-- Database -->
+        <!-- GitHub laohu springmvc(contain spring boot starter)-->
         <dependency>
-            <groupId>com.alibaba</groupId>
-            <artifactId>druid-spring-boot-starter</artifactId>
-            <version>1.2.22</version>
+            <groupId>io.github.githublaohu</groupId>
+            <artifactId>dubbo-springmvc</artifactId>
+            <version>0.1.4</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.apache.dubbo</groupId>
+                    <artifactId>dubbo-spring-boot-starter</artifactId>
+                </exclusion>
+            </exclusions>
         </dependency>
+
+        <!--lampup -->
         <dependency>
-            <groupId>org.mybatis.spring.boot</groupId>
-            <artifactId>mybatis-spring-boot-starter</artifactId>
+            <groupId>cn.lampup</groupId>
+            <artifactId>decoration-core</artifactId>
+            <version>0.1.7</version>
         </dependency>
 
+        <!-- Unit Test -->
         <dependency>
-            <groupId>com.mysql</groupId>
-            <artifactId>mysql-connector-j</artifactId>
-            <scope>runtime</scope>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-test</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>4.13.2</version>
+            <scope>test</scope>
         </dependency>
-
-        <!-- health check client -->
-        <!-- EventMesh SDK -->
-        <!--        <dependency>-->
-        <!--            <groupId>org.apache.eventmesh</groupId>-->
-        <!--            <artifactId>eventmesh-sdk-java</artifactId>-->
-        <!--            <version>1.10.0-release</version>-->
-        <!--            <exclusions>-->
-        <!--                <exclusion>-->
-        <!--                    <groupId>junit</groupId>-->
-        <!--                    <artifactId>junit</artifactId>-->
-        <!--                </exclusion>-->
-        <!--                <exclusion>-->
-        <!--                    <groupId>junit</groupId>-->
-        <!--                    <artifactId>junit-dep</artifactId>-->
-        <!--                </exclusion>-->
-        <!--                <exclusion>-->
-        <!--                    <groupId>org.apache.logging.log4j</groupId>-->
-        <!--                    <artifactId>log4j-slf4j-impl</artifactId>-->
-        <!--                </exclusion>-->
-        <!--            </exclusions>-->
-        <!--        </dependency>-->
-
-        <!-- health check client end -->
     </dependencies>
 
     <build>
diff --git 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
deleted file mode 100644
index d4062a6..0000000
--- 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/ConnectionResponse.java
+++ /dev/null
@@ -1,69 +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.dto;
-
-import java.io.Serializable;
-
-import io.swagger.v3.oas.annotations.media.Schema;
-
-
-public class ConnectionResponse implements Serializable {
-
-    private static final long serialVersionUID = -7317308457824435889L;
-
-    @Schema(name = "id", description = "primary key of table connection")
-    private Long id;
-
-    @Schema(name = "sourceType", defaultValue = "connector", allowableValues = 
{"connector", "client"})
-    private String sourceType;
-
-    @Schema(name = "sourceId", description = "connectorId or clientId")
-    private Long sourceId;
-
-    @Schema(name = "sourceStatus", defaultValue = "0", allowableValues = {"0", 
"1"}, description = "0:not active, 1:active")
-    private Integer sourceStatus;
-
-    //    @Schema(name = "sourceConfigList", description = "source config 
list")
-    //    private List<ConfigEntity> sourceConfigList;
-
-    @Schema(name = "sinkType", defaultValue = "connector", allowableValues = 
{"connector", "client"})
-    private String sinkType;
-
-    @Schema(name = "sinkId", description = "connectorId or clientId")
-    private Long sinkId;
-
-    @Schema(name = "sinkStatus", defaultValue = "0", allowableValues = {"0", 
"1"}, description = "0:not active, 1:active")
-    private Integer sinkStatus;
-
-    //    @Schema(name = "sinkConfigList", description = "sink config list")
-    //    private List<ConfigEntity> sinkConfigList;
-
-    private Long runtimeId;
-
-    @Schema(name = "status", defaultValue = "0", allowableValues = {"0", "1"}, 
description = "0:not active, 1:active")
-    private Integer status;
-
-    @Schema(name = "topic", description = "related topic name from storage")
-    private String topic;
-
-    private Long groupId;
-
-    private String groupName;
-
-    private String description;
-}
diff --git 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.java
 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.java
deleted file mode 100644
index c84cee4..0000000
--- 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/CreateTopicRequest.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.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 {
-
-    private String name;
-
-    @JsonCreator
-    public CreateTopicRequest(@JsonProperty("name") String name) {
-        super();
-        this.name = name;
-    }
-}
diff --git 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.java
 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.java
deleted file mode 100644
index da793b3..0000000
--- 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/dto/DeleteTopicRequest.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.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 {
-
-    private String name;
-
-    @JsonCreator
-    public DeleteTopicRequest(@JsonProperty("name") String name) {
-        super();
-        this.name = name;
-    }
-}
diff --git 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/CreateTopicDTO.java
 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/CreateTopicDTO.java
index df7cc3d..15d9c8b 100644
--- 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/CreateTopicDTO.java
+++ 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/CreateTopicDTO.java
@@ -17,7 +17,6 @@
 
 package org.apache.eventmesh.dashboard.console.modle.dto.topic;
 
-import java.sql.Timestamp;
 
 import lombok.Data;
 
@@ -38,7 +37,7 @@ public class CreateTopicDTO {
 
     private Integer replicasNums;
 
-    private Timestamp saveTime;
+    private Long saveTime;
 
     private Integer cleanupStrategy;
 }
diff --git 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/topic/TopicServiceImpl.java
 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/topic/TopicServiceImpl.java
index d99cd70..6854498 100644
--- 
a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/topic/TopicServiceImpl.java
+++ 
b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/topic/TopicServiceImpl.java
@@ -99,7 +99,7 @@ public class TopicServiceImpl implements TopicService {
         topicEntity.setClusterId(createTopicDTO.getClusterId());
         topicEntity.setTopicName(createTopicDTO.getName());
         topicEntity.setDescription(createTopicDTO.getDescription());
-        topicEntity.setRetentionMs(createTopicDTO.getSaveTime().getTime());
+        topicEntity.setRetentionMs(createTopicDTO.getSaveTime());
         StoreEntity storeEntity = new StoreEntity();
         storeEntity.setClusterId(topicEntity.getClusterId());
         
topicEntity.setStorageId(String.valueOf(storeMapper.selectStoreByCluster(storeEntity).getId()));
diff --git a/eventmesh-dashboard-console/src/main/resources/application-dev.yml 
b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
index b0cee4b..1516982 100644
--- a/eventmesh-dashboard-console/src/main/resources/application-dev.yml
+++ b/eventmesh-dashboard-console/src/main/resources/application-dev.yml
@@ -53,5 +53,12 @@ logging:
 mybatis:
   type-aliases-package: org.apache.eventmesh.dashboard.console.entity
 
+decoration:
+  constantConfig:
+    #The 'all' configuration item indicates that the decoration component is 
allowed to enable pagination and return the front-end style function in a 
unified manner
+    all: true
+    #the 'corsEnable' configuration item indicates that cross-domain is enabled
+  corsEnable: true
+
 
 
diff --git 
a/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql 
b/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
index e4fc271..51655bc 100644
--- a/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
+++ b/eventmesh-dashboard-console/src/main/resources/eventmesh-dashboard.sql
@@ -290,6 +290,7 @@ CREATE TABLE `topic`
     `create_time`  timestamp       NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 
'创建时间(尽量与Topic实际创建时间一致)',
     `update_time`  timestamp       NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 
'修改时间(尽量与Topic实际创建时间一致)',
     `status`       int             NOT NULL DEFAULT '1',
+    create_progress int            NOT NULL DEFAULT 1 COMMENT 
'0:创建成功,1:创建中,2:创建失败',
     PRIMARY KEY (`id`),
     UNIQUE KEY `uniq_cluster_phy_id_topic_name` (`cluster_id`, `topic_name`),
     KEY            `cluster_id` (`cluster_id`, `topic_name`)
diff --git a/eventmesh-dashboard-core/pom.xml b/eventmesh-dashboard-core/pom.xml
index 2e43383..c5d20d7 100644
--- a/eventmesh-dashboard-core/pom.xml
+++ b/eventmesh-dashboard-core/pom.xml
@@ -137,10 +137,9 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.13.2</version>
-            <scope>test</scope>
+            <groupId>org.springframework.boot</groupId>
+            <artifactId>spring-boot-starter-web</artifactId>
+            <scope>provided</scope>
         </dependency>
     </dependencies>
 </project>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to