-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
80 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
/** | ||
* ClusterException | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
public class ClusterException { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
/** | ||
* ClusterKeyspaceException | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
public class ClusterKeyspaceException { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
/** | ||
* ClusterTableException | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
public class ClusterTableException { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,9 +6,8 @@ | |
/** | ||
* ClusterUDTTypeException | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
public class ClusterUDTTypeException { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,8 @@ | |
/** | ||
* ClusterConnectionTest | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
class ClusterConnectionTest { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,9 +8,8 @@ | |
/** | ||
* ClusterQueryCommanderArgsTest | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
class ClusterQueryCommanderArgsTest { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,8 @@ | |
/** | ||
* ColumnKindTest | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
class ColumnKindTest { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,9 +12,8 @@ | |
/** | ||
* ClusterUDTTypeGetCommanderTest | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
class ClusterUDTTypeGetCommanderTest extends IntegrationTest { | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,9 +10,8 @@ | |
/** | ||
* ClusterUDTTypeListCommanderTest | ||
* | ||
* @author Seungho Kang ([email protected]) | ||
* @version 1.0.0 | ||
* @since 2024. 07. 07. | ||
* @author seungh0 | ||
* @since 2024-07-07 | ||
*/ | ||
class ClusterUDTTypeListCommanderTest extends IntegrationTest { | ||
|
||
|
24 changes: 4 additions & 20 deletions
24
cassdio-web/src/main/java/kr/hakdang/cassdio/web/common/dto/response/ApiResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,38 @@ | ||
package kr.hakdang.cassdio.web.common.dto.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import kr.hakdang.cassdio.common.error.ErrorCode; | ||
import lombok.AccessLevel; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.ToString; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
@EqualsAndHashCode | ||
@ToString | ||
@Getter | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class ApiResponse<T> { | ||
|
||
public static final ApiResponse<Object> OK = ok(null); | ||
|
||
private boolean ok; | ||
|
||
private String error; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_EMPTY) | ||
private List<String> reasons; | ||
|
||
private T result; | ||
|
||
private ApiResponse(boolean ok, String error, List<String> reasons, T result) { | ||
private ApiResponse(boolean ok, String error,, T result) { | ||
this.ok = ok; | ||
this.error = error; | ||
this.reasons = reasons; | ||
this.result = result; | ||
} | ||
|
||
public static <T> ApiResponse<T> ok(T result) { | ||
return new ApiResponse<>(true, null, Collections.emptyList(), result); | ||
return new ApiResponse<>(true, null, result); | ||
} | ||
|
||
public static ApiResponse<Void> ok() { | ||
return new ApiResponse<>(true, null, Collections.emptyList(), null); | ||
return new ApiResponse<>(true, null, null); | ||
} | ||
|
||
public static <T> ApiResponse<T> fail(ErrorCode errorCode) { | ||
return new ApiResponse<>(false, errorCode.getCode(), Collections.emptyList(), null); | ||
} | ||
|
||
public static <T> ApiResponse<T> fail(ErrorCode errorCode, List<String> reasons) { | ||
return new ApiResponse<>(false, errorCode.getCode(), reasons, null); | ||
return new ApiResponse<>(false, errorCode.getCode(), null); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.