Skip to content

Commit

Permalink
Code Specification
Browse files Browse the repository at this point in the history
  • Loading branch information
周倬贤 committed Jun 15, 2024
1 parent 90959ac commit 9b80552
Show file tree
Hide file tree
Showing 32 changed files with 128 additions and 157 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ public AddConnectionDTO showCreateConnectionMessage() {
public String createConnection(@Validated @RequestBody CreateConnectionDTO createConnectionDTO) {
try {
connectionDataService.createConnection(createConnectionDTO);

} catch (Exception e) {
return e.getMessage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,9 @@ public class ClusterController {
@Autowired
ClusterService clusterService;




@GetMapping("queryHomeClusterData")
public GetClusterBaseMessageVO queryHomeClusterData(@RequestBody @Validated ClusterIdDTO clusterIdDTO) {
return clusterService.selectClusterBaseMessage(clusterIdDTO);
return clusterService.selectClusterBaseMessage(clusterIdDTO.getClusterId());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,7 +46,7 @@ public class ConfigController {
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();
}
Expand All @@ -55,10 +56,8 @@ public String updateConfigsByTypeAndId(@Validated @RequestBody UpdateConfigDTO u

@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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -39,7 +40,7 @@ public class LogController {

@PostMapping("/getList")
public List<LogEntity> getLogLIstToFront(@Validated @RequestBody GetLogListDTO getLogListDTO) {
return logService.selectLogListByCluster(getLogListDTO);
return logService.selectLogListByCluster(LogControllerMapper.INSTANCE.queryEntityByLog(getLogListDTO));
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* 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.mapstruct.config;


import org.apache.eventmesh.dashboard.console.entity.function.ConfigEntity;
import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
import org.apache.eventmesh.dashboard.console.modle.dto.config.GetConfigsListDTO;
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;

import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
*
*/

@Mapper
public interface ConfigControllerMapper {

ConfigControllerMapper INSTANCE = Mappers.getMapper(ConfigControllerMapper.class);

public ConfigEntity queryEntityByConfig(GetConfigsListDTO getConfigsListDTO);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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.mapstruct.log;

import org.apache.eventmesh.dashboard.console.entity.function.LogEntity;
import org.apache.eventmesh.dashboard.console.modle.dto.log.GetLogListDTO;


import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

/**
*
*/
@Mapper
public interface LogControllerMapper {

LogControllerMapper INSTANCE = Mappers.getMapper(LogControllerMapper.class);


LogEntity queryEntityByLog(GetLogListDTO getLogListDTO);

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 AddConnectionDTO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class AddConnectorConfigDTO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 CreateConnectionDTO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@

import java.util.List;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@NoArgsConstructor
@AllArgsConstructor
@Data
public class TopicDetailGroupVO {

Expand Down
Loading

0 comments on commit 9b80552

Please sign in to comment.