Skip to content

Commit

Permalink
split core to other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Pil0tXia committed Mar 1, 2024
1 parent 5ef2c32 commit 7545495
Show file tree
Hide file tree
Showing 34 changed files with 101 additions and 128 deletions.
4 changes: 4 additions & 0 deletions eventmesh-dashboard-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.constant;
package org.apache.eventmesh.dashboard.common.constant;

public class ConfigConst {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.constant;
package org.apache.eventmesh.dashboard.common.constant;

public class NacosConst {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.dto;
package org.apache.eventmesh.dashboard.common.dto;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.dto;
package org.apache.eventmesh.dashboard.common.dto;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.dto;
package org.apache.eventmesh.dashboard.common.dto;

import static org.apache.eventmesh.dashboard.core.enums.Status.SUCCESS;

import org.apache.eventmesh.dashboard.core.enums.Status;
import org.apache.eventmesh.dashboard.core.exception.BaseException;
import org.apache.eventmesh.dashboard.common.enums.Status;
import org.apache.eventmesh.dashboard.common.exception.BaseException;

import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -59,28 +57,28 @@ public Result(T data, Integer pages) {
* The request is valid and the result is wrapped in {@link Result}.
*/
public static <T> Result<T> success() {
return new Result<>(new StatusMessage(SUCCESS));
return new Result<>(new StatusMessage(Status.SUCCESS));
}

public static <T> Result<T> success(Result<T> result) {
result.setMessage(new StatusMessage(SUCCESS));
result.setMessage(new StatusMessage(Status.SUCCESS));
return result;
}

public static <T> Result<T> success(T data) {
return new Result<>(data, null, new StatusMessage(SUCCESS));
return new Result<>(data, null, new StatusMessage(Status.SUCCESS));
}

/**
* The request is valid and the result is returned in {@link ResponseEntity}.
* Logic issues should use 422 Unprocessable Entity instead of 200 OK.
*/
public static <T> ResponseEntity<Result<T>> ok() {
return ResponseEntity.ok(new Result<>(new StatusMessage(SUCCESS)));
return ResponseEntity.ok(new Result<>(new StatusMessage(Status.SUCCESS)));
}

public static <T> ResponseEntity<Result<T>> ok(Result<T> result) {
result.setMessage(new StatusMessage(SUCCESS));
result.setMessage(new StatusMessage(Status.SUCCESS));
return ResponseEntity.ok(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.enums;
package org.apache.eventmesh.dashboard.common.enums;

import static org.apache.eventmesh.dashboard.core.constant.ConfigConst.COLON;
import static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON;

import org.springframework.http.HttpStatus;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.exception;
package org.apache.eventmesh.dashboard.common.exception;

import static org.apache.eventmesh.dashboard.core.constant.ConfigConst.COLON;
import static org.apache.eventmesh.dashboard.common.constant.ConfigConst.COLON;

import org.apache.eventmesh.dashboard.core.enums.Status;
import org.apache.eventmesh.dashboard.core.util.ExceptionUtil;
import org.apache.eventmesh.dashboard.common.enums.Status;
import org.apache.eventmesh.dashboard.common.util.ExceptionUtil;

import lombok.Getter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.exception;
package org.apache.eventmesh.dashboard.common.exception;

import org.apache.eventmesh.dashboard.core.enums.Status;
import org.apache.eventmesh.dashboard.common.enums.Status;

/**
* EventMeshAdmin Application side exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.exception;
package org.apache.eventmesh.dashboard.common.exception;

/**
* EventMesh Runtime side exception
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.exception;
package org.apache.eventmesh.dashboard.common.exception;

import org.apache.eventmesh.dashboard.core.dto.Result;
import org.apache.eventmesh.dashboard.core.dto.Result.StatusMessage;
import org.apache.eventmesh.dashboard.common.enums.Status;
import org.apache.eventmesh.dashboard.common.dto.Result;
import org.apache.eventmesh.dashboard.common.dto.Result.StatusMessage;

import javax.servlet.http.HttpServletRequest;

Expand All @@ -29,7 +30,7 @@
import lombok.extern.slf4j.Slf4j;

/**
* This class, in conjunction with {@linkplain org.apache.eventmesh.dashboard.core.enums.Status Status} and {@link BaseException},
* This class, in conjunction with {@linkplain Status Status} and {@link BaseException},
* collectively implements customized error reporting.
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.exception;
package org.apache.eventmesh.dashboard.common.exception;

import org.apache.eventmesh.dashboard.core.enums.Status;
import org.apache.eventmesh.dashboard.common.enums.Status;

/**
* Meta side exception with EventMeshAdmin Application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.model;
package org.apache.eventmesh.dashboard.common.model;

public class ConnectionInfo {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.model;
package org.apache.eventmesh.dashboard.common.model;

import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.model;
package org.apache.eventmesh.dashboard.common.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.util;
package org.apache.eventmesh.dashboard.common.util;

public class ExceptionUtil {

Expand Down
9 changes: 5 additions & 4 deletions eventmesh-dashboard-console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<!-- ASP dependency -->

<!-- AOP -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>
<version>5.1.2.RELEASE</version>
</dependency>

<!-- swagger -->
<!-- Swagger -->
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
Expand All @@ -48,7 +49,7 @@
<version>1.7.0</version>
</dependency>

<!-- eventmesh.dashboard dependency -->
<!-- EventMesh Dashboard modules -->
<dependency>
<groupId>org.apache.eventmesh.dashboard.common</groupId>
<artifactId>eventmesh-dashboard-common</artifactId>
Expand Down Expand Up @@ -77,7 +78,7 @@
</dependency>

<!-- health check client -->
<!-- Eventmesh SDK -->
<!-- EventMesh SDK -->
<dependency>
<groupId>org.apache.eventmesh</groupId>
<artifactId>eventmesh-sdk-java</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.controller;
package org.apache.eventmesh.dashboard.console.controller;

import org.apache.eventmesh.dashboard.core.service.ConnectionService;
import org.apache.eventmesh.dashboard.service.meta.ConnectionService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.controller;
package org.apache.eventmesh.dashboard.console.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.controller;
package org.apache.eventmesh.dashboard.console.controller;

import org.apache.eventmesh.dashboard.core.dto.Result;
import org.apache.eventmesh.dashboard.core.model.SubscriptionInfo;
import org.apache.eventmesh.dashboard.core.service.SubscriptionService;
import org.apache.eventmesh.dashboard.common.dto.Result;
import org.apache.eventmesh.dashboard.common.model.SubscriptionInfo;
import org.apache.eventmesh.dashboard.service.meta.SubscriptionService;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
* limitations under the License.
*/

package org.apache.eventmesh.dashboard.core.controller;
package org.apache.eventmesh.dashboard.console.controller;

import org.apache.eventmesh.dashboard.core.dto.CreateTopicRequest;
import org.apache.eventmesh.dashboard.core.dto.DeleteTopicRequest;
import org.apache.eventmesh.dashboard.core.dto.Result;
import org.apache.eventmesh.dashboard.core.model.TopicProperties;
import org.apache.eventmesh.dashboard.core.service.TopicService;
import org.apache.eventmesh.dashboard.common.dto.CreateTopicRequest;
import org.apache.eventmesh.dashboard.common.dto.DeleteTopicRequest;
import org.apache.eventmesh.dashboard.common.dto.Result;
import org.apache.eventmesh.dashboard.common.model.TopicProperties;
import org.apache.eventmesh.dashboard.service.store.TopicService;

import java.util.List;

Expand Down

This file was deleted.

17 changes: 17 additions & 0 deletions eventmesh-dashboard-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,28 @@
</properties>

<dependencies>
<!-- EventMesh Dashboard modules -->
<dependency>
<groupId>org.apache.eventmesh.dashboard.common</groupId>
<artifactId>eventmesh-dashboard-common</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.eventmesh.dashboard.service</groupId>
<artifactId>eventmesh-dashboard-service</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>

<!-- springframework dependencies -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<!-- meta -->
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.eventmesh.dashboard.core.config;

import org.apache.eventmesh.dashboard.core.constant.ConfigConst;
import org.apache.eventmesh.dashboard.common.constant.ConfigConst;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@

package org.apache.eventmesh.dashboard.core.config;

import org.apache.eventmesh.dashboard.core.constant.ConfigConst;
import org.apache.eventmesh.dashboard.core.service.ConnectionService;
import org.apache.eventmesh.dashboard.core.service.SubscriptionService;
import org.apache.eventmesh.dashboard.core.service.TopicService;
import org.apache.eventmesh.dashboard.common.constant.ConfigConst;
import org.apache.eventmesh.dashboard.service.meta.ConnectionService;
import org.apache.eventmesh.dashboard.service.meta.SubscriptionService;
import org.apache.eventmesh.dashboard.service.store.TopicService;
import org.apache.eventmesh.dashboard.core.service.meta.EtcdConnectionService;
import org.apache.eventmesh.dashboard.core.service.meta.EtcdSubscriptionService;
import org.apache.eventmesh.dashboard.core.service.meta.NacosConnectionService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

package org.apache.eventmesh.dashboard.core.service.meta;

import org.apache.eventmesh.dashboard.core.service.ConnectionService;
import org.apache.eventmesh.dashboard.service.meta.ConnectionService;

import org.springframework.stereotype.Service;

Expand Down
Loading

0 comments on commit 7545495

Please sign in to comment.