You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by xi...@apache.org on 2024/06/16 13:04:31 UTC
(eventmesh-dashboard) branch main updated: [ISSUE #161] Canonical code (#162)
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 18bfad4 [ISSUE #161] Canonical code (#162)
18bfad4 is described below
commit 18bfad4a7c1e150234270499c96f72078ccf82c8
Author: zzx <14...@users.noreply.github.com>
AuthorDate: Sun Jun 16 21:04:27 2024 +0800
[ISSUE #161] Canonical code (#162)
* Changes to code specifications
* Resolve syntax errors
* Code Specification
* Code Specification
---------
Co-authored-by: 周倬贤 <14...@user.noreply.gitee.com>
---
.../console/controller/ConnectionController.java | 27 +--
.../controller/cluster/ClusterController.java | 5 +-
.../cluster/ClusterRelationshipController.java | 2 +-
.../controller/cluster/RuntimeController.java | 2 +-
.../controller/function/ConfigController.java | 15 +-
.../controller/function/HealthController.java | 10 +-
.../console/controller/function/LogController.java | 9 +-
.../controller/message/GroupController.java | 2 +-
.../controller/message/TopicController.java | 4 +-
...tConfigKey.java => CreateConnectionEntity.java} | 14 +-
.../dashboard/console/entity/DefaultConfigKey.java | 4 -
.../connection/AddConnectionEntity.java} | 8 +-
.../connection/AddConnectorConfigEntity.java} | 8 +-
.../entity/function/HealthCheckResultEntity.java | 6 -
.../console/entity/function/LogEntity.java | 4 -
.../console/function/health/HealthService.java | 14 +-
.../handler/db/RuntimeMetadataHandlerToDbImpl.java | 4 +-
.../eventmesh/dashboard/console/log/OprLog.java | 2 +-
.../console/mapper/cluster/AclMapper.java | 24 ++-
.../console/mapper/cluster/ClientMapper.java | 33 +--
.../console/mapper/cluster/ClusterMapper.java | 36 ++--
.../mapper/cluster/ClusterRelationshipMapper.java | 23 +-
.../console/mapper/cluster/ConnectionMapper.java | 29 +--
.../console/mapper/cluster/InstanceUserMapper.java | 22 +-
.../mapper/cluster/NetConnectionMapper.java | 3 +-
.../console/mapper/cluster/RuntimeMapper.java | 42 ++--
.../console/mapper/connector/ConnectorMapper.java | 49 ++---
.../console/mapper/function/ConfigMapper.java | 46 ++--
.../mapper/function/HealthCheckResultMapper.java | 62 +++---
.../console/mapper/function/OprLogMapper.java | 21 +-
.../console/mapper/message/OprGroupMapper.java | 24 +--
.../mapper/message/OprGroupMemberMapper.java | 60 +++---
.../console/mapper/message/TopicMapper.java | 11 +-
.../console/mapper/storage/StoreMapper.java | 27 +--
.../config/ConfigControllerMapper.java} | 24 +--
.../connection/ConnectionControllerMapper.java} | 28 +--
.../log/LogControllerMapper.java} | 18 +-
.../runtime/QueryRuntimeListByClusterIdDTO.java | 4 -
.../ChangeConfigEntity.java} | 8 +-
.../modle/{dto => }/config/UpdateConfigsLog.java | 6 +-
.../console/modle/dto/config/DetailConfigsVO.java | 4 -
.../modle/dto/config/GetConfigsListDTO.java | 4 -
.../console/modle/dto/config/UpdateConfigDTO.java | 8 +-
.../modle/dto/connection/CreateConnectionDTO.java | 11 +-
.../modle/dto/connection/GetConnectionListDTO.java | 4 -
.../console/modle/dto/log/GetLogListDTO.java | 4 -
.../console/modle/dto/meta/NewMetaDTO.java | 4 -
.../console/modle/dto/topic/GetTopicListDTO.java | 4 -
.../modle/vo/cluster/GetClusterBaseMessageVO.java | 4 -
.../console/modle/vo/cluster/ResourceNumVO.java | 4 -
.../modle/vo/connection/ConnectionListVO.java | 4 -
.../modle/vo/health/InstanceLiveProportionVo.java | 4 -
.../console/modle/vo/topic/TopicDetailGroupVO.java | 4 -
.../dashboard/console/service/OverviewService.java | 4 +-
.../console/service/cluster/ClientDataService.java | 8 +-
.../cluster/ClusterRelationshipService.java | 2 +-
.../console/service/cluster/ClusterService.java | 7 +-
.../service/cluster/ConnectionDataService.java | 16 +-
.../console/service/cluster/RuntimeService.java | 10 +-
.../cluster/impl/ClientDataServiceImpl.java | 17 +-
.../impl/ClusterRelationshipServiceImpl.java | 4 +-
.../service/cluster/impl/ClusterServiceImpl.java | 16 +-
.../impl/ConnectionDataServiceDatabaseImpl.java | 231 +++++++++++++++++++++
.../service/cluster/impl/RuntimeServiceImpl.java | 22 +-
.../service/connector/ConnectorDataService.java | 2 +-
.../connector/Impl/ConnectorDataServiceImpl.java | 4 +-
.../console/service/function/ConfigService.java | 14 +-
.../service/function/HealthDataService.java | 10 +-
.../service/function/Impl/ConfigServiceImpl.java | 80 +++----
.../Impl/HealthDataServiceDatabaseImpl.java | 42 ++--
.../service/function/Impl/LogServiceImpl.java | 15 +-
.../console/service/function/LogService.java | 6 +-
.../service/message/GroupMemberService.java | 10 +-
.../console/service/message/GroupService.java | 6 +-
.../console/service/message/TopicService.java | 8 +-
.../message/impl/GroupMemberServiceImp.java | 18 +-
.../service/message/impl/GroupServiceImpl.java | 12 +-
.../service/message/impl/TopicServiceImpl.java | 21 +-
.../service/store/Impl/StoreServiceImpl.java | 18 +-
.../console/service/store/StoreService.java | 10 +-
.../dashboard/console/linkage/log/TestOprLog.java | 4 +-
.../ConnectionDataServiceDatabaseImplTest.java | 3 +-
82 files changed, 780 insertions(+), 643 deletions(-)
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 2eca480..6a4eee1 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,9 +17,11 @@
package org.apache.eventmesh.dashboard.console.controller;
+
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.AddConnectionDTO;
+import org.apache.eventmesh.dashboard.console.mapstruct.connection.ConnectionControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.CreateConnectionDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.GetConnectionListDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
@@ -32,9 +34,11 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
+@RequestMapping("/cluster/connection")
public class ConnectionController {
@Autowired
@@ -46,28 +50,27 @@ public class ConnectionController {
* @param type
* @return
*/
- @GetMapping("/cluster/connection/getConnectorBusinessType")
+ @GetMapping("/getConnectorBusinessType")
public List<String> getConnectorBusinessType(String type) {
return connectionDataService.getConnectorBusinessType(type);
}
- @GetMapping("/cluster/connection/getConnectorConfigs")
+ @GetMapping("/getConnectorConfigs")
public List<ConfigEntity> getConnectorConfigsByClassAndVersion(String version, String classType) {
return connectionDataService.getConnectorConfigsByClassAndVersion(classType, version);
}
- @GetMapping("/cluster/connection/showCreateConnectionMessage")
- public AddConnectionDTO showCreateConnectionMessage() {
- return new AddConnectionDTO();
+ @GetMapping("/showCreateConnectionMessage")
+ public AddConnectionEntity showCreateConnectionMessage() {
+ return new AddConnectionEntity();
}
- @PostMapping("/cluster/connection/createConnection")
+ @PostMapping("/createConnection")
public String createConnection(@Validated @RequestBody CreateConnectionDTO createConnectionDTO) {
try {
- connectionDataService.createConnection(createConnectionDTO);
-
+ connectionDataService.createConnection(ConnectionControllerMapper.INSTANCE.queryCreateEntityByConnection(createConnectionDTO));
} catch (Exception e) {
return e.getMessage();
}
@@ -75,12 +78,12 @@ public class ConnectionController {
}
- @PostMapping("/cluster/connection/getConnectionList")
+ @PostMapping("/getConnectionList")
public List<ConnectionListVO> getConnectionList(@Validated @RequestBody GetConnectionListDTO getConnectionListDTO) {
- return connectionDataService.getConnectionToFrontByCluster(getConnectionListDTO.getClusterId(), getConnectionListDTO);
+ return connectionDataService.getConnectionToFrontByCluster(ConnectionControllerMapper.INSTANCE.queryEntityByConnection(getConnectionListDTO));
}
- @GetMapping("/cluster/connection/getConnectorDetail")
+ @GetMapping("/getConnectorDetail")
public ConnectorEntity getConnectorDetail(Long connectorId) {
return connectionDataService.getConnectorById(connectorId);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
index 983d337..863655b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterController.java
@@ -43,12 +43,9 @@ public class ClusterController {
@Autowired
ClusterService clusterService;
-
-
-
@GetMapping("queryHomeClusterData")
public GetClusterBaseMessageVO queryHomeClusterData(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
- return clusterService.getClusterBaseMessage(clusterIdDTO);
+ return clusterService.selectClusterBaseMessage(clusterIdDTO.getClusterId());
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
index 1db255d..9dba50f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/ClusterRelationshipController.java
@@ -40,7 +40,7 @@ public class ClusterRelationshipController {
@PostMapping("addClusterRelationshipEntry")
public void addClusterRelationshipEntry(@RequestBody ClusterRelationshipEntity clusterRelationshipEntity) {
- this.clusterRelationshipService.addClusterRelationshipEntry(clusterRelationshipEntity);
+ this.clusterRelationshipService.insertClusterRelationshipEntry(clusterRelationshipEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
index 3102a5a..fe6647d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/cluster/RuntimeController.java
@@ -44,7 +44,7 @@ public class RuntimeController {
@PostMapping("/queryRuntimeListByClusterId")
public List<RuntimeEntity> queryRuntimeListByClusterId(@Validated @RequestBody ClusterIdDTO clusterIdDTO) {
List<RuntimeEntity> runtimeEntityList =
- runtimeService.getRuntimeToFrontByClusterId(RuntimeControllerMapper.INSTANCE.queryRuntimeListByClusterId(clusterIdDTO));
+ runtimeService.selectRuntimeToFrontByClusterId(RuntimeControllerMapper.INSTANCE.queryRuntimeListByClusterId(clusterIdDTO));
runtimeEntityList.forEach(n -> {
n.setStatus(CheckResultCache.getINSTANCE().getLastHealthyCheckResult("runtime", n.getId()));
});
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
index 3dbb3ce..31c36e3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/ConfigController.java
@@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.config.ConfigControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.dto.config.DetailConfigsVO;
import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.config.UpdateConfigDTO;
@@ -31,19 +32,21 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
+@RequestMapping("/cluster/config")
public class ConfigController {
@Autowired
private ConfigService configService;
- @PostMapping("/cluster/config/updateConfigs")
+ @PostMapping("/updateConfigs")
public String updateConfigsByTypeAndId(@Validated @RequestBody UpdateConfigDTO updateConfigDTO) {
try {
configService.updateConfigsByInstanceId(updateConfigDTO.getUsername(), updateConfigDTO.getClusterId(), updateConfigDTO.getInstanceType(),
- updateConfigDTO.getInstanceId(), updateConfigDTO.getChangeConfigDTOS());
+ updateConfigDTO.getInstanceId(), updateConfigDTO.getChangeConfigEntities());
} catch (Exception e) {
return e.getMessage();
}
@@ -51,12 +54,10 @@ public class ConfigController {
}
- @PostMapping("/cluster/config/getInstanceDetailConfigs")
+ @PostMapping("/getInstanceDetailConfigs")
public List<DetailConfigsVO> getInstanceDetailConfigs(@Validated @RequestBody GetConfigsListDTO getConfigsListDTO) {
- List<ConfigEntity> configEntityList = configService.selectToFront(getConfigsListDTO.getInstanceId(),
- getConfigsListDTO.getInstanceType(), getConfigsListDTO);
- Map<String, String> stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType(),
- getConfigsListDTO.getInstanceId(), getConfigsListDTO.getInstanceType());
+ List<ConfigEntity> configEntityList = configService.selectToFront(ConfigControllerMapper.INSTANCE.queryEntityByConfig(getConfigsListDTO));
+ Map<String, String> stringStringConcurrentHashMap = configService.selectDefaultConfig(getConfigsListDTO.getBusinessType());
ArrayList<DetailConfigsVO> showDetailConfigsVOS = new ArrayList<>();
configEntityList.forEach(n -> {
DetailConfigsVO showDetailConfigsVO = new DetailConfigsVO();
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
index b88906a..4a96974 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/HealthController.java
@@ -26,21 +26,23 @@ 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.RestController;
@RestController
+@RequestMapping("/cluster/health")
public class HealthController {
@Autowired
HealthDataService healthDataService;
- @GetMapping("/cluster/health/getHistoryLiveStatus")
+ @GetMapping("/getHistoryLiveStatus")
public List<HealthCheckResultEntity> getHistoryLiveStatusById(Integer type, Long instanceId, String startTime) {
- return healthDataService.getInstanceLiveStatusHistory(type, instanceId, LocalDateTime.parse(startTime));
+ return healthDataService.selectInstanceLiveStatusHistory(type, instanceId, LocalDateTime.parse(startTime));
}
- @GetMapping("/cluster/health/getInstanceLiveProportion")
+ @GetMapping("/getInstanceLiveProportion")
public InstanceLiveProportionVo getInstanceLiveProportion(Integer instanceType, Long theClusterId) {
- return healthDataService.getInstanceLiveProportion(theClusterId, instanceType);
+ return healthDataService.selectInstanceLiveProportion(theClusterId, instanceType);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
index 1b048a2..36ec3d0 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/function/LogController.java
@@ -18,6 +18,7 @@
package org.apache.eventmesh.dashboard.console.controller.function;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
+import org.apache.eventmesh.dashboard.console.mapstruct.log.LogControllerMapper;
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
import org.apache.eventmesh.dashboard.console.service.function.LogService;
@@ -27,17 +28,19 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
+@RequestMapping("/cluster/log")
public class LogController {
@Autowired
private LogService logService;
- @PostMapping("/cluster/log/getList")
+ @PostMapping("/getList")
public List<LogEntity> getLogLIstToFront(@Validated @RequestBody GetLogListDTO getLogListDTO) {
- return logService.getLogListByCluster(getLogListDTO);
+ return logService.selectLogListByCluster(LogControllerMapper.INSTANCE.queryEntityByLog(getLogListDTO));
}
-}
\ No newline at end of file
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
index 94c983c..a2f8c7b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/GroupController.java
@@ -47,7 +47,7 @@ public class GroupController {
@PostMapping("queryGroupListByClusterId")
public List<GroupEntity> queryGroupListByClusterId(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
- return groupService.getGroupByClusterId(GroupControllerMapper.INSTANCE.queryGroupListByClusterId(clusterIdDTO));
+ return groupService.selectGroupByClusterId(GroupControllerMapper.INSTANCE.queryGroupListByClusterId(clusterIdDTO));
}
@PostMapping("deleteGroupById")
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
index a6d2709..25353a2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/controller/message/TopicController.java
@@ -46,7 +46,7 @@ public class TopicController {
@PostMapping("/queryTopicListByClusterId")
public List<TopicEntity> queryTopicListByClusterId(@Validated @RequestBody GetTopicListDTO getTopicListDTO) {
- return topicService.getTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
+ return topicService.selectTopicListToFront(TopicControllerMapper.INSTANCE.queryTopicListByClusterId(getTopicListDTO));
}
@PostMapping("queryTopicListById ")
@@ -72,7 +72,7 @@ public class TopicController {
*/
@GetMapping("/cluster/topic/getTopicDetailGroups")
public List<TopicDetailGroupVO> getTopicDetailGroups(Long topicId) {
- return topicService.getTopicDetailGroups(topicId);
+ return topicService.selectTopicDetailGroups(topicId);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java
similarity index 71%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java
index 9efb4cf..1f453fe 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/CreateConnectionEntity.java
@@ -17,17 +17,17 @@
package org.apache.eventmesh.dashboard.console.entity;
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectorConfigEntity;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
-public class DefaultConfigKey {
+public class CreateConnectionEntity {
- private String businessType;
+ private Long clusterId;
- private String configName;
+ private AddConnectionEntity addConnectionEntity;
+
+ private AddConnectorConfigEntity addConnectorConfigEntity;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
index 9efb4cf..c4f2e8c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/DefaultConfigKey.java
@@ -18,12 +18,8 @@
package org.apache.eventmesh.dashboard.console.entity;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class DefaultConfigKey {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectionDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectionEntity.java
similarity index 85%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectionDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectionEntity.java
index 0a7c23e..917462a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectionDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectionEntity.java
@@ -15,16 +15,12 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.connection;
+package org.apache.eventmesh.dashboard.console.entity.connection;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
-public class AddConnectionDTO {
+public class AddConnectionEntity {
private String sinkName;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectorConfigEntity.java
similarity index 83%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectorConfigEntity.java
index 8ffc2ce..291fe8c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/connection/AddConnectorConfigEntity.java
@@ -15,20 +15,16 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.connection;
+package org.apache.eventmesh.dashboard.console.entity.connection;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
import java.util.List;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
-public class AddConnectorConfigDTO {
+public class AddConnectorConfigEntity {
private List<ConfigEntity> sinkConnectorConfigs;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
index b08053e..657d217 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/HealthCheckResultEntity.java
@@ -22,18 +22,12 @@ import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
@Data
@EqualsAndHashCode(callSuper = true, exclude = "resultDesc")
-@Builder
-@AllArgsConstructor
-@NoArgsConstructor
@Schema(name = "HealthCheckResultEntity", description = "Health check result entity")
public class HealthCheckResultEntity extends BaseEntity {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/LogEntity.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/LogEntity.java
index eb38abf..7a07089 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/LogEntity.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/entity/function/LogEntity.java
@@ -22,14 +22,10 @@ import org.apache.eventmesh.dashboard.console.entity.BaseEntity;
import java.sql.Timestamp;
-import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
-import lombok.NoArgsConstructor;
@Data
-@NoArgsConstructor
-@AllArgsConstructor
@EqualsAndHashCode(callSuper = true, exclude = {"endTime", "operationUser", "result"})
public class LogEntity extends BaseEntity {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthService.java
index d8fa839..a28b0e3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/health/HealthService.java
@@ -273,13 +273,13 @@ public class HealthService {
.host(store.getHost())
.port(store.getPort())
.build());
- checkResultEntities.add(HealthCheckResultEntity.builder()
- .clusterId(store.getClusterId())
- .type(4)
- .typeId(store.getId())
- .state(4)
- .resultDesc("initializing check client")
- .build());
+ HealthCheckResultEntity healthCheckResultEntity = new HealthCheckResultEntity();
+ healthCheckResultEntity.setClusterId(store.getClusterId());
+ healthCheckResultEntity.setType(4);
+ healthCheckResultEntity.setTypeId(store.getId());
+ healthCheckResultEntity.setState(4);
+ healthCheckResultEntity.setResultDesc("initializing check client");
+ checkResultEntities.add(healthCheckResultEntity);
}
dataServiceWrapper.getHealthDataService().batchInsertNewCheckResult(checkResultEntities);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/handler/db/RuntimeMetadataHandlerToDbImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/handler/db/RuntimeMetadataHandlerToDbImpl.java
index 98c78cd..c8c064e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/handler/db/RuntimeMetadataHandlerToDbImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/function/metadata/handler/db/RuntimeMetadataHandlerToDbImpl.java
@@ -59,10 +59,10 @@ public class RuntimeMetadataHandlerToDbImpl implements MetadataHandler<RuntimeMe
clusterEntity.setDescription("");
clusterEntity.setAuthType(0);
clusterEntity.setRunState(0);
- clusterService.addCluster(clusterEntity);
+ clusterService.insertCluster(clusterEntity);
} else {
cluster.setName(meta.getClusterName());
- clusterService.addCluster(cluster);
+ clusterService.insertCluster(cluster);
}
if (Objects.isNull(meta.getClusterId())) {
//meta.setClusterId(ClusterCache.getINSTANCE().getClusterByName(meta.getClusterName()).getId());
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
index e1066b7..bd61b8d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/log/OprLog.java
@@ -66,7 +66,7 @@ public class OprLog implements Ordered, ApplicationContextAware {
return joinPoint.proceed();
}
LogEntity logEntity = this.productLoEntity(declaredAnnotation, joinPoint);
- logService.addLog(logEntity);
+ logService.insertLog(logEntity);
logEntity.setEndTime(new Timestamp(System.currentTimeMillis()));
Object proceed = null;
try {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
index c69758c..92332df 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/AclMapper.java
@@ -33,6 +33,18 @@ import java.util.List;
@Mapper
public interface AclMapper {
+ @Select("SELECT * FROM acl WHERE id=#{id}")
+ AclEntity selectById(AclEntity aclEntity);
+
+ @Select("SELECT * FROM acl")
+ List<AclEntity> selectAll();
+
+ @Update("UPDATE acl SET resource_type=#{resourceType} WHERE id=#{id}")
+ void updateResourceTypeById(AclEntity aclEntity);
+
+ @Update("UPDATE acl SET status=0 WHERE id=#{id}")
+ void deleteById(AclEntity aclEntity);
+
@Insert({
"<script>",
" INSERT INTO acl (cluster_Id, pattern, operation, permission_Type, host, resource_Type, resource_Name, pattern_Type) VALUES ",
@@ -43,22 +55,12 @@ public interface AclMapper {
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<AclEntity> aclEntities);
+ Integer batchInsert(List<AclEntity> aclEntities);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert("INSERT INTO acl (cluster_id, pattern, operation, permission_type, host, resource_type, resource_name, pattern_type)"
+ "VALUE (#{clusterId}, #{pattern}, #{operation}, #{permissionType}, #{host}, #{resourceType}, #{resourceName}, #{patternType})")
void insert(AclEntity aclEntity);
- @Update("UPDATE acl SET status=0 WHERE id=#{id}")
- void deleteById(AclEntity aclEntity);
-
- @Update("UPDATE acl SET resource_type=#{resourceType} WHERE id=#{id}")
- void updateResourceTypeById(AclEntity aclEntity);
- @Select("SELECT * FROM acl")
- List<AclEntity> selectAll();
-
- @Select("SELECT * FROM acl WHERE id=#{id}")
- AclEntity selectById(AclEntity aclEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
index 1fa5a96..d75f78f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClientMapper.java
@@ -35,6 +35,21 @@ import java.util.List;
public interface ClientMapper {
+ @Select("SELECT * FROM `client` WHERE `host` = #{host} AND `port` = #{port} AND status = 1")
+ List<ClientEntity> selectByHostPort(ClientEntity clientEntity);
+
+ @Select("SELECT * FROM `client` WHERE `id` = #{id}")
+ ClientEntity selectById(ClientEntity clientEntity);
+
+ @Select("SELECT * FROM `client` WHERE `cluster_id` = #{clusterId}")
+ List<ClientEntity> selectByClusterId(ClientEntity clientEntity);
+
+ @Update("UPDATE `client` SET status = 0, end_time = NOW() WHERE id = #{id}")
+ Integer deactivate(ClientEntity clientEntity);
+
+ @Update("UPDATE `client` SET status = 0, end_time = NOW() WHERE `host` = #{host} AND `port` = #{port}")
+ Integer deActiveByHostPort(ClientEntity clientEntity);
+
@Select({
"<script>",
" INSERT INTO client (cluster_id, name, platform, language, pid, host, port, protocol, status,",
@@ -45,16 +60,7 @@ public interface ClientMapper {
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<ClientEntity> clientEntityList);
-
- @Select("SELECT * FROM `client` WHERE `host` = #{host} AND `port` = #{port} AND status = 1")
- List<ClientEntity> selectByHostPort(ClientEntity clientEntity);
-
- @Select("SELECT * FROM `client` WHERE `id` = #{id}")
- ClientEntity selectById(ClientEntity clientEntity);
-
- @Select("SELECT * FROM `client` WHERE `cluster_id` = #{clusterId}")
- List<ClientEntity> selectByClusterId(ClientEntity clientEntity);
+ Integer batchInsert(List<ClientEntity> clientEntityList);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert(
@@ -65,12 +71,7 @@ public interface ClientMapper {
+ "#{language}, #{pid}, #{host}, #{port}, #{protocol},"
+ "#{status}, #{configIds}, #{description})"
+ "ON DUPLICATE KEY UPDATE `status` = 1, `pid` = #{pid}, `config_ids` = #{configIds}, `host` = #{host}, `port` = #{port}")
- Long insert(ClientEntity clientEntity);
+ void insert(ClientEntity clientEntity);
- @Update("UPDATE `client` SET status = 0, end_time = NOW() WHERE id = #{id}")
- void deactivate(ClientEntity clientEntity);
-
- @Update("UPDATE `client` SET status = 0, end_time = NOW() WHERE `host` = #{host} AND `port` = #{port}")
- void deActiveByHostPort(ClientEntity clientEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
index d553204..a59c1a7 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterMapper.java
@@ -32,7 +32,9 @@ import java.util.Map;
/**
* cluster table operation
+ *
*/
+
@Mapper
public interface ClusterMapper {
@@ -45,17 +47,6 @@ public interface ClusterMapper {
@Select("SELECT * FROM cluster where update_time > #{updateTime}")
List<ClusterEntity> selectClusterByUpdate(@Param("updateTime") long updateTime);
- @Insert({
- "<script>",
- " insert into cluster (name,trusteeship_type, cluster_type, version, jmx_properties, description, auth_type) values ",
- " <foreach collection='list' item='c' index='index' separator=','>",
- " (#{c.name}, #{c.trusteeshipType}, #{c.clusterType}, #{c.version}, , #{c.jmxProperties}, #{c.description}, #{c.authType})",
- " </foreach>",
- "</script>"})
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Integer batchInsert(List<ClusterEntity> clusterEntities);
-
-
@Select({
"<script>",
"",
@@ -64,14 +55,6 @@ public interface ClusterMapper {
})
Map<String, Integer> queryHomeClusterData(ClusterIdDTO clusterIdDTO);
-
- @Insert({
- "insert into cluster(name,trusteeship_type,cluster_type,version,jmx_properties,description,auth_type)values",
- "(#{name},#{c.trusteeshipType},#{c.clusterType},#{c.version},#{jmxProperties},#{regProperties},#{description},#{authType})"
- })
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Integer insertCluster(ClusterEntity cluster);
-
@Update({"update cluster set name=#{name},jmx_properties=#{jmxProperties},description=#{description},auth_type=#{authType},run_state=#{runState}",
" where id=#{id}"
})
@@ -80,6 +63,21 @@ public interface ClusterMapper {
@Update("UPDATE cluster SET status=0 WHERE id=#{id}")
Integer deactivate(ClusterEntity clusterEntity);
+ @Insert({
+ "<script>",
+ " insert into cluster (name,trusteeship_type, cluster_type, version, jmx_properties, description, auth_type) values ",
+ " <foreach collection='list' item='c' index='index' separator=','>",
+ " (#{c.name}, #{c.trusteeshipType}, #{c.clusterType}, #{c.version}, , #{c.jmxProperties}, #{c.description}, #{c.authType})",
+ " </foreach>",
+ "</script>"})
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer batchInsert(List<ClusterEntity> clusterEntities);
+ @Insert({
+ "insert into cluster(name,trusteeship_type,cluster_type,version,jmx_properties,description,auth_type)values",
+ "(#{name},#{c.trusteeshipType},#{c.clusterType},#{c.version},#{jmxProperties},#{regProperties},#{description},#{authType})"
+ })
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void insertCluster(ClusterEntity cluster);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterRelationshipMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterRelationshipMapper.java
index f741ee8..a0ea6c2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterRelationshipMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ClusterRelationshipMapper.java
@@ -33,17 +33,6 @@ import java.util.List;
@Mapper
public interface ClusterRelationshipMapper {
-
- @Insert({
- " insert into cluster_relationship (cluster_type,cluster_id,relationship_type,relationship_id)values( #{clusterType},#{clusterId},",
- "#{relationshipType},#{relationshipId})"
- })
- Integer addClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity);
-
- @Update("update cluster_relationship set status = 3 where id = #{id} ")
- Integer relieveRelationship(ClusterRelationshipEntity clusterRelationshipEntity);
-
-
@Select({
"<script>",
" select * from cluster as c inner join cluster_relationship as cr on c.id = c where cr.cluster_id ",
@@ -62,4 +51,16 @@ public interface ClusterRelationshipMapper {
@Select(" select * from cluster_relationship where update_time = #{updateTime} and status in( 2 ,3)")
List<ClusterRelationshipEntity> selectNewlyIncreased();
+
+ @Update("update cluster_relationship set status = 3 where id = #{id} ")
+ Integer relieveRelationship(ClusterRelationshipEntity clusterRelationshipEntity);
+
+ @Insert({
+ " insert into cluster_relationship (cluster_type,cluster_id,relationship_type,relationship_id)values( #{clusterType},#{clusterId},",
+ "#{relationshipType},#{relationshipId})"
+ })
+ void insertClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity);
+
+
}
+
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ConnectionMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ConnectionMapper.java
index fee28ef..c9bab4c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ConnectionMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/ConnectionMapper.java
@@ -73,12 +73,24 @@ public interface ConnectionMapper {
public List<ConnectionEntity> selectByClusterIdSinkTypeAndSinkIdAndCreateTimeRange(ConnectionEntity connectionEntity,
@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
+ @Update("UPDATE connection SET status = 1, end_time = NOW() WHERE id = #{id}")
+ Integer endConnectionById(ConnectionEntity connectionEntity);
+
+ //batch end
+ @Update({
+ "<script>",
+ " <foreach collection='list' item='connectionEntity' index='index' separator=';'>",
+ " UPDATE connection SET status = 1, end_time = NOW() WHERE id = #{connectionEntity.id}",
+ " </foreach>",
+ "</script>"})
+ Integer batchEndConnectionById(List<ConnectionEntity> connectionEntityList);
+
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert("INSERT INTO connection (cluster_id, source_type, source_id," + " sink_type, sink_id, runtime_id, status, topic, group_id, description)"
+ " VALUES ( #{clusterId}, #{sourceType}, #{sourceId}, "
+ " #{sinkType}, #{sinkId}, #{runtimeId}, 1, #{topic}, #{groupId}, #{description})"
+ "ON DUPLICATE KEY UPDATE status = 1")
- Long insert(ConnectionEntity connectionEntity);
+ void insert(ConnectionEntity connectionEntity);
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
@Insert({
@@ -92,18 +104,7 @@ public interface ConnectionMapper {
" </foreach>",
"ON DUPLICATE KEY UPDATE status = 1",
"</script>"})
- void batchInsert(List<ConnectionEntity> connectionEntityList);
+ Integer batchInsert(List<ConnectionEntity> connectionEntityList);
- @Update("UPDATE connection SET status = 1, end_time = NOW() WHERE id = #{id}")
- void endConnectionById(ConnectionEntity connectionEntity);
-
- //batch end
- @Update({
- "<script>",
- " <foreach collection='list' item='connectionEntity' index='index' separator=';'>",
- " UPDATE connection SET status = 1, end_time = NOW() WHERE id = #{connectionEntity.id}",
- " </foreach>",
- "</script>"})
- void batchEndConnectionById(List<ConnectionEntity> connectionEntityList);
-}
\ No newline at end of file
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/InstanceUserMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/InstanceUserMapper.java
index e5a838e..f9d8ff8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/InstanceUserMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/InstanceUserMapper.java
@@ -33,17 +33,6 @@ import java.util.List;
@Mapper
public interface InstanceUserMapper {
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- @Insert("INSERT INTO instance_user (id, instance_type, password, cluster_id, name, token, status) "
- + "VALUES (#{id}, #{instanceType}, #{password}, #{clusterId}, #{name}, #{token},1)")
- void insert(InstanceUserEntity instanceuserEntity);
-
- @Update("UPDATE instance_user SET status=0 WHERE id=#{clusterId}")
- void deleteInstanceUserById(InstanceUserEntity instanceuserEntity);
-
- @Update("UPDATE instance_user SET password=#{password} WHERE id=#{id}")
- void updatePasswordById(InstanceUserEntity instanceuserentity);
-
@Select("select * from instance_user where status=1")
List<InstanceUserEntity> selectAll();
@@ -53,4 +42,15 @@ public interface InstanceUserMapper {
@Select("SELECT * FROM instance_user WHERE name=#{name} AND status=1")
List<InstanceUserEntity> selectByName(InstanceUserEntity instanceuserEntity);
+ @Update("UPDATE instance_user SET status=0 WHERE id=#{clusterId}")
+ Integer deleteInstanceUserById(InstanceUserEntity instanceuserEntity);
+
+ @Update("UPDATE instance_user SET password=#{password} WHERE id=#{id}")
+ Integer updatePasswordById(InstanceUserEntity instanceuserentity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("INSERT INTO instance_user (id, instance_type, password, cluster_id, name, token, status) "
+ + "VALUES (#{id}, #{instanceType}, #{password}, #{clusterId}, #{name}, #{token},1)")
+ void insert(InstanceUserEntity instanceuserEntity);
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/NetConnectionMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/NetConnectionMapper.java
index e6fea12..865b895 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/NetConnectionMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/NetConnectionMapper.java
@@ -28,13 +28,14 @@ import java.util.List;
* 1. 添加 and 修改。没有控制层接口
* 2. 按照 cluster or runtime id and client(host and port) 查询
* 3. 按照时间进行统计
+ *
*/
@Mapper
public interface NetConnectionMapper {
+ List<NetConnectionEntity> queryNetConnectionEntityListByFrom(NetConnectionEntity netConnectionEntity);
Integer batchInsert(List<NetConnectionEntity> netConnectionEntityList);
- List<NetConnectionEntity> queryNetConnectionEntityListByFrom(NetConnectionEntity netConnectionEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/RuntimeMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/RuntimeMapper.java
index f27977d..ed45126 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/RuntimeMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/cluster/RuntimeMapper.java
@@ -35,27 +35,11 @@ import java.util.List;
public interface RuntimeMapper {
@Select("SELECT COUNT(*) FROM runtime WHERE cluster_id=#{clusterId} AND status=1")
- Integer getRuntimeNumByCluster(RuntimeEntity runtimeEntity);
+ Integer selectRuntimeNumByCluster(RuntimeEntity runtimeEntity);
@Select("SELECT * FROM runtime WHERE status=1")
List<RuntimeEntity> selectAll();
- @Insert({
- "<script>",
- " INSERT INTO runtime (cluster_id, host, storage_cluster_id, port, jmx_port, start_timestamp, rack, status, endpoint_map) VALUES",
- " <foreach collection='list' item='c' index='index' separator=','>",
- " (#{c.clusterId},#{c.host},#{c.storageClusterId},#{c.port},#{c.jmxPort},NOW(),#{c.rack},#{c.status},#{c.endpointMap})",
- " </foreach>",
- "</script>"})
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<RuntimeEntity> runtimeEntities);
-
- @Insert("INSERT INTO runtime (cluster_id, host, storage_cluster_id, port, jmx_port, start_timestamp, rack, status, "
- + "endpoint_map) VALUES(#{clusterId},#{host},#{storageClusterId},#{port},#{jmxPort},NOW(),#{rack},#{status},#{endpointMap})"
- + " ON DUPLICATE KEY UPDATE status=1,start_timestamp = now()")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addRuntime(RuntimeEntity runtimeEntity);
-
@Select("select * from runtime where cluster_id=#{clusterid} and status=1")
List<RuntimeEntity> selectRuntimeByCluster(RuntimeEntity runtimeEntity);
@@ -73,18 +57,34 @@ public interface RuntimeMapper {
"</if>",
"</where>",
"</script>"})
- List<RuntimeEntity> getRuntimesToFrontByCluster(@Param("runtimeEntity") RuntimeEntity runtimeEntity);
+ List<RuntimeEntity> selectRuntimesToFrontByCluster(@Param("runtimeEntity") RuntimeEntity runtimeEntity);
@Select("SELECT * FROM runtime WHERE host = #{host} and port = #{port} and status = 1")
List<RuntimeEntity> selectByHostPort(RuntimeEntity runtimeEntity);
@Update("UPDATE runtime SET port=#{port} ,jmx_port=#{jmxPort} ,status=#{status} WHERE cluster_id=#{clusterId} AND status=1")
- void updateRuntimeByCluster(RuntimeEntity runtimeEntity);
+ Integer updateRuntimeByCluster(RuntimeEntity runtimeEntity);
@Update("UPDATE runtime SET status=0 WHERE cluster_id=#{clusterId}")
- void deleteRuntimeByCluster(RuntimeEntity runtimeEntity);
+ Integer deleteRuntimeByCluster(RuntimeEntity runtimeEntity);
@Update("UPDATE runtime SET status = 0 WHERE id = #{id}")
- void deactivate(RuntimeEntity runtimeEntity);
+ Integer deactivate(RuntimeEntity runtimeEntity);
+
+ @Insert({
+ "<script>",
+ " INSERT INTO runtime (cluster_id, host, storage_cluster_id, port, jmx_port, start_timestamp, rack, status, endpoint_map) VALUES",
+ " <foreach collection='list' item='c' index='index' separator=','>",
+ " (#{c.clusterId},#{c.host},#{c.storageClusterId},#{c.port},#{c.jmxPort},NOW(),#{c.rack},#{c.status},#{c.endpointMap})",
+ " </foreach>",
+ "</script>"})
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer batchInsert(List<RuntimeEntity> runtimeEntities);
+
+ @Insert("INSERT INTO runtime (cluster_id, host, storage_cluster_id, port, jmx_port, start_timestamp, rack, status, "
+ + "endpoint_map) VALUES(#{clusterId},#{host},#{storageClusterId},#{port},#{jmxPort},NOW(),#{rack},#{status},#{endpointMap})"
+ + " ON DUPLICATE KEY UPDATE status=1,start_timestamp = now()")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void insertRuntime(RuntimeEntity runtimeEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
index 910884f..1c9d7be 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/connector/ConnectorMapper.java
@@ -45,38 +45,20 @@ public interface ConnectorMapper {
@Select("SELECT * FROM connector WHERE host = #{host} AND port = #{port} AND status=1")
List<ConnectorEntity> selectByHostAndPort(ConnectorEntity connectorEntity);
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- @Insert("INSERT INTO connector (cluster_id,name, class_name, type, status, pod_state, config_ids, host, port) "
- + "VALUES (#{clusterId}, #{name}, #{className}, #{type}, #{status}, #{podState}, #{configIds}, #{host}, #{port})"
- + "ON DUPLICATE KEY UPDATE status = 1, pod_state = #{podState}, config_ids = #{configIds}, host = #{host}, port = #{port}")
- Long insert(ConnectorEntity connectorEntity);
-
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- @Insert({
- "<script>",
- " INSERT INTO connector (cluster_id, name, class_name, type, status, pod_state, config_ids, host, port) VALUES ",
- " <foreach collection='list' item='connectorEntity' index='index' separator=','>",
- " (#{connectorEntity.clusterId}, #{connectorEntity.name}, #{connectorEntity.className},",
- " #{connectorEntity.type}, #{connectorEntity.status}, #{connectorEntity.podState}, ",
- " #{connectorEntity.configIds}, #{connectorEntity.host}, #{connectorEntity.port})",
- " </foreach>",
- "</script>"})
- void batchInsert(List<ConnectorEntity> connectorEntityList);
-
@Update("UPDATE connector SET status = 1 WHERE id = #{id}")
- void active(ConnectorEntity connectorEntity);
+ Integer active(ConnectorEntity connectorEntity);
@Update("UPDATE connector SET status = 0 WHERE id = #{id}")
- void deActive(ConnectorEntity connectorEntity);
+ Integer deActive(ConnectorEntity connectorEntity);
@Update("UPDATE connector SET pod_state = #{podState} WHERE id = #{id}")
- void updatePodState(ConnectorEntity connectorEntity);
+ Integer updatePodState(ConnectorEntity connectorEntity);
@Update("UPDATE connector SET config_ids = #{configIds} WHERE id = #{id}")
- void updateConfigIds(ConnectorEntity connectorEntity);
+ Integer updateConfigIds(ConnectorEntity connectorEntity);
@Update("UPDATE connector SET status = 0 WHERE cluster_id = #{clusterId}")
- void deactivateByClusterId(ConnectorEntity connectorEntity);
+ Integer deactivateByClusterId(ConnectorEntity connectorEntity);
@Update({
"<script>",
@@ -87,5 +69,24 @@ public interface ConnectorMapper {
" </foreach>",
"</script>"
})
- void batchDeactivate(List<ConnectorEntity> connectorEntities);
+ Integer batchDeactivate(List<ConnectorEntity> connectorEntities);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert("INSERT INTO connector (cluster_id,name, class_name, type, status, pod_state, config_ids, host, port) "
+ + "VALUES (#{clusterId}, #{name}, #{className}, #{type}, #{status}, #{podState}, #{configIds}, #{host}, #{port})"
+ + "ON DUPLICATE KEY UPDATE status = 1, pod_state = #{podState}, config_ids = #{configIds}, host = #{host}, port = #{port}")
+ void insert(ConnectorEntity connectorEntity);
+
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ @Insert({
+ "<script>",
+ " INSERT INTO connector (cluster_id, name, class_name, type, status, pod_state, config_ids, host, port) VALUES ",
+ " <foreach collection='list' item='connectorEntity' index='index' separator=','>",
+ " (#{connectorEntity.clusterId}, #{connectorEntity.name}, #{connectorEntity.className},",
+ " #{connectorEntity.type}, #{connectorEntity.status}, #{connectorEntity.podState}, ",
+ " #{connectorEntity.configIds}, #{connectorEntity.host}, #{connectorEntity.port})",
+ " </foreach>",
+ "</script>"})
+ Integer batchInsert(List<ConnectorEntity> connectorEntityList);
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
index 85f6bcf..119c5ae 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/ConfigMapper.java
@@ -49,7 +49,7 @@ public interface ConfigMapper {
"</if>",
"</where>",
"</script>"})
- List<ConfigEntity> getConfigsToFrontWithDynamic(ConfigEntity configEntity);
+ List<ConfigEntity> selectConfigsToFrontWithDynamic(ConfigEntity configEntity);
@Select("SELECT * FROM config WHERE business_type=#{businessType} AND is_default=1")
List<ConfigEntity> selectConnectorConfigsByBusinessType(ConfigEntity configEntity);
@@ -57,13 +57,32 @@ public interface ConfigMapper {
@Select("SELECT DISTINCT business_type FROM config WHERE instance_type=2 AND is_default=1 AND business_type LIKE CONCAT('%',#{businessType},'%')")
List<String> selectConnectorBusinessType(ConfigEntity configEntity);
-
@Select("SELECT * FROM config WHERE status=1 AND is_default=0")
List<ConfigEntity> selectAll();
@Select("SELECT * FROM config WHERE instance_type=#{instanceType} AND instance_id=#{instanceId}")
List<ConfigEntity> selectConfigsByInstance(ConfigEntity configEntity);
+ @Select("SELECT * FROM config WHERE instance_type=#{instanceType} AND instance_id=#{instanceId} AND is_default=0")
+ List<ConfigEntity> selectByInstanceId(ConfigEntity configEntity);
+
+ @Select("SELECT * FROM config WHERE cluster_id=-1 AND business_type=#{businessType} AND instance_type=#{instanceType} AND is_default=1")
+ List<ConfigEntity> selectDefaultConfig(ConfigEntity configEntity);
+
+ @Select("SELECT * FROM config WHERE is_default=1")
+ List<ConfigEntity> selectAllDefaultConfig();
+
+ @Select("SELECT * FROM config WHERE cluster_id=#{clusterId} AND instance_type=#{instanceType} "
+ + "AND instance_id=#{instanceId} AND config_name=#{configName} AND status=1")
+ ConfigEntity selectByUnique(ConfigEntity configEntity);
+
+ @Update("UPDATE config SET status=0 WHERE id=#{id}")
+ Integer deleteConfig(ConfigEntity configEntity);
+
+ @Update("UPDATE config SET config_value=#{configValue} ,already_update=#{alreadyUpdate} WHERE instance_type=#{instanceType} AND"
+ + " instance_id=#{instanceId} AND config_name=#{configName} AND is_default=0")
+ Integer updateConfig(ConfigEntity configEntity);
+
@Insert({
"<script>",
" INSERT INTO config (cluster_id, business_type, instance_type, instance_id, config_name, config_value, start_version,",
@@ -75,7 +94,7 @@ public interface ConfigMapper {
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<ConfigEntity> configEntityList);
+ Integer batchInsert(List<ConfigEntity> configEntityList);
@Insert("INSERT INTO config (cluster_id, business_type, instance_type, instance_id, config_name, config_value, "
+ "status, is_default, diff_type, description, edit, is_modify,start_version,"
@@ -84,25 +103,6 @@ public interface ConfigMapper {
+ "#{configValue},#{status},#{isDefault},#{diffType},#{description},#{edit},#{isModify},"
+ "#{startVersion},#{eventmeshVersion},#{endVersion})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Integer addConfig(ConfigEntity configEntity);
-
- @Update("UPDATE config SET status=0 WHERE id=#{id}")
- Integer deleteConfig(ConfigEntity configEntity);
-
- @Update("UPDATE config SET config_value=#{configValue} ,already_update=#{alreadyUpdate} WHERE instance_type=#{instanceType} AND"
- + " instance_id=#{instanceId} AND config_name=#{configName} AND is_default=0")
- void updateConfig(ConfigEntity configEntity);
-
- @Select("SELECT * FROM config WHERE instance_type=#{instanceType} AND instance_id=#{instanceId} AND is_default=0")
- List<ConfigEntity> selectByInstanceId(ConfigEntity configEntity);
+ void insertConfig(ConfigEntity configEntity);
- @Select("SELECT * FROM config WHERE cluster_id=-1 AND business_type=#{businessType} AND instance_type=#{instanceType} AND is_default=1")
- List<ConfigEntity> selectDefaultConfig(ConfigEntity configEntity);
-
- @Select("SELECT * FROM config WHERE is_default=1")
- List<ConfigEntity> selectAllDefaultConfig();
-
- @Select("SELECT * FROM config WHERE cluster_id=#{clusterId} AND instance_type=#{instanceType} "
- + "AND instance_id=#{instanceId} AND config_name=#{configName} AND status=1")
- ConfigEntity selectByUnique(ConfigEntity configEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
index c5c80ff..bdb1587 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/HealthCheckResultMapper.java
@@ -54,6 +54,38 @@ public interface HealthCheckResultMapper {
List<HealthCheckResultEntity> selectByClusterIdAndCreateTimeRange(@Param("clusterId") Long clusterId,
@Param("startTime") Timestamp startTime, @Param("endTime") Timestamp endTime);
+ @Select({
+ "<script>",
+ " SELECT * FROM health_check_result",
+ " <if test='list != null and list.size() > 0'>",
+ " WHERE (cluster_id, type, type_id) IN",
+ " <foreach collection='list' item='item' open='(' separator=',' close=')'>",
+ " (#{item.clusterId}, #{item.type}, #{item.typeId})",
+ " </foreach>",
+ " AND (state = 2 OR state = 4)",
+ " </if>",
+ " ORDER BY create_time DESC",
+ "</script>"
+ })
+ List<HealthCheckResultEntity> selectIdsNeedToBeUpdateByClusterIdAndTypeAndTypeId(List<HealthCheckResultEntity> healthCheckResultEntityList);
+
+ @Update("UPDATE health_check_result SET state = #{state}, result_desc = #{resultDesc} WHERE id = #{id}")
+ Integer update(HealthCheckResultEntity healthCheckResultEntity);
+
+ @Update({
+ "<script>",
+ " <foreach collection='list' item='healthCheckResultEntity' index='index' separator=';'>",
+ " UPDATE health_check_result SET state = #{healthCheckResultEntity.state},",
+ " result_desc = #{healthCheckResultEntity.resultDesc} WHERE id = #{healthCheckResultEntity.id}",
+ " </foreach>",
+ "</script>"})
+ Integer batchUpdate(List<HealthCheckResultEntity> healthCheckResultEntityList);
+
+ /**
+ * TODO 未同步修改调用方法^
+ * @param healthCheckResultEntity
+ */
+
@Options(useGeneratedKeys = true, keyProperty = "id")
@Insert("INSERT INTO health_check_result(type,type_id, cluster_id, state,result_desc)"
+ " VALUES( #{type}, #{typeId}, #{clusterId}, #{state}, #{resultDesc})")
@@ -74,7 +106,7 @@ public interface HealthCheckResultMapper {
" </if>",
"</script>"
})
- void batchInsert(List<HealthCheckResultEntity> healthCheckResultEntityList);
+ Integer batchInsert(List<HealthCheckResultEntity> healthCheckResultEntityList);
@Insert({
"<script>",
@@ -88,33 +120,7 @@ public interface HealthCheckResultMapper {
" </if>",
"</script>"
})
- void insertNewChecks(List<HealthCheckResultEntity> healthCheckResultEntityList);
-
- @Update("UPDATE health_check_result SET state = #{state}, result_desc = #{resultDesc} WHERE id = #{id}")
- void update(HealthCheckResultEntity healthCheckResultEntity);
-
- @Update({
- "<script>",
- " <foreach collection='list' item='healthCheckResultEntity' index='index' separator=';'>",
- " UPDATE health_check_result SET state = #{healthCheckResultEntity.state},",
- " result_desc = #{healthCheckResultEntity.resultDesc} WHERE id = #{healthCheckResultEntity.id}",
- " </foreach>",
- "</script>"})
- void batchUpdate(List<HealthCheckResultEntity> healthCheckResultEntityList);
+ Integer insertNewChecks(List<HealthCheckResultEntity> healthCheckResultEntityList);
- @Select({
- "<script>",
- " SELECT * FROM health_check_result",
- " <if test='list != null and list.size() > 0'>",
- " WHERE (cluster_id, type, type_id) IN",
- " <foreach collection='list' item='item' open='(' separator=',' close=')'>",
- " (#{item.clusterId}, #{item.type}, #{item.typeId})",
- " </foreach>",
- " AND (state = 2 OR state = 4)",
- " </if>",
- " ORDER BY create_time DESC",
- "</script>"
- })
- List<HealthCheckResultEntity> getIdsNeedToBeUpdateByClusterIdAndTypeAndTypeId(List<HealthCheckResultEntity> healthCheckResultEntityList);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
index bb784e7..6452a48 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/function/OprLogMapper.java
@@ -49,15 +49,7 @@ public interface OprLogMapper {
" AND is_delete=0",
" </where>",
"</script>"})
- List<LogEntity> getLogList(LogEntity logEntity);
-
- @Insert("INSERT INTO operation_log ( cluster_id, operation_type,target_type, content,operation_user,result)"
- + "VALUE (#{clusterId},#{operationType},#{targetType},#{content},#{operationUser},#{result})")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Long addLog(LogEntity logEntity);
-
- @Update("UPDATE operation_log SET state=#{state} ,result=#{result} WHERE id=#{id}")
- Integer updateLog(LogEntity logEntity);
+ List<LogEntity> selectLogList(LogEntity logEntity);
@Select({
"<script>",
@@ -81,5 +73,14 @@ public interface OprLogMapper {
"</where>",
"</script>"
})
- List<LogEntity> getLogListToFront(LogEntity logEntity);
+ List<LogEntity> selectLogListToFront(LogEntity logEntity);
+
+ @Update("UPDATE operation_log SET state=#{state} ,result=#{result} WHERE id=#{id}")
+ Integer updateLog(LogEntity logEntity);
+
+ @Insert("INSERT INTO operation_log ( cluster_id, operation_type,target_type, content,operation_user,result)"
+ + "VALUE (#{clusterId},#{operationType},#{targetType},#{content},#{operationUser},#{result})")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void insertLog(LogEntity logEntity);
+
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMapper.java
index f2eca1c..ae196ec 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMapper.java
@@ -38,21 +38,12 @@ public interface OprGroupMapper {
@Select("SELECT COUNT(*) FROM `group` WHERE cluster_id=#{clusterId} AND type=0")
- Integer getConsumerNumByCluster(GroupEntity groupEntity);
+ Integer selectConsumerNumByCluster(GroupEntity groupEntity);
@Select("SELECT * FROM `group` WHERE status=1")
List<GroupEntity> selectAll();
- @Update("UPDATE `group` SET member_count=#{memberCount},"
- + "members=#{members},type=#{type},state=#{state} WHERE id=#{id}")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Integer updateGroup(GroupEntity groupEntity);
-
- @Update("UPDATE `group` SET status=1 WHERE id=#{id}")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- Integer deleteGroup(GroupEntity groupEntity);
-
@Select("SELECT * FROM `group` WHERE cluster_id=#{clusterId} AND name=#{name} AND status=1")
GroupEntity selectGroupByUnique(GroupEntity groupEntity);
@@ -74,6 +65,15 @@ public interface OprGroupMapper {
"</script>"})
List<GroupEntity> selectGroup(GroupEntity groupEntity);
+ @Update("UPDATE `group` SET member_count=#{memberCount},"
+ + "members=#{members},type=#{type},state=#{state} WHERE id=#{id}")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer updateGroup(GroupEntity groupEntity);
+
+ @Update("UPDATE `group` SET status=1 WHERE id=#{id}")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer deleteGroup(GroupEntity groupEntity);
+
@Insert({
"<script>",
@@ -83,11 +83,11 @@ public interface OprGroupMapper {
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<GroupEntity> groupEntities);
+ Integer batchInsert(List<GroupEntity> groupEntities);
@Insert("INSERT INTO `group` (cluster_id, name, member_count, members, type, state)"
+ "VALUE (#{clusterId},#{name},#{memberCount},#{members},#{type},#{state}) "
+ "ON DUPLICATE KEY UPDATE status=1")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addGroup(GroupEntity groupEntity);
+ void insertGroup(GroupEntity groupEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java
index 0acba5d..79f6b1a 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/OprGroupMemberMapper.java
@@ -44,33 +44,6 @@ public interface OprGroupMemberMapper {
@Select("SELECT * FROM group_member WHERE status=1")
List<GroupMemberEntity> selectAll();
- @Insert({
- "<script>",
- " INSERT INTO group_member (cluster_id, topic_name, group_name, eventmesh_user, state) VALUES ",
- " <foreach collection='list' item='c' index='index' separator=','>",
- "(#{c.clusterId},#{c.topicName},#{c.groupName},#{c.eventMeshUser},#{c.state})",
- " </foreach>",
- "</script>"})
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<GroupMemberEntity> groupMemberEntities);
-
- @Select("SELECT * FROM group_member WHERE cluster_id=#{clusterId} AND status=1")
- List<GroupMemberEntity> getGroupByClusterId(GroupMemberEntity groupMemberEntity);
-
- @Insert("INSERT INTO group_member (cluster_id, topic_name, group_name, eventmesh_user,state)"
- + " VALUE (#{clusterId},#{topicName},#{groupName},#{eventMeshUser},#{state})"
- + "ON DUPLICATE KEY UPDATE status=0")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addGroupMember(GroupMemberEntity groupMemberEntity);
-
- @Update("UPDATE group_member SET state=#{state} WHERE id=#{id}")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void updateGroupMember(GroupMemberEntity groupMemberEntity);
-
- @Update("UPDATE group_member SET status=0 WHERE id=#{id} ")
- @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- GroupMemberEntity deleteGroupMember(GroupMemberEntity groupMemberEntity);
-
@Select("SELECT * FROM group_member WHERE cluster_id=#{clusterId} AND group_name=#{groupName} AND topic_name=#{topicName} AND status=1")
GroupMemberEntity selectGroupMemberByUnique(GroupMemberEntity groupMemberEntity);
@@ -95,6 +68,35 @@ public interface OprGroupMemberMapper {
"</script>"})
List<GroupMemberEntity> selectMember(GroupMemberEntity groupMemberEntity);
+ @Select("SELECT * FROM group_member WHERE cluster_id=#{clusterId} AND status=1")
+ List<GroupMemberEntity> selectGroupByClusterId(GroupMemberEntity groupMemberEntity);
+
+ @Update("UPDATE group_member SET state=#{state} WHERE id=#{id}")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer updateGroupMember(GroupMemberEntity groupMemberEntity);
+
+ @Update("UPDATE group_member SET status=0 WHERE id=#{id} ")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer deleteGroupMember(GroupMemberEntity groupMemberEntity);
+
@Update("UPDATE group_member SET state=#{state} WHERE topic_name=#{topicName}")
- void updateMemberByTopic(GroupMemberEntity groupMemberEntity);
-}
\ No newline at end of file
+ Integer updateMemberByTopic(GroupMemberEntity groupMemberEntity);
+
+ @Insert({
+ "<script>",
+ " INSERT INTO group_member (cluster_id, topic_name, group_name, eventmesh_user, state) VALUES ",
+ " <foreach collection='list' item='c' index='index' separator=','>",
+ "(#{c.clusterId},#{c.topicName},#{c.groupName},#{c.eventMeshUser},#{c.state})",
+ " </foreach>",
+ "</script>"})
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ Integer batchInsert(List<GroupMemberEntity> groupMemberEntities);
+
+ @Insert("INSERT INTO group_member (cluster_id, topic_name, group_name, eventmesh_user,state)"
+ + " VALUE (#{clusterId},#{topicName},#{groupName},#{eventMeshUser},#{state})"
+ + "ON DUPLICATE KEY UPDATE status=0")
+ @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
+ void insertGroupMember(GroupMemberEntity groupMemberEntity);
+
+
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
index fd17db2..5a98d9b 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/message/TopicMapper.java
@@ -51,23 +51,20 @@ public interface TopicMapper {
"</script>"})
List<TopicEntity> queryTopicsToFrontByClusterId(@Param("topicEntity") TopicEntity topicEntity);
-
@Select("SELECT * FROM topic WHERE cluster_id=#{clusterId} and status = 1")
List<TopicEntity> selectTopicByCluster(TopicEntity topicEntity);
-
@Select("SELECT * FROM topic WHERE status=1")
List<TopicEntity> selectAll();
@Select("SELECT * FROM topic WHERE id=#{id}")
TopicEntity selectTopicById(TopicEntity topicEntity);
-
@Update("UPDATE topic SET type=#{type},description=#{description} WHERE id=#{id}")
- void updateTopic(TopicEntity topicEntity);
+ Integer updateTopic(TopicEntity topicEntity);
@Update("UPDATE topic SET create_progress=#{createProgress} WHERE id=#{id}")
- void updateTopicCreateProgress(TopicEntity topicEntity);
+ Integer updateTopicCreateProgress(TopicEntity topicEntity);
@Update("UPDATE `topic` SET status=0 WHERE id=#{id}")
Integer deleteTopic(TopicEntity topicEntity);
@@ -86,6 +83,6 @@ public interface TopicMapper {
+ "VALUE (#{clusterId},#{topicName},#{storageId},#{retentionMs},#{type},#{description},#{createProgress})"
+ "ON DUPLICATE KEY UPDATE status = 1")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addTopic(TopicEntity topicEntity);
+ void insertTopic(TopicEntity topicEntity);
-}
\ No newline at end of file
+}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/storage/StoreMapper.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/storage/StoreMapper.java
index ede3d0d..9aaa07c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/storage/StoreMapper.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapper/storage/StoreMapper.java
@@ -42,6 +42,18 @@ public interface StoreMapper {
@Select("SELECT * FROM store WHERE host=#{host} AND port=#{port} AND status=1 LIMIT 1")
StoreEntity selectByHostPort(StoreEntity storeEntity);
+ @Select("SELECT * FROM store WHERE cluster_id=#{clusterId} AND status=1")
+ StoreEntity selectStoreByCluster(StoreEntity storeEntity);
+
+ @Update("UPDATE store SET status=0 WHERE cluster_id=#{clusterId} AND store_id=#{storeId}")
+ Integer deleteStoreByUnique(StoreEntity storeEntity);
+
+ @Update("UPDATE store SET status=#{status} WHERE cluster_id=#{clusterId} AND store_id=#{storeId}")
+ Integer updateStoreByUnique(StoreEntity storeEntity);
+
+ @Update("UPDATE store SET topic_list=#{topicList} WHERE cluster_id=#{clusterId}")
+ Integer updateTopicListByCluster(StoreEntity storeEntity);
+
@Insert({
"<script>",
"INSERT INTO store (cluster_id, store_id, store_type, host, runtime_id, topic_list, diff_type, port, jmx_port,start_timestamp, rack,",
@@ -52,24 +64,13 @@ public interface StoreMapper {
" </foreach>",
"</script>"})
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void batchInsert(List<StoreEntity> storeEntities);
+ Integer batchInsert(List<StoreEntity> storeEntities);
@Insert("INSERT INTO store (cluster_id, store_id, store_type, host, runtime_id, topic_list, diff_type"
+ ", port, jmx_port, start_timestamp, rack, status, endpoint_map ) VALUES ("
+ "#{clusterId},#{storeId},#{storeType},#{host},#{runtimeId},#{topicList},#{diffType},#{port},#{jmxPort}"
+ ",#{startTimestamp},#{rack},#{status},#{endpointMap})")
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
- void addStore(StoreEntity storeEntity);
+ void insertStore(StoreEntity storeEntity);
- @Update("UPDATE store SET status=0 WHERE cluster_id=#{clusterId} AND store_id=#{storeId}")
- void deleteStoreByUnique(StoreEntity storeEntity);
-
- @Select("SELECT * FROM store WHERE cluster_id=#{clusterId} AND status=1")
- StoreEntity selectStoreByCluster(StoreEntity storeEntity);
-
- @Update("UPDATE store SET status=#{status} WHERE cluster_id=#{clusterId} AND store_id=#{storeId}")
- void updateStoreByUnique(StoreEntity storeEntity);
-
- @Update("UPDATE store SET topic_list=#{topicList} WHERE cluster_id=#{clusterId}")
- void updateTopicListByCluster(StoreEntity storeEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/config/ConfigControllerMapper.java
similarity index 66%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/config/ConfigControllerMapper.java
index 8ffc2ce..2afd16c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/AddConnectorConfigDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/config/ConfigControllerMapper.java
@@ -15,23 +15,23 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.connection;
+package org.apache.eventmesh.dashboard.console.mapstruct.config;
-import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import java.util.List;
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NoArgsConstructor;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
-@NoArgsConstructor
-@AllArgsConstructor
-@Data
-public class AddConnectorConfigDTO {
+/**
+ *
+ */
- private List<ConfigEntity> sinkConnectorConfigs;
+@Mapper
+public interface ConfigControllerMapper {
- private List<ConfigEntity> sourceConnectorConfigs;
+ ConfigControllerMapper INSTANCE = Mappers.getMapper(ConfigControllerMapper.class);
+ public ConfigEntity queryEntityByConfig(GetConfigsListDTO getConfigsListDTO);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/connection/ConnectionControllerMapper.java
similarity index 52%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/connection/ConnectionControllerMapper.java
index b1f159e..a1c2264 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/connection/ConnectionControllerMapper.java
@@ -15,35 +15,23 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.service.cluster;
+package org.apache.eventmesh.dashboard.console.mapstruct.connection;
+import org.apache.eventmesh.dashboard.console.entity.CreateConnectionEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ConnectionEntity;
-import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
-import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.CreateConnectionDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.connection.GetConnectionListDTO;
-import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
-import java.util.List;
+import org.mapstruct.factory.Mappers;
/**
- * Service providing ConnectionEntity data.
+ *
*/
-public interface ConnectionDataService {
-
- ConnectorEntity getConnectorById(Long connectorId);
-
- List<String> getConnectorBusinessType(String type);
-
- List<ConnectionEntity> getAllConnectionsByClusterId(Long clusterId);
-
- boolean createConnection(CreateConnectionDTO createConnectionDTO);
-
- List<ConnectionEntity> getAllConnections();
+public interface ConnectionControllerMapper {
- List<ConnectionListVO> getConnectionToFrontByCluster(Long clusterId, GetConnectionListDTO getConnectionListDTO);
+ ConnectionControllerMapper INSTANCE = Mappers.getMapper(ConnectionControllerMapper.class);
- List<ConfigEntity> getConnectorConfigsByClassAndVersion(String classType, String version);
+ ConnectionEntity queryEntityByConnection(GetConnectionListDTO getConnectionListDTO);
- Long insert(ConnectionEntity connectionEntity);
+ CreateConnectionEntity queryCreateEntityByConnection(CreateConnectionDTO createConnectionDTO);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/log/LogControllerMapper.java
similarity index 73%
copy from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java
copy to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/log/LogControllerMapper.java
index 88d4f1b..03c5302 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/mapstruct/log/LogControllerMapper.java
@@ -15,26 +15,24 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.service.function;
+package org.apache.eventmesh.dashboard.console.mapstruct.log;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
-import java.util.List;
-import org.springframework.stereotype.Service;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
/**
- * operation service
+ *
*/
+@Mapper
+public interface LogControllerMapper {
-@Service
-public interface LogService {
-
- List<LogEntity> getLogListByCluster(GetLogListDTO getLogListDTO);
+ LogControllerMapper INSTANCE = Mappers.getMapper(LogControllerMapper.class);
- Long addLog(LogEntity logEntity);
- Integer updateLog(LogEntity logEntity);
+ LogEntity queryEntityByLog(GetLogListDTO getLogListDTO);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtime/QueryRuntimeListByClusterIdDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtime/QueryRuntimeListByClusterIdDTO.java
index 0e6eab2..5cccc89 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtime/QueryRuntimeListByClusterIdDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/cluster/runtime/QueryRuntimeListByClusterIdDTO.java
@@ -19,12 +19,8 @@ package org.apache.eventmesh.dashboard.console.modle.cluster.runtime;
import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class QueryRuntimeListByClusterIdDTO extends ClusterIdDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/ChangeConfigDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/ChangeConfigEntity.java
similarity index 82%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/ChangeConfigDTO.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/ChangeConfigEntity.java
index d0bdc23..bf167b1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/ChangeConfigDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/ChangeConfigEntity.java
@@ -15,16 +15,12 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.config;
+package org.apache.eventmesh.dashboard.console.modle.config;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
-public class ChangeConfigDTO {
+public class ChangeConfigEntity {
private String configName;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigsLog.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
similarity index 85%
rename from eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigsLog.java
rename to eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
index 9619c7f..6dafeef 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigsLog.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/config/UpdateConfigsLog.java
@@ -15,15 +15,11 @@
* limitations under the License.
*/
-package org.apache.eventmesh.dashboard.console.modle.dto.config;
+package org.apache.eventmesh.dashboard.console.modle.config;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class UpdateConfigsLog {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java
index bda02fa..1796fa5 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/DetailConfigsVO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.config;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class DetailConfigsVO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/GetConfigsListDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/GetConfigsListDTO.java
index 478b1ac..e1420a2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/GetConfigsListDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/GetConfigsListDTO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.config;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class GetConfigsListDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigDTO.java
index 8c273b8..69232c0 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/config/UpdateConfigDTO.java
@@ -17,20 +17,18 @@
package org.apache.eventmesh.dashboard.console.modle.dto.config;
+import org.apache.eventmesh.dashboard.console.modle.config.ChangeConfigEntity;
+
import java.util.List;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class UpdateConfigDTO {
private Long clusterId;
- private List<ChangeConfigDTO> changeConfigDTOS;
+ private List<ChangeConfigEntity> changeConfigEntities;
private String username;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/CreateConnectionDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/CreateConnectionDTO.java
index 1a63e0a..f204296 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/CreateConnectionDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/CreateConnectionDTO.java
@@ -17,18 +17,17 @@
package org.apache.eventmesh.dashboard.console.modle.dto.connection;
-import lombok.AllArgsConstructor;
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectorConfigEntity;
+
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class CreateConnectionDTO {
private Long clusterId;
- private AddConnectionDTO addConnectionDTO;
+ private AddConnectionEntity addConnectionEntity;
- private AddConnectorConfigDTO addConnectorConfigDTO;
+ private AddConnectorConfigEntity addConnectorConfigEntity;
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/GetConnectionListDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/GetConnectionListDTO.java
index 63a97d2..ea5936d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/GetConnectionListDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/connection/GetConnectionListDTO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.connection;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class GetConnectionListDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/log/GetLogListDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/log/GetLogListDTO.java
index 63ae0f7..cd086ba 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/log/GetLogListDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/log/GetLogListDTO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.log;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class GetLogListDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/meta/NewMetaDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/meta/NewMetaDTO.java
index 7ce8c37..ff0888c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/meta/NewMetaDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/meta/NewMetaDTO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.meta;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class NewMetaDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/GetTopicListDTO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/GetTopicListDTO.java
index 169b9bc..b365278 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/GetTopicListDTO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/dto/topic/GetTopicListDTO.java
@@ -18,12 +18,8 @@
package org.apache.eventmesh.dashboard.console.modle.dto.topic;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class GetTopicListDTO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/GetClusterBaseMessageVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/GetClusterBaseMessageVO.java
index 3c4c9f7..fde7d2e 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/GetClusterBaseMessageVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/GetClusterBaseMessageVO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.vo.cluster;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class GetClusterBaseMessageVO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/ResourceNumVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/ResourceNumVO.java
index 1379407..95deb96 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/ResourceNumVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/cluster/ResourceNumVO.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.vo.cluster;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class ResourceNumVO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/connection/ConnectionListVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/connection/ConnectionListVO.java
index a9b4082..61846b9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/connection/ConnectionListVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/connection/ConnectionListVO.java
@@ -17,13 +17,9 @@
package org.apache.eventmesh.dashboard.console.modle.vo.connection;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
@Data
-@AllArgsConstructor
-@NoArgsConstructor
public class ConnectionListVO {
private Long sinkConnectorId;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/health/InstanceLiveProportionVo.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/health/InstanceLiveProportionVo.java
index 2277c10..9abd0d2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/health/InstanceLiveProportionVo.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/health/InstanceLiveProportionVo.java
@@ -17,12 +17,8 @@
package org.apache.eventmesh.dashboard.console.modle.vo.health;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class InstanceLiveProportionVo {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/topic/TopicDetailGroupVO.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/topic/TopicDetailGroupVO.java
index aebeb7a..10581e5 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/topic/TopicDetailGroupVO.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/modle/vo/topic/TopicDetailGroupVO.java
@@ -19,12 +19,8 @@ package org.apache.eventmesh.dashboard.console.modle.vo.topic;
import java.util.List;
-import lombok.AllArgsConstructor;
import lombok.Data;
-import lombok.NoArgsConstructor;
-@NoArgsConstructor
-@AllArgsConstructor
@Data
public class TopicDetailGroupVO {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/OverviewService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/OverviewService.java
index e966e28..cf919fd 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/OverviewService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/OverviewService.java
@@ -17,7 +17,7 @@
package org.apache.eventmesh.dashboard.console.service;
-import org.apache.eventmesh.dashboard.console.modle.function.OverviewDTO;
+import org.apache.eventmesh.dashboard.console.modle.function.OverviewType;
/**
*
@@ -25,5 +25,5 @@ import org.apache.eventmesh.dashboard.console.modle.function.OverviewDTO;
public interface OverviewService {
- Object overview(OverviewDTO overviewDTO);
+ Object overview(OverviewType overviewType);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClientDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClientDataService.java
index e573944..eb55545 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClientDataService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClientDataService.java
@@ -26,13 +26,13 @@ import java.util.List;
*/
public interface ClientDataService {
- void deActive(ClientEntity clientEntity);
+ Integer deActive(ClientEntity clientEntity);
- void deActiveByHostPort(ClientEntity clientEntity);
+ Integer deActiveByHostPort(ClientEntity clientEntity);
- Long addClient(ClientEntity clientEntity);
+ void insertClient(ClientEntity clientEntity);
- void batchInsert(List<ClientEntity> clientEntityList);
+ Integer batchInsert(List<ClientEntity> clientEntityList);
List<ClientEntity> selectByHostPort(ClientEntity clientEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java
index 9f81f13..18c2cb2 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterRelationshipService.java
@@ -28,7 +28,7 @@ import java.util.List;
public interface ClusterRelationshipService {
- Integer addClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity);
+ void insertClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity);
Integer relieveRelationship(ClusterRelationshipEntity clusterRelationshipEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterService.java
index a3e00b6..66ecfb6 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ClusterService.java
@@ -18,7 +18,6 @@
package org.apache.eventmesh.dashboard.console.service.cluster;
import org.apache.eventmesh.dashboard.console.entity.cluster.ClusterEntity;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.cluster.GetClusterBaseMessageVO;
import java.util.List;
@@ -32,10 +31,10 @@ public interface ClusterService {
void createCluster(ClusterEntity clusterEntity);
- GetClusterBaseMessageVO getClusterBaseMessage(ClusterIdDTO clusterIdDTO);
+ GetClusterBaseMessageVO selectClusterBaseMessage(Long clusterId);
- Map<String, Integer> queryHomeClusterData(ClusterIdDTO clusterIdDTO);
+ Map<String, Integer> queryHomeClusterData(Long clusterId);
Integer batchInsert(List<ClusterEntity> clusterEntities);
@@ -43,7 +42,7 @@ public interface ClusterService {
List<ClusterEntity> selectNewlyIncreased(ClusterEntity clusterEntity);
- void addCluster(ClusterEntity cluster);
+ void insertCluster(ClusterEntity cluster);
List<ClusterEntity> selectAllCluster();
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java
index b1f159e..c1a6345 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/ConnectionDataService.java
@@ -17,18 +17,21 @@
package org.apache.eventmesh.dashboard.console.service.cluster;
+import org.apache.eventmesh.dashboard.console.entity.CreateConnectionEntity;
import org.apache.eventmesh.dashboard.console.entity.cluster.ConnectionEntity;
import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.CreateConnectionDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.connection.GetConnectionListDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
import java.util.List;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
/**
* Service providing ConnectionEntity data.
*/
+@Service
public interface ConnectionDataService {
ConnectorEntity getConnectorById(Long connectorId);
@@ -37,13 +40,16 @@ public interface ConnectionDataService {
List<ConnectionEntity> getAllConnectionsByClusterId(Long clusterId);
- boolean createConnection(CreateConnectionDTO createConnectionDTO);
+ boolean createConnection(CreateConnectionEntity connectionEntity);
List<ConnectionEntity> getAllConnections();
- List<ConnectionListVO> getConnectionToFrontByCluster(Long clusterId, GetConnectionListDTO getConnectionListDTO);
+ List<ConnectionListVO> getConnectionToFrontByCluster(ConnectionEntity connectionEntity);
+
+ @Transactional
+ void replaceAllConnections(List<ConnectionEntity> connectionEntityList);
List<ConfigEntity> getConnectorConfigsByClassAndVersion(String classType, String version);
- Long insert(ConnectionEntity connectionEntity);
+ void insert(ConnectionEntity connectionEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/RuntimeService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/RuntimeService.java
index ff7f4f6..d801154 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/RuntimeService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/RuntimeService.java
@@ -29,9 +29,9 @@ public interface RuntimeService {
RuntimeEntity queryRuntimeEntityById(RuntimeEntity runtimeEntity);
- List<RuntimeEntity> getRuntimeToFrontByClusterId(RuntimeEntity runtimeEntity);
+ List<RuntimeEntity> selectRuntimeToFrontByClusterId(RuntimeEntity runtimeEntity);
- void batchInsert(List<RuntimeEntity> runtimeEntities);
+ Integer batchInsert(List<RuntimeEntity> runtimeEntities);
List<RuntimeEntity> selectAll();
@@ -39,9 +39,9 @@ public interface RuntimeService {
void insertRuntime(RuntimeEntity runtimeEntity);
- void updateRuntimeByCluster(RuntimeEntity runtimeEntity);
+ Integer updateRuntimeByCluster(RuntimeEntity runtimeEntity);
- void deleteRuntimeByCluster(RuntimeEntity runtimeEntity);
+ Integer deleteRuntimeByCluster(RuntimeEntity runtimeEntity);
- void deactivate(RuntimeEntity runtimeEntity);
+ Integer deactivate(RuntimeEntity runtimeEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClientDataServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClientDataServiceImpl.java
index 7e375ab..c5f64fc 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClientDataServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClientDataServiceImpl.java
@@ -33,23 +33,24 @@ public class ClientDataServiceImpl implements ClientDataService {
private ClientMapper clientMapper;
@Override
- public void deActive(ClientEntity clientEntity) {
- clientMapper.deactivate(clientEntity);
+ public Integer deActive(ClientEntity clientEntity) {
+ return clientMapper.deactivate(clientEntity);
}
@Override
- public void deActiveByHostPort(ClientEntity clientEntity) {
- clientMapper.deActiveByHostPort(clientEntity);
+ public Integer deActiveByHostPort(ClientEntity clientEntity) {
+ return clientMapper.deActiveByHostPort(clientEntity);
}
+ @SuppressWarnings("checkstyle:Indentation")
@Override
- public Long addClient(ClientEntity clientEntity) {
- return clientMapper.insert(clientEntity);
+ public void insertClient(ClientEntity clientEntity) {
+ clientMapper.insert(clientEntity);
}
@Override
- public void batchInsert(List<ClientEntity> clientEntityList) {
- clientMapper.batchInsert(clientEntityList);
+ public Integer batchInsert(List<ClientEntity> clientEntityList) {
+ return clientMapper.batchInsert(clientEntityList);
}
@Override
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterRelationshipServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterRelationshipServiceImpl.java
index 44cb33d..171cafe 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterRelationshipServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterRelationshipServiceImpl.java
@@ -34,8 +34,8 @@ public class ClusterRelationshipServiceImpl implements ClusterRelationshipServic
private ClusterRelationshipMapper clusterRelationshipMapper;
@Override
- public Integer addClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity) {
- return this.clusterRelationshipMapper.addClusterRelationshipEntry(clusterRelationshipEntity);
+ public void insertClusterRelationshipEntry(ClusterRelationshipEntity clusterRelationshipEntity) {
+ this.clusterRelationshipMapper.insertClusterRelationshipEntry(clusterRelationshipEntity);
}
@Override
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterServiceImpl.java
index abcc6d9..3756faa 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ClusterServiceImpl.java
@@ -27,8 +27,7 @@ import org.apache.eventmesh.dashboard.console.mapper.cluster.ConnectionMapper;
import org.apache.eventmesh.dashboard.console.mapper.cluster.RuntimeMapper;
import org.apache.eventmesh.dashboard.console.mapper.message.OprGroupMapper;
import org.apache.eventmesh.dashboard.console.mapper.message.TopicMapper;
-import org.apache.eventmesh.dashboard.console.modle.ClusterIdDTO;
-import org.apache.eventmesh.dashboard.console.modle.function.OverviewDTO;
+import org.apache.eventmesh.dashboard.console.modle.function.OverviewType;
import org.apache.eventmesh.dashboard.console.modle.vo.cluster.GetClusterBaseMessageVO;
import org.apache.eventmesh.dashboard.console.service.OverviewService;
import org.apache.eventmesh.dashboard.console.service.cluster.ClusterService;
@@ -65,26 +64,25 @@ public class ClusterServiceImpl implements ClusterService, OverviewService {
}
@Override
- public GetClusterBaseMessageVO getClusterBaseMessage(ClusterIdDTO clusterIdDTO) {
- Long clusterId = clusterIdDTO.getClusterId();
+ public GetClusterBaseMessageVO selectClusterBaseMessage(Long clusterId) {
GetClusterBaseMessageVO getClusterBaseMessageVO = new GetClusterBaseMessageVO();
TopicEntity topicEntity = new TopicEntity();
topicEntity.setClusterId(clusterId);
getClusterBaseMessageVO.setTopicNum(topicMapper.selectTopicNumByCluster(topicEntity));
GroupEntity groupEntity = new GroupEntity();
groupEntity.setClusterId(clusterId);
- getClusterBaseMessageVO.setConsumerGroupNum(oprGroupMapper.getConsumerNumByCluster(groupEntity));
+ getClusterBaseMessageVO.setConsumerGroupNum(oprGroupMapper.selectConsumerNumByCluster(groupEntity));
ConnectionEntity connectionEntity = new ConnectionEntity();
connectionEntity.setClusterId(clusterId);
getClusterBaseMessageVO.setConnectionNum(connectionMapper.selectConnectionNumByCluster(connectionEntity));
RuntimeEntity runtimeEntity = new RuntimeEntity();
runtimeEntity.setClusterId(clusterId);
- getClusterBaseMessageVO.setRuntimeNum(runtimeMapper.getRuntimeNumByCluster(runtimeEntity));
+ getClusterBaseMessageVO.setRuntimeNum(runtimeMapper.selectRuntimeNumByCluster(runtimeEntity));
return getClusterBaseMessageVO;
}
@Override
- public Map<String, Integer> queryHomeClusterData(ClusterIdDTO clusterIdDTO) {
+ public Map<String, Integer> queryHomeClusterData(Long clusterId) {
return null;
}
@@ -105,7 +103,7 @@ public class ClusterServiceImpl implements ClusterService, OverviewService {
}
@Override
- public void addCluster(ClusterEntity cluster) {
+ public void insertCluster(ClusterEntity cluster) {
clusterMapper.insertCluster(cluster);
}
@@ -131,7 +129,7 @@ public class ClusterServiceImpl implements ClusterService, OverviewService {
}
@Override
- public Object overview(OverviewDTO overviewDTO) {
+ public Object overview(OverviewType overviewtype) {
return null;
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ConnectionDataServiceDatabaseImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ConnectionDataServiceDatabaseImpl.java
new file mode 100644
index 0000000..2ba287a
--- /dev/null
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/ConnectionDataServiceDatabaseImpl.java
@@ -0,0 +1,231 @@
+/*
+ * 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.service.cluster.impl;
+
+
+
+import org.apache.eventmesh.dashboard.console.annotation.EmLog;
+import org.apache.eventmesh.dashboard.console.entity.CreateConnectionEntity;
+import org.apache.eventmesh.dashboard.console.entity.cluster.ConnectionEntity;
+import org.apache.eventmesh.dashboard.console.entity.connection.AddConnectionEntity;
+import org.apache.eventmesh.dashboard.console.entity.connector.ConnectorEntity;
+import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
+import org.apache.eventmesh.dashboard.console.mapper.cluster.ConnectionMapper;
+import org.apache.eventmesh.dashboard.console.mapper.connector.ConnectorMapper;
+import org.apache.eventmesh.dashboard.console.mapper.function.ConfigMapper;
+import org.apache.eventmesh.dashboard.console.modle.vo.connection.ConnectionListVO;
+import org.apache.eventmesh.dashboard.console.service.cluster.ConnectionDataService;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+
+@Service
+public class ConnectionDataServiceDatabaseImpl implements ConnectionDataService {
+
+ @Autowired
+ private ConnectionMapper connectionMapper;
+
+ @Autowired
+ private ConnectorMapper connectorMapper;
+
+ @Autowired
+ private ConfigMapper configMapper;
+
+
+ @Override
+ public ConnectorEntity getConnectorById(Long connectorId) {
+ ConnectorEntity connectorEntity = new ConnectorEntity();
+ connectorEntity.setId(connectorId);
+ return connectorMapper.selectById(connectorEntity);
+ }
+
+ @Override
+ public List<String> getConnectorBusinessType(String type) {
+ ConfigEntity config = new ConfigEntity();
+ config.setBusinessType(type);
+ return configMapper.selectConnectorBusinessType(config);
+ }
+
+ @Override
+ public List<ConnectionEntity> getAllConnectionsByClusterId(Long clusterId) {
+ ConnectionEntity connectionEntity = new ConnectionEntity();
+ connectionEntity.setClusterId(clusterId);
+ return connectionMapper.selectByClusterId(connectionEntity);
+ }
+
+ @Override
+ public void insert(ConnectionEntity connectionEntity) {
+ connectionMapper.insert(connectionEntity);
+ }
+
+
+ @EmLog(OprType = "add", OprTarget = "Connection")
+ @Override
+ public boolean createConnection(CreateConnectionEntity createConnectionEntity) {
+ ConnectorEntity sinkConnector = this.createSinkConnector(createConnectionEntity.getClusterId(),
+ createConnectionEntity.getAddConnectionEntity());
+ ConnectorEntity sourceConnector = this.createSourceConnector(createConnectionEntity.getClusterId(),
+ createConnectionEntity.getAddConnectionEntity());
+ ConnectionEntity connectionEntity = this.setConnection(createConnectionEntity);
+ connectionEntity.setSinkId(sinkConnector.getId());
+ connectionEntity.setSourceId(sourceConnector.getId());
+ connectionMapper.insert(connectionEntity);
+ this.addConnectorConfigs(createConnectionEntity.getAddConnectorConfigEntity().getSinkConnectorConfigs(), sinkConnector);
+ this.addConnectorConfigs(createConnectionEntity.getAddConnectorConfigEntity().getSourceConnectorConfigs(), sourceConnector);
+ return false;
+ }
+
+ private ConnectionEntity setConnection(CreateConnectionEntity createConnectionEntity) {
+ ConnectionEntity connectionEntity = new ConnectionEntity();
+ connectionEntity.setClusterId(createConnectionEntity.getClusterId());
+ connectionEntity.setSourceType("connector");
+ connectionEntity.setSinkType("connector");
+ connectionEntity.setRuntimeId(-1L);
+ connectionEntity.setGroupId(createConnectionEntity.getAddConnectionEntity().getGroupId());
+ connectionEntity.setStatus(1);
+ connectionEntity.setDescription(createConnectionEntity.getAddConnectionEntity().getConnectionDescription());
+ connectionEntity.setTopic(createConnectionEntity.getAddConnectionEntity().getTopicName());
+ return connectionEntity;
+ }
+
+ public void addConnectorConfigs(List<ConfigEntity> configEntityList, ConnectorEntity connectorEntity) {
+ configEntityList.forEach(n -> {
+ n.setInstanceId(connectorEntity.getId());
+ n.setIsDefault(0);
+ n.setClusterId(connectorEntity.getClusterId());
+ });
+ configMapper.batchInsert(configEntityList);
+ }
+
+ public ConnectorEntity createSinkConnector(Long clusterId, AddConnectionEntity addConnectionEntity) {
+ ConnectorEntity connectorEntity = new ConnectorEntity();
+ connectorEntity.setName(addConnectionEntity.getSinkName());
+ connectorEntity.setHost(addConnectionEntity.getSinkHost());
+ connectorEntity.setClusterId(clusterId);
+ connectorEntity.setClassName(addConnectionEntity.getSinkClass());
+ connectorEntity.setType("Connector");
+ connectorEntity.setStatus(1);
+ connectorEntity.setPodState(0);
+ connectorEntity.setPort(addConnectionEntity.getSinkPort());
+ connectorMapper.insert(connectorEntity);
+ return connectorEntity;
+ }
+
+ public ConnectorEntity createSourceConnector(Long clusterId, AddConnectionEntity addConnectionEntity) {
+ ConnectorEntity connectorEntity = new ConnectorEntity();
+ connectorEntity.setName(addConnectionEntity.getSourceName());
+ connectorEntity.setHost(addConnectionEntity.getSourceHost());
+ connectorEntity.setClusterId(clusterId);
+ connectorEntity.setClassName(addConnectionEntity.getSourceClass());
+ connectorEntity.setType("Connector");
+ connectorEntity.setStatus(1);
+ connectorEntity.setPodState(0);
+ connectorEntity.setPort(addConnectionEntity.getSourcePort());
+ connectorMapper.insert(connectorEntity);
+ return connectorEntity;
+ }
+
+
+ @Override
+ public List<ConnectionEntity> getAllConnections() {
+ return connectionMapper.selectAll();
+ }
+
+ @Override
+ public List<ConnectionListVO> getConnectionToFrontByCluster(ConnectionEntity connectionEntity) {
+ List<ConnectionEntity> allConnectionsByClusterId = connectionMapper.selectToFrontByClusterId(connectionEntity);
+ List<ConnectionListVO> connectionListVOs = new ArrayList<>();
+ allConnectionsByClusterId.forEach(n -> {
+ connectionListVOs.add(this.setConnectionListVO(n));
+ });
+ return connectionListVOs;
+ }
+
+ private ConnectionListVO setConnectionListVO(ConnectionEntity connectionEntity) {
+ ConnectionListVO connectionListVO = new ConnectionListVO();
+ ConnectorEntity connectorEntity = new ConnectorEntity();
+ connectorEntity.setId(connectionEntity.getSinkId());
+ ConnectorEntity sinkConnector = connectorMapper.selectById(connectorEntity);
+ connectorEntity.setId(connectionEntity.getSourceId());
+ ConnectorEntity sourceConnector = connectorMapper.selectById(connectorEntity);
+ connectionListVO.setSinkClass(sinkConnector.getClassName());
+ connectionListVO.setSourceClass(sourceConnector.getClassName());
+ connectionListVO.setSinkConnectorId(sinkConnector.getId());
+ connectionListVO.setSourceConnectorId(sourceConnector.getId());
+ connectionListVO.setSinkConnectorName(sinkConnector.getName());
+ connectionListVO.setSourceConnectorName(sourceConnector.getName());
+ connectionListVO.setTopicName(connectionEntity.getTopic());
+ connectionListVO.setStatus(connectionEntity.getStatus());
+ return connectionListVO;
+ }
+
+ @Override
+ @Transactional
+ public void replaceAllConnections(List<ConnectionEntity> connectionEntityList) {
+ Map<Long, List<ConnectionEntity>> connectionsGroupedByClusterId = connectionEntityList.stream()
+ .collect(Collectors.groupingBy(ConnectionEntity::getClusterId));
+
+ connectionsGroupedByClusterId.forEach((clusterId, newConnections) -> {
+ ConnectionEntity connectionEntity = new ConnectionEntity();
+ connectionEntity.setClusterId(clusterId);
+ List<ConnectionEntity> existingConnections = connectionMapper.selectByClusterId(connectionEntity);
+
+ // Collect connections that are not in the new list
+ List<ConnectionEntity> connectionsToInactive = existingConnections.stream()
+ .filter(existingConnection -> !newConnections.contains(existingConnection))
+ .collect(Collectors.toList());
+
+ // Collect new connections that are not in the existing list
+ List<ConnectionEntity> connectionsToInsert = newConnections.stream()
+ .filter(connection -> !existingConnections.contains(connection))
+ .collect(Collectors.toList());
+
+ // Delete connections in batch
+ if (!connectionsToInactive.isEmpty()) {
+ connectionMapper.batchEndConnectionById(connectionsToInactive);
+ }
+
+ // Insert new connections in batch
+ if (!connectionsToInsert.isEmpty()) {
+ connectionMapper.batchInsert(connectionsToInsert);
+ }
+ });
+ }
+
+
+ @Override
+ public List<ConfigEntity> getConnectorConfigsByClassAndVersion(String classType, String version) {
+ ConfigEntity config = new ConfigEntity();
+ config.setBusinessType(classType);
+ List<ConfigEntity> configEntityList = configMapper.selectConnectorConfigsByBusinessType(config);
+ configEntityList.forEach(n -> {
+ if (!n.matchVersion(version)) {
+ configEntityList.remove(n);
+ }
+ });
+ return configEntityList;
+ }
+}
+
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/RuntimeServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/RuntimeServiceImpl.java
index 68dc66a..d414d13 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/RuntimeServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/cluster/impl/RuntimeServiceImpl.java
@@ -45,8 +45,8 @@ public class RuntimeServiceImpl implements RuntimeService {
}
@Override
- public List<RuntimeEntity> getRuntimeToFrontByClusterId(RuntimeEntity runtimeEntity) {
- List<RuntimeEntity> runtimeByClusterId = runtimeMapper.getRuntimesToFrontByCluster(runtimeEntity);
+ public List<RuntimeEntity> selectRuntimeToFrontByClusterId(RuntimeEntity runtimeEntity) {
+ List<RuntimeEntity> runtimeByClusterId = runtimeMapper.selectRuntimesToFrontByCluster(runtimeEntity);
runtimeByClusterId.forEach(n -> {
n.setStatus(CheckResultCache.getINSTANCE().getLastHealthyCheckResult("runtime", n.getId()));
});
@@ -55,8 +55,8 @@ public class RuntimeServiceImpl implements RuntimeService {
@Override
- public void batchInsert(List<RuntimeEntity> runtimeEntities) {
- runtimeMapper.batchInsert(runtimeEntities);
+ public Integer batchInsert(List<RuntimeEntity> runtimeEntities) {
+ return runtimeMapper.batchInsert(runtimeEntities);
}
@Override
@@ -71,21 +71,21 @@ public class RuntimeServiceImpl implements RuntimeService {
@Override
public void insertRuntime(RuntimeEntity runtimeEntity) {
- runtimeMapper.addRuntime(runtimeEntity);
+ runtimeMapper.insertRuntime(runtimeEntity);
}
@Override
- public void updateRuntimeByCluster(RuntimeEntity runtimeEntity) {
- runtimeMapper.updateRuntimeByCluster(runtimeEntity);
+ public Integer updateRuntimeByCluster(RuntimeEntity runtimeEntity) {
+ return runtimeMapper.updateRuntimeByCluster(runtimeEntity);
}
@Override
- public void deleteRuntimeByCluster(RuntimeEntity runtimeEntity) {
- runtimeMapper.deleteRuntimeByCluster(runtimeEntity);
+ public Integer deleteRuntimeByCluster(RuntimeEntity runtimeEntity) {
+ return runtimeMapper.deleteRuntimeByCluster(runtimeEntity);
}
@Override
- public void deactivate(RuntimeEntity runtimeEntity) {
- runtimeMapper.deactivate(runtimeEntity);
+ public Integer deactivate(RuntimeEntity runtimeEntity) {
+ return runtimeMapper.deactivate(runtimeEntity);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java
index f2b39ba..227f1e9 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/ConnectorDataService.java
@@ -26,7 +26,7 @@ import java.util.List;
*/
public interface ConnectorDataService {
- Long createConnector(ConnectorEntity connectorEntity);
+ void createConnector(ConnectorEntity connectorEntity);
List<ConnectorEntity> selectAll();
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/Impl/ConnectorDataServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/Impl/ConnectorDataServiceImpl.java
index 772270b..12ac190 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/Impl/ConnectorDataServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/connector/Impl/ConnectorDataServiceImpl.java
@@ -33,8 +33,8 @@ public class ConnectorDataServiceImpl implements ConnectorDataService {
private ConnectorMapper connectorMapper;
@Override
- public Long createConnector(ConnectorEntity connectorEntity) {
- return connectorMapper.insert(connectorEntity);
+ public void createConnector(ConnectorEntity connectorEntity) {
+ connectorMapper.insert(connectorEntity);
}
@Override
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/ConfigService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/ConfigService.java
index 9f9e126..c619bd1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/ConfigService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/ConfigService.java
@@ -19,8 +19,7 @@ package org.apache.eventmesh.dashboard.console.service.function;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.ChangeConfigDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
+import org.apache.eventmesh.dashboard.console.modle.config.ChangeConfigEntity;
import java.util.List;
import java.util.Map;
@@ -31,17 +30,18 @@ import java.util.Map;
*/
public interface ConfigService {
- List<ConfigEntity> selectToFront(Long instanceId, Integer type, GetConfigsListDTO getConfigsListDTO);
+ List<ConfigEntity> selectToFront(ConfigEntity configEntity);
- void updateConfigsByInstanceId(String name, Long clusterId, Integer instanceType, Long instanceId, List<ChangeConfigDTO> changeConfigDTOList);
+ void updateConfigsByInstanceId(String name, Long clusterId, Integer instanceType, Long instanceId,
+ List<ChangeConfigEntity> changeConfigEntityList);
List<ConfigEntity> selectAll();
- void batchInsert(List<ConfigEntity> configEntityList);
+ Integer batchInsert(List<ConfigEntity> configEntityList);
String mapToYaml(Map<String, String> stringMap);
- Integer addConfig(ConfigEntity configEntity);
+ void insertConfig(ConfigEntity configEntity);
Integer deleteConfig(ConfigEntity configEntity);
@@ -51,7 +51,7 @@ public interface ConfigService {
List<ConfigEntity> selectByInstanceIdAndType(Long instanceId, Integer type);
- Map<String, String> selectDefaultConfig(String version, Long instanceId, Integer instanceType);
+ Map<String, String> selectDefaultConfig(String businessType);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/HealthDataService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/HealthDataService.java
index 7469482..2b7f370 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/HealthDataService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/HealthDataService.java
@@ -29,24 +29,24 @@ import java.util.List;
*/
public interface HealthDataService {
- InstanceLiveProportionVo getInstanceLiveProportion(Long clusterId, Integer instanceType);
+ InstanceLiveProportionVo selectInstanceLiveProportion(Long clusterId, Integer instanceType);
- List<HealthCheckResultEntity> getInstanceLiveStatusHistory(Integer type, Long clusterId, LocalDateTime startTime);
+ List<HealthCheckResultEntity> selectInstanceLiveStatusHistory(Integer type, Long clusterId, LocalDateTime startTime);
HealthCheckResultEntity insertHealthCheckResult(HealthCheckResultEntity healthCheckResultEntity);
- void batchInsertHealthCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
+ Integer batchInsertHealthCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
/**
* New check results have state 4: SDK client not created or connected
*/
- void batchInsertNewCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
+ Integer batchInsertNewCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
List<HealthCheckResultEntity> selectAll();
List<HealthCheckResultEntity> queryHealthCheckResultByClusterIdAndTypeAndTypeId(HealthCheckResultEntity entity);
- void batchUpdateCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
+ Integer batchUpdateCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList);
void batchUpdateCheckResultByClusterIdAndTypeAndTypeId(List<HealthCheckResultEntity> healthCheckResultEntityList);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/ConfigServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/ConfigServiceImpl.java
index 90236d4..b6b42c1 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/ConfigServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/ConfigServiceImpl.java
@@ -21,9 +21,8 @@ import org.apache.eventmesh.dashboard.console.annotation.EmLog;
import org.apache.eventmesh.dashboard.console.entity.DefaultConfigKey;
import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
import org.apache.eventmesh.dashboard.console.mapper.function.ConfigMapper;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.ChangeConfigDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
-import org.apache.eventmesh.dashboard.console.modle.dto.config.UpdateConfigsLog;
+import org.apache.eventmesh.dashboard.console.modle.config.ChangeConfigEntity;
+import org.apache.eventmesh.dashboard.console.modle.config.UpdateConfigsLog;
import org.apache.eventmesh.dashboard.console.service.function.ConfigService;
import java.util.Arrays;
@@ -49,8 +48,8 @@ public class ConfigServiceImpl implements ConfigService {
@EmLog(OprTarget = "Runtime", OprType = "UpdateConfigs")
- public void logUpdateRuntimeConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigDTO> changeConfigDTOList) {
- changeConfigDTOList.forEach(n -> {
+ public void logUpdateRuntimeConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigEntity> changeConfigEntityList) {
+ changeConfigEntityList.forEach(n -> {
ConfigEntity config = new ConfigEntity();
config.setInstanceType(0);
config.setInstanceId(updateConfigsLog.getInstanceId());
@@ -63,8 +62,8 @@ public class ConfigServiceImpl implements ConfigService {
@EmLog(OprTarget = "store", OprType = "UpdateConfigs")
- public void logUpdateStoreConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigDTO> changeConfigDTOList) {
- changeConfigDTOList.forEach(n -> {
+ public void logUpdateStoreConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigEntity> changeConfigEntityList) {
+ changeConfigEntityList.forEach(n -> {
ConfigEntity config = new ConfigEntity();
config.setInstanceType(1);
config.setInstanceId(updateConfigsLog.getInstanceId());
@@ -77,8 +76,8 @@ public class ConfigServiceImpl implements ConfigService {
@EmLog(OprTarget = "Connector", OprType = "UpdateConfigs")
- public void logUpdateConnectorConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigDTO> changeConfigDTOList) {
- changeConfigDTOList.forEach(n -> {
+ public void logUpdateConnectorConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigEntity> changeConfigEntityList) {
+ changeConfigEntityList.forEach(n -> {
ConfigEntity config = new ConfigEntity();
config.setInstanceType(2);
config.setInstanceId(updateConfigsLog.getInstanceId());
@@ -91,8 +90,8 @@ public class ConfigServiceImpl implements ConfigService {
@EmLog(OprTarget = "Topic", OprType = "UpdateConfigs")
- public void logUpdateTopicConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigDTO> changeConfigDTOList) {
- changeConfigDTOList.forEach(n -> {
+ public void logUpdateTopicConfigs(UpdateConfigsLog updateConfigsLog, List<ChangeConfigEntity> changeConfigEntityList) {
+ changeConfigEntityList.forEach(n -> {
ConfigEntity config = new ConfigEntity();
config.setInstanceType(3);
config.setInstanceId(updateConfigsLog.getInstanceId());
@@ -105,22 +104,25 @@ public class ConfigServiceImpl implements ConfigService {
@Override
public void updateConfigsByInstanceId(String name, Long clusterId, Integer instanceType, Long instanceId,
- List<ChangeConfigDTO> changeConfigDTOList) {
+ List<ChangeConfigEntity> changeConfigEntityList) {
ConcurrentHashMap<String, String> stringStringConcurrentHashMap = new ConcurrentHashMap<>();
- changeConfigDTOList.forEach(n -> {
+ changeConfigEntityList.forEach(n -> {
stringStringConcurrentHashMap.put(n.getConfigName(), n.getConfigValue());
});
- UpdateConfigsLog updateConfigsLog =
- new UpdateConfigsLog(instanceId, clusterId, name, this.mapToProperties(stringStringConcurrentHashMap));
+ UpdateConfigsLog updateConfigsLog = new UpdateConfigsLog();
+ updateConfigsLog.setInstanceId(instanceId);
+ updateConfigsLog.setClusterId(clusterId);
+ updateConfigsLog.setName(name);
+ updateConfigsLog.setConfigProperties(this.mapToProperties(stringStringConcurrentHashMap));
ConfigServiceImpl service = (ConfigServiceImpl) AopContext.currentProxy();
if (instanceType == 0) {
- service.logUpdateRuntimeConfigs(updateConfigsLog, changeConfigDTOList);
+ service.logUpdateRuntimeConfigs(updateConfigsLog, changeConfigEntityList);
} else if (instanceType == 1) {
- service.logUpdateStoreConfigs(updateConfigsLog, changeConfigDTOList);
+ service.logUpdateStoreConfigs(updateConfigsLog, changeConfigEntityList);
} else if (instanceType == 2) {
- service.logUpdateConnectorConfigs(updateConfigsLog, changeConfigDTOList);
+ service.logUpdateConnectorConfigs(updateConfigsLog, changeConfigEntityList);
} else if (instanceType == 3) {
- service.logUpdateTopicConfigs(updateConfigsLog, changeConfigDTOList);
+ service.logUpdateTopicConfigs(updateConfigsLog, changeConfigEntityList);
}
}
@@ -131,8 +133,8 @@ public class ConfigServiceImpl implements ConfigService {
}
@Override
- public void batchInsert(List<ConfigEntity> configEntityList) {
- configMapper.batchInsert(configEntityList);
+ public Integer batchInsert(List<ConfigEntity> configEntityList) {
+ return configMapper.batchInsert(configEntityList);
}
@Override
@@ -164,8 +166,8 @@ public class ConfigServiceImpl implements ConfigService {
}
@Override
- public Integer addConfig(ConfigEntity configEntity) {
- return configMapper.addConfig(configEntity);
+ public void insertConfig(ConfigEntity configEntity) {
+ configMapper.insertConfig(configEntity);
}
@Override
@@ -181,43 +183,27 @@ public class ConfigServiceImpl implements ConfigService {
return configMapper.selectByInstanceId(config);
}
- public ConfigEntity setSearchCriteria(GetConfigsListDTO getConfigsListDTO, ConfigEntity configEntity) {
- if (getConfigsListDTO != null) {
- if (getConfigsListDTO.getConfigName() != null) {
- configEntity.setConfigName(getConfigsListDTO.getConfigName());
- }
- if (getConfigsListDTO.getIsModify() != null) {
- configEntity.setIsModify(getConfigsListDTO.getIsModify());
- }
- if (getConfigsListDTO.getAlreadyUpdate() != null) {
- configEntity.setAlreadyUpdate(getConfigsListDTO.getAlreadyUpdate());
- }
- }
- return configEntity;
- }
@Override
- public List<ConfigEntity> selectToFront(Long instanceId, Integer type, GetConfigsListDTO getConfigsListDTO) {
- ConfigEntity config = new ConfigEntity();
- config.setInstanceId(instanceId);
- config.setInstanceType(type);
- config = this.setSearchCriteria(getConfigsListDTO, config);
- return configMapper.getConfigsToFrontWithDynamic(config);
+ public List<ConfigEntity> selectToFront(ConfigEntity config) {
+ return configMapper.selectConfigsToFrontWithDynamic(config);
}
- public void addDefaultConfigToCache() {
+ public void insertDefaultConfigToCache() {
List<ConfigEntity> configEntityList = configMapper.selectAllDefaultConfig();
configEntityList.forEach(n -> {
- DefaultConfigKey defaultConfigKey = new DefaultConfigKey(n.getBusinessType(), n.getConfigName());
+ DefaultConfigKey defaultConfigKey = new DefaultConfigKey();
+ defaultConfigKey.setConfigName(n.getConfigName());
+ defaultConfigKey.setBusinessType(n.getBusinessType());
defaultConfigCache.putIfAbsent(defaultConfigKey, n.getConfigValue());
});
}
@Override
- public Map<String, String> selectDefaultConfig(String businessType, Long instanceId, Integer instanceType) {
+ public Map<String, String> selectDefaultConfig(String businessType) {
if (defaultConfigCache.size() == 0) {
- this.addDefaultConfigToCache();
+ this.insertDefaultConfigToCache();
}
ConcurrentHashMap<String, String> stringStringConcurrentHashMap = new ConcurrentHashMap<>();
defaultConfigCache.forEach((k, v) -> {
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/HealthDataServiceDatabaseImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/HealthDataServiceDatabaseImpl.java
index 03a36ca..2b315ae 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/HealthDataServiceDatabaseImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/HealthDataServiceDatabaseImpl.java
@@ -48,14 +48,14 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
@Override
- public InstanceLiveProportionVo getInstanceLiveProportion(Long clusterId, Integer instanceType) {
+ public InstanceLiveProportionVo selectInstanceLiveProportion(Long clusterId, Integer instanceType) {
InstanceLiveProportionVo instanceLiveProportionVo = new InstanceLiveProportionVo();
switch (instanceType) {
case 2:
- instanceLiveProportionVo = this.getRuntimeLiveProportion(clusterId);
+ instanceLiveProportionVo = this.selectRuntimeLiveProportion(clusterId);
break;
case 3:
- instanceLiveProportionVo = this.getTopicLiveProportion(clusterId);
+ instanceLiveProportionVo = this.selectTopicLiveProportion(clusterId);
break;
default:
break;
@@ -63,7 +63,7 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
return instanceLiveProportionVo;
}
- public InstanceLiveProportionVo getTopicLiveProportion(Long clusterId) {
+ public InstanceLiveProportionVo selectTopicLiveProportion(Long clusterId) {
TopicEntity topicEntity = new TopicEntity();
topicEntity.setClusterId(clusterId);
Integer topicNum = topicMapper.selectTopicNumByCluster(topicEntity);
@@ -74,14 +74,17 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
abnormalNum++;
}
}
- return new InstanceLiveProportionVo(abnormalNum, topicNum);
+ InstanceLiveProportionVo instanceLiveProportionVo = new InstanceLiveProportionVo();
+ instanceLiveProportionVo.setAbnormalNum(abnormalNum);
+ instanceLiveProportionVo.setAllNum(topicNum);
+ return instanceLiveProportionVo;
}
- public InstanceLiveProportionVo getRuntimeLiveProportion(Long clusterId) {
+ public InstanceLiveProportionVo selectRuntimeLiveProportion(Long clusterId) {
RuntimeEntity runtimeEntity = new RuntimeEntity();
runtimeEntity.setClusterId(clusterId);
- Integer topicNum = runtimeMapper.getRuntimeNumByCluster(runtimeEntity);
+ Integer topicNum = runtimeMapper.selectRuntimeNumByCluster(runtimeEntity);
List<RuntimeEntity> runtimeEntities = runtimeMapper.selectRuntimeByCluster(runtimeEntity);
int abnormalNum = 0;
for (RuntimeEntity n : runtimeEntities) {
@@ -89,12 +92,15 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
abnormalNum++;
}
}
- return new InstanceLiveProportionVo(abnormalNum, topicNum);
+ InstanceLiveProportionVo instanceLiveProportionVo = new InstanceLiveProportionVo();
+ instanceLiveProportionVo.setAbnormalNum(abnormalNum);
+ instanceLiveProportionVo.setAllNum(topicNum);
+ return instanceLiveProportionVo;
}
@Override
- public List<HealthCheckResultEntity> getInstanceLiveStatusHistory(Integer type, Long instanceId, LocalDateTime startTime) {
+ public List<HealthCheckResultEntity> selectInstanceLiveStatusHistory(Integer type, Long instanceId, LocalDateTime startTime) {
HealthCheckResultEntity healthCheckResultEntity = new HealthCheckResultEntity();
healthCheckResultEntity.setType(type);
healthCheckResultEntity.setTypeId(instanceId);
@@ -109,19 +115,19 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
}
@Override
- public void batchInsertHealthCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
+ public Integer batchInsertHealthCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
if (healthCheckResultEntityList.isEmpty()) {
- return;
+ return 0;
}
- healthCheckResultMapper.batchInsert(healthCheckResultEntityList);
+ return healthCheckResultMapper.batchInsert(healthCheckResultEntityList);
}
@Override
- public void batchInsertNewCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
+ public Integer batchInsertNewCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
if (healthCheckResultEntityList.isEmpty()) {
- return;
+ return 0;
}
- healthCheckResultMapper.insertNewChecks(healthCheckResultEntityList);
+ return healthCheckResultMapper.insertNewChecks(healthCheckResultEntityList);
}
@Override
@@ -135,8 +141,8 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
}
@Override
- public void batchUpdateCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
- healthCheckResultMapper.batchUpdate(healthCheckResultEntityList);
+ public Integer batchUpdateCheckResult(List<HealthCheckResultEntity> healthCheckResultEntityList) {
+ return healthCheckResultMapper.batchUpdate(healthCheckResultEntityList);
}
@Override
@@ -144,7 +150,7 @@ public class HealthDataServiceDatabaseImpl implements HealthDataService {
if (healthCheckResultEntityList.isEmpty()) {
return;
}
- List<HealthCheckResultEntity> entitiesNeedToBeUpdate = healthCheckResultMapper.getIdsNeedToBeUpdateByClusterIdAndTypeAndTypeId(
+ List<HealthCheckResultEntity> entitiesNeedToBeUpdate = healthCheckResultMapper.selectIdsNeedToBeUpdateByClusterIdAndTypeAndTypeId(
healthCheckResultEntityList);
if (entitiesNeedToBeUpdate.isEmpty()) {
return;
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/LogServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/LogServiceImpl.java
index 7e0f2cf..cc4ea33 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/LogServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/Impl/LogServiceImpl.java
@@ -19,7 +19,6 @@ package org.apache.eventmesh.dashboard.console.service.function.Impl;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
import org.apache.eventmesh.dashboard.console.mapper.function.OprLogMapper;
-import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
import org.apache.eventmesh.dashboard.console.service.function.LogService;
import java.util.List;
@@ -34,20 +33,14 @@ public class LogServiceImpl implements LogService {
OprLogMapper oprLogMapper;
@Override
- public List<LogEntity> getLogListByCluster(GetLogListDTO getLogListDTO) {
- LogEntity logEntity = new LogEntity();
- logEntity.setClusterId(getLogListDTO.getClusterId());
- logEntity.setTargetType(getLogListDTO.getTargetType());
- logEntity.setOperationType(getLogListDTO.getOperationType());
- logEntity.setState(getLogListDTO.getState());
- logEntity.setOperationUser(getLogListDTO.getOperationUser());
- return oprLogMapper.getLogListToFront(logEntity);
+ public List<LogEntity> selectLogListByCluster(LogEntity logEntity) {
+ return oprLogMapper.selectLogListToFront(logEntity);
}
@Override
- public Long addLog(LogEntity logEntity) {
+ public void insertLog(LogEntity logEntity) {
- return oprLogMapper.addLog(logEntity);
+ oprLogMapper.insertLog(logEntity);
}
@Override
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java
index 88d4f1b..dd9b993 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/function/LogService.java
@@ -18,7 +18,7 @@
package org.apache.eventmesh.dashboard.console.service.function;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
-import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;
+
import java.util.List;
@@ -31,9 +31,9 @@ import org.springframework.stereotype.Service;
@Service
public interface LogService {
- List<LogEntity> getLogListByCluster(GetLogListDTO getLogListDTO);
+ List<LogEntity> selectLogListByCluster(LogEntity logEntity);
- Long addLog(LogEntity logEntity);
+ void insertLog(LogEntity logEntity);
Integer updateLog(LogEntity logEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupMemberService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupMemberService.java
index f2a0aa8..a92cc34 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupMemberService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupMemberService.java
@@ -29,15 +29,15 @@ public interface GroupMemberService {
List<GroupMemberEntity> selectAll();
- void batchInsert(List<GroupMemberEntity> groupMemberEntities);
+ Integer batchInsert(List<GroupMemberEntity> groupMemberEntities);
- List<GroupMemberEntity> getGroupMemberByClusterId(GroupMemberEntity groupMemberEntity);
+ List<GroupMemberEntity> selectGroupMemberByClusterId(GroupMemberEntity groupMemberEntity);
- void addGroupMember(GroupMemberEntity groupMemberEntity);
+ void insertGroupMember(GroupMemberEntity groupMemberEntity);
- void updateGroupMember(GroupMemberEntity groupMemberEntity);
+ Integer updateGroupMember(GroupMemberEntity groupMemberEntity);
- GroupMemberEntity deleteGroupMember(GroupMemberEntity groupMemberEntity);
+ Integer deleteGroupMember(GroupMemberEntity groupMemberEntity);
GroupMemberEntity selectGroupMemberById(GroupMemberEntity groupMemberEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupService.java
index 4227d38..a2bd08f 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/GroupService.java
@@ -30,11 +30,11 @@ public interface GroupService {
List<GroupEntity> selectAll();
- void batchInsert(List<GroupEntity> groupEntities);
+ Integer batchInsert(List<GroupEntity> groupEntities);
- List<GroupEntity> getGroupByClusterId(GroupEntity groupEntity);
+ List<GroupEntity> selectGroupByClusterId(GroupEntity groupEntity);
- void addGroup(GroupEntity groupEntity);
+ void insertGroup(GroupEntity groupEntity);
void updateGroup(GroupEntity groupEntity);
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/TopicService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/TopicService.java
index 796ee93..714be9d 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/TopicService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/TopicService.java
@@ -27,7 +27,7 @@ import java.util.List;
*/
public interface TopicService {
- List<TopicDetailGroupVO> getTopicDetailGroups(Long topicId);
+ List<TopicDetailGroupVO> selectTopicDetailGroups(Long topicId);
void createTopic(TopicEntity topicEntity);
@@ -35,9 +35,9 @@ public interface TopicService {
List<TopicEntity> selectAll();
- void addTopic(TopicEntity topicEntity);
+ void insertTopic(TopicEntity topicEntity);
- void updateTopic(TopicEntity topicEntity);
+ Integer updateTopic(TopicEntity topicEntity);
void deleteTopicById(TopicEntity topicEntity);
@@ -47,5 +47,5 @@ public interface TopicService {
List<TopicEntity> selectTopiByCluster(TopicEntity topicEntity);
- List<TopicEntity> getTopicListToFront(TopicEntity topicEntity);
+ List<TopicEntity> selectTopicListToFront(TopicEntity topicEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupMemberServiceImp.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupMemberServiceImp.java
index 9d85ac6..bbb46b3 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupMemberServiceImp.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupMemberServiceImp.java
@@ -40,29 +40,29 @@ public class GroupMemberServiceImp implements GroupMemberService {
}
@Override
- public void batchInsert(List<GroupMemberEntity> groupMemberEntities) {
- oprGroupMemberMapper.batchInsert(groupMemberEntities);
+ public Integer batchInsert(List<GroupMemberEntity> groupMemberEntities) {
+ return oprGroupMemberMapper.batchInsert(groupMemberEntities);
}
@Override
@EmLog(OprType = "View", OprTarget = "GroupMember")
- public List<GroupMemberEntity> getGroupMemberByClusterId(GroupMemberEntity groupMemberEntity) {
- return oprGroupMemberMapper.getGroupByClusterId(groupMemberEntity);
+ public List<GroupMemberEntity> selectGroupMemberByClusterId(GroupMemberEntity groupMemberEntity) {
+ return oprGroupMemberMapper.selectGroupByClusterId(groupMemberEntity);
}
@Override
@EmLog(OprType = "add", OprTarget = "GroupMember")
- public void addGroupMember(GroupMemberEntity groupMemberEntity) {
- oprGroupMemberMapper.addGroupMember(groupMemberEntity);
+ public void insertGroupMember(GroupMemberEntity groupMemberEntity) {
+ oprGroupMemberMapper.insertGroupMember(groupMemberEntity);
}
@Override
- public void updateGroupMember(GroupMemberEntity groupMemberEntity) {
- oprGroupMemberMapper.updateGroupMember(groupMemberEntity);
+ public Integer updateGroupMember(GroupMemberEntity groupMemberEntity) {
+ return oprGroupMemberMapper.updateGroupMember(groupMemberEntity);
}
@Override
- public GroupMemberEntity deleteGroupMember(GroupMemberEntity groupMemberEntity) {
+ public Integer deleteGroupMember(GroupMemberEntity groupMemberEntity) {
return oprGroupMemberMapper.deleteGroupMember(groupMemberEntity);
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupServiceImpl.java
index c3c1a40..4199715 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/GroupServiceImpl.java
@@ -45,21 +45,21 @@ public class GroupServiceImpl implements GroupService {
}
@Override
- public void batchInsert(List<GroupEntity> groupEntities) {
- oprGroupMapper.batchInsert(groupEntities);
+ public Integer batchInsert(List<GroupEntity> groupEntities) {
+ return oprGroupMapper.batchInsert(groupEntities);
}
@EmLog(OprType = "search", OprTarget = "Group")
@Override
- public List<GroupEntity> getGroupByClusterId(GroupEntity groupEntity) {
+ public List<GroupEntity> selectGroupByClusterId(GroupEntity groupEntity) {
return oprGroupMapper.selectGroup(groupEntity);
}
@EmLog(OprType = "add", OprTarget = "Group")
@Override
- public void addGroup(GroupEntity groupEntity) {
- oprGroupMapper.addGroup(groupEntity);
+ public void insertGroup(GroupEntity groupEntity) {
+ oprGroupMapper.insertGroup(groupEntity);
}
@Override
@@ -79,7 +79,7 @@ public class GroupServiceImpl implements GroupService {
@Override
public Integer insertMemberToGroup(GroupMemberEntity groupMemberEntity) {
- groupMemberService.addGroupMember(groupMemberEntity);
+ groupMemberService.insertGroupMember(groupMemberEntity);
GroupEntity groupEntity = new GroupEntity();
groupEntity.setName(groupMemberEntity.getGroupName());
groupEntity.setClusterId(groupMemberEntity.getClusterId());
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/TopicServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/TopicServiceImpl.java
index 4706576..45f5c4c 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/TopicServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/message/impl/TopicServiceImpl.java
@@ -30,7 +30,6 @@ import org.apache.eventmesh.dashboard.console.mapper.message.OprGroupMapper;
import org.apache.eventmesh.dashboard.console.mapper.message.OprGroupMemberMapper;
import org.apache.eventmesh.dashboard.console.mapper.message.TopicMapper;
import org.apache.eventmesh.dashboard.console.mapper.storage.StoreMapper;
-import org.apache.eventmesh.dashboard.console.modle.dto.topic.GetTopicListDTO;
import org.apache.eventmesh.dashboard.console.modle.vo.topic.TopicDetailGroupVO;
import org.apache.eventmesh.dashboard.console.service.message.TopicService;
@@ -66,7 +65,7 @@ public class TopicServiceImpl implements TopicService {
@Override
- public List<TopicDetailGroupVO> getTopicDetailGroups(Long topicId) {
+ public List<TopicDetailGroupVO> selectTopicDetailGroups(Long topicId) {
TopicEntity topicEntity = new TopicEntity();
topicEntity.setId(topicId);
topicEntity = this.selectTopicById(topicEntity);
@@ -97,7 +96,7 @@ public class TopicServiceImpl implements TopicService {
@Override
public void createTopic(TopicEntity topicEntity) {
topicEntity.setCreateProgress(1);
- topicMapper.addTopic(topicEntity);
+ topicMapper.insertTopic(topicEntity);
}
@Override
@@ -112,17 +111,17 @@ public class TopicServiceImpl implements TopicService {
@Override
- public void addTopic(TopicEntity topicEntity) {
+ public void insertTopic(TopicEntity topicEntity) {
GroupMemberEntity groupMemberEntity = new GroupMemberEntity();
groupMemberEntity.setTopicName(topicEntity.getTopicName());
groupMemberEntity.setState("active");
oprGroupMemberMapper.updateMemberByTopic(groupMemberEntity);
- topicMapper.addTopic(topicEntity);
+ topicMapper.insertTopic(topicEntity);
}
@Override
- public void updateTopic(TopicEntity topicEntity) {
- topicMapper.updateTopic(topicEntity);
+ public Integer updateTopic(TopicEntity topicEntity) {
+ return topicMapper.updateTopic(topicEntity);
}
@Override
@@ -146,14 +145,8 @@ public class TopicServiceImpl implements TopicService {
return topicMapper.selectTopicByCluster(topicEntity);
}
-
- public TopicEntity setSearchCriteria(GetTopicListDTO getTopicListDTO, TopicEntity topicEntity) {
- topicEntity.setTopicName(getTopicListDTO.getTopicName());
- return topicEntity;
- }
-
@Override
- public List<TopicEntity> getTopicListToFront(TopicEntity topicEntity) {
+ public List<TopicEntity> selectTopicListToFront(TopicEntity topicEntity) {
List<TopicEntity> topicEntityList = topicMapper.queryTopicsToFrontByClusterId(topicEntity);
topicEntityList.forEach(n -> {
n.setStatus(CheckResultCache.getINSTANCE().getLastHealthyCheckResult("topic", n.getId()));
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/Impl/StoreServiceImpl.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/Impl/StoreServiceImpl.java
index 5fa6a87..f95aed8 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/Impl/StoreServiceImpl.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/Impl/StoreServiceImpl.java
@@ -33,7 +33,7 @@ public class StoreServiceImpl implements StoreService {
private StoreMapper storeMapper;
@Override
- public StoreEntity getStoreToFrontListByCluster(Long clusterId) {
+ public StoreEntity selectStoreToFrontListByCluster(Long clusterId) {
StoreEntity storeEntity = new StoreEntity();
storeEntity.setClusterId(clusterId);
return storeMapper.selectStoreByCluster(storeEntity);
@@ -61,18 +61,18 @@ public class StoreServiceImpl implements StoreService {
}
@Override
- public void batchInsert(List<StoreEntity> storeEntities) {
- storeMapper.batchInsert(storeEntities);
+ public Integer batchInsert(List<StoreEntity> storeEntities) {
+ return storeMapper.batchInsert(storeEntities);
}
@Override
- public void addStore(StoreEntity storeEntity) {
- storeMapper.addStore(storeEntity);
+ public void insertStore(StoreEntity storeEntity) {
+ storeMapper.insertStore(storeEntity);
}
@Override
- public void deleteStoreByUnique(StoreEntity storeEntity) {
- storeMapper.deleteStoreByUnique(storeEntity);
+ public Integer deleteStoreByUnique(StoreEntity storeEntity) {
+ return storeMapper.deleteStoreByUnique(storeEntity);
}
@Override
@@ -83,7 +83,7 @@ public class StoreServiceImpl implements StoreService {
}
@Override
- public void updateStoreByUnique(StoreEntity storeEntity) {
- storeMapper.updateStoreByUnique(storeEntity);
+ public Integer updateStoreByUnique(StoreEntity storeEntity) {
+ return storeMapper.updateStoreByUnique(storeEntity);
}
}
diff --git a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/StoreService.java b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/StoreService.java
index 14f8c52..6528241 100644
--- a/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/StoreService.java
+++ b/eventmesh-dashboard-console/src/main/java/org/apache/eventmesh/dashboard/console/service/store/StoreService.java
@@ -26,7 +26,7 @@ import java.util.List;
*/
public interface StoreService {
- StoreEntity getStoreToFrontListByCluster(Long clusterId);
+ StoreEntity selectStoreToFrontListByCluster(Long clusterId);
List<StoreEntity> selectAll();
@@ -34,13 +34,13 @@ public interface StoreService {
StoreEntity selectByHostPort(String host, Integer port);
- void batchInsert(List<StoreEntity> storeEntities);
+ Integer batchInsert(List<StoreEntity> storeEntities);
- void addStore(StoreEntity storeEntity);
+ void insertStore(StoreEntity storeEntity);
- void deleteStoreByUnique(StoreEntity storeEntity);
+ Integer deleteStoreByUnique(StoreEntity storeEntity);
StoreEntity selectStoreByCluster(Long clusterId);
- void updateStoreByUnique(StoreEntity storeEntity);
+ Integer updateStoreByUnique(StoreEntity storeEntity);
}
diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/linkage/log/TestOprLog.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/linkage/log/TestOprLog.java
index ad7c44a..c52b31a 100644
--- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/linkage/log/TestOprLog.java
+++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/linkage/log/TestOprLog.java
@@ -51,7 +51,7 @@ public class TestOprLog {
groupEntity.setStatus(1);
groupEntity.setType(0);
groupEntity.setState("OS");
- groupService.addGroup(groupEntity);
+ groupService.insertGroup(groupEntity);
LogEntity logEntity = new LogEntity();
logEntity.setClusterId(1L);
logEntity.setOperationType("add");
@@ -59,7 +59,7 @@ public class TestOprLog {
logEntity.setContent(groupEntity.toString());
logEntity.setResult(groupEntity.toString());
logEntity.setId(groupEntity.getId());
- List<LogEntity> logListByCluster = logService.getLogListByCluster(new GetLogListDTO());
+ List<LogEntity> logListByCluster = logService.selectLogListByCluster(new GetLogListDTO());
logListByCluster.get(0).setId(null);
logListByCluster.get(0).setCreateTime(null);
logListByCluster.get(0).setEndTime(null);
diff --git a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImplTest.java b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImplTest.java
index b01940a..0884b5c 100644
--- a/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImplTest.java
+++ b/eventmesh-dashboard-console/src/test/java/org/apache/eventmesh/dashboard/console/service/connection/impl/ConnectionDataServiceDatabaseImplTest.java
@@ -20,6 +20,7 @@ package org.apache.eventmesh.dashboard.console.service.connection.impl;
import static org.junit.jupiter.api.Assertions.assertEquals;
import org.apache.eventmesh.dashboard.console.entity.cluster.ConnectionEntity;
+import org.apache.eventmesh.dashboard.console.service.cluster.impl.ConnectionDataServiceDatabaseImpl;
import java.util.List;
@@ -52,4 +53,4 @@ public class ConnectionDataServiceDatabaseImplTest {
List<ConnectionEntity> connectionEntityList = connectionServiceDatabaseImpl.getAllConnections();
assertEquals(6, connectionEntityList.size());
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org