-
Notifications
You must be signed in to change notification settings - Fork 1
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
2 changed files
with
27 additions
and
28 deletions.
There are no files selected for viewing
28 changes: 0 additions & 28 deletions
28
main/src/main/java/org/sopt/makers/crew/main/common/response/ApiResponse.java
This file was deleted.
Oops, something went wrong.
27 changes: 27 additions & 0 deletions
27
main/src/main/java/org/sopt/makers/crew/main/common/response/CommonResponseDto.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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package org.sopt.makers.crew.main.common.response; | ||
|
||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Builder | ||
@Getter | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public class CommonResponseDto<T> { | ||
|
||
private final String errorCode; | ||
private T data; | ||
|
||
public static CommonResponseDto success(Object data) { | ||
return CommonResponseDto.builder() | ||
.data(data) | ||
.build(); | ||
} | ||
|
||
|
||
public static CommonResponseDto fail(String errorCode) { | ||
return CommonResponseDto.builder() | ||
.errorCode(errorCode) | ||
.build(); | ||
} | ||
} |