-
Notifications
You must be signed in to change notification settings - Fork 2
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
8 changed files
with
121 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package com.zatch.zatchserver; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
|
||
@Data | ||
@AllArgsConstructor | ||
@Builder | ||
public class DefaultRes<T> { | ||
private int statusCode; | ||
private String responseMessage; | ||
private T data; | ||
|
||
public DefaultRes(final int statusCode, final String responseMessage) { | ||
this.statusCode = statusCode; | ||
this.responseMessage = responseMessage; | ||
this.data = null; | ||
} | ||
|
||
public static<T> DefaultRes<T> res(final int statusCode, final String responseMessage) { | ||
return res(statusCode, responseMessage, null); | ||
} | ||
|
||
public static<T> DefaultRes<T> res(final int statusCode, final String responseMessage, final T t) { | ||
return DefaultRes.<T>builder() | ||
.data(t) | ||
.statusCode(statusCode) | ||
.responseMessage(responseMessage) | ||
.build(); | ||
} | ||
} |
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,13 @@ | ||
package com.zatch.zatchserver; | ||
|
||
public class ResponseMessage { | ||
public static final String LOGIN_SUCCESS = "로그인 성공"; | ||
public static final String LOGIN_FAIL = "로그인 실패"; | ||
public static final String READ_USER = "회원 정보 조회 성공"; | ||
public static final String NOT_FOUND_USER = "회원을 찾을 수 없습니다."; | ||
public static final String CREATED_USER = "회원 가입 성공"; | ||
public static final String UPDATE_USER = "회원 정보 수정 성공"; | ||
public static final String DELETE_USER = "회원 탈퇴 성공"; | ||
public static final String INTERNAL_SERVER_ERROR = "서버 내부 에러"; | ||
public static final String DB_ERROR = "데이터베이스 에러"; | ||
} |
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,14 @@ | ||
package com.zatch.zatchserver; | ||
|
||
public class StatusCode { | ||
public static final int OK = 200; | ||
public static final int CREATED = 201; | ||
public static final int NO_CONTENT = 204; | ||
public static final int BAD_REQUEST = 400; | ||
public static final int UNAUTHORIZED = 401; | ||
public static final int FORBIDDEN = 403; | ||
public static final int NOT_FOUND = 404; | ||
public static final int INTERNAL_SERVER_ERROR = 500; | ||
public static final int SERVICE_UNAVAILABLE = 503; | ||
public static final int DB_ERROR = 600; | ||
} |
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
10 changes: 10 additions & 0 deletions
10
src/main/java/com/zatch/zatchserver/dto/GetUserReqDto.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,10 @@ | ||
package com.zatch.zatchserver.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public class GetUserReqDto { | ||
private String email; | ||
} |
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,11 +1,14 @@ | ||
package com.zatch.zatchserver.dto; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@Data | ||
public class PostUserResDto { | ||
String name; | ||
String email; | ||
String nickname; | ||
} |