-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from makevook/issue/69
feat: 온보딩 완료 API 수정
- Loading branch information
Showing
17 changed files
with
189 additions
and
52 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
api/src/main/java/vook/server/api/app/common/AppException.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,8 @@ | ||
package vook.server.api.app.common; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public abstract class AppException extends RuntimeException { | ||
public abstract String contents(); | ||
} |
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: 6 additions & 4 deletions
10
api/src/main/java/vook/server/api/app/user/data/CompleteOnboardingCommand.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
11 changes: 11 additions & 0 deletions
11
api/src/main/java/vook/server/api/app/user/exception/NotReadyToOnboardingException.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,11 @@ | ||
package vook.server.api.app.user.exception; | ||
|
||
import vook.server.api.app.common.AppException; | ||
|
||
public class NotReadyToOnboardingException extends AppException { | ||
|
||
@Override | ||
public String contents() { | ||
return "NotReadyToOnboarding"; | ||
} | ||
} |
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,24 @@ | ||
package vook.server.api.model.user; | ||
|
||
public enum Funnel { | ||
//X | ||
X, | ||
|
||
//페이스북 | ||
FACEBOOK, | ||
|
||
//링크드인 | ||
LINKEDIN, | ||
|
||
//인스타그램 | ||
INSTAGRAM, | ||
|
||
//네이버 블로그 | ||
NAVER_BLOG, | ||
|
||
//친구/지인 추천 | ||
RECOMMENDATION, | ||
|
||
//기타 | ||
OTHER | ||
} |
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,24 @@ | ||
package vook.server.api.model.user; | ||
|
||
public enum Job { | ||
//기획자 | ||
PLANNER, | ||
|
||
//디자이너 | ||
DESIGNER, | ||
|
||
//개발자 | ||
DEVELOPER, | ||
|
||
//마케터 | ||
MARKETER, | ||
|
||
//CEO | ||
CEO, | ||
|
||
//HR | ||
HR, | ||
|
||
//기타 | ||
OTHER | ||
} |
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
62 changes: 27 additions & 35 deletions
62
api/src/main/java/vook/server/api/web/common/CommonApiException.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,51 +1,43 @@ | ||
package vook.server.api.web.common; | ||
|
||
public class CommonApiException { | ||
public static abstract class Exception extends RuntimeException { | ||
public class CommonApiException extends RuntimeException { | ||
|
||
protected ApiResponseCode code; | ||
private final ApiResponseCode code; | ||
private final int statusCode; | ||
private final String message; | ||
|
||
public Exception(ApiResponseCode code, Throwable cause) { | ||
super(code.code(), cause); | ||
this.code = code; | ||
} | ||
|
||
abstract CommonApiResponse<?> response(); | ||
|
||
abstract int statusCode(); | ||
CommonApiException(ApiResponseCode code, int statusCode, Throwable cause) { | ||
this(code, statusCode, cause, null); | ||
} | ||
|
||
public static class BadRequest extends Exception { | ||
|
||
public BadRequest(ApiResponseCode code, Throwable cause) { | ||
super(code, cause); | ||
} | ||
CommonApiException(ApiResponseCode code, int statusCode, Throwable cause, String message) { | ||
super(code.code(), cause); | ||
this.code = code; | ||
this.statusCode = statusCode; | ||
this.message = message; | ||
} | ||
|
||
@Override | ||
public CommonApiResponse<?> response() { | ||
public CommonApiResponse<?> response() { | ||
if (message == null) { | ||
return CommonApiResponse.noResult(code); | ||
} | ||
|
||
@Override | ||
int statusCode() { | ||
return 400; | ||
} else { | ||
return CommonApiResponse.withResult(code, message); | ||
} | ||
} | ||
|
||
public static class ServerError extends Exception { | ||
public int statusCode() { | ||
return statusCode; | ||
} | ||
|
||
public ServerError(ApiResponseCode code, Throwable cause) { | ||
super(code, cause); | ||
} | ||
public static CommonApiException badRequest(ApiResponseCode code, Throwable cause) { | ||
return new CommonApiException(code, 400, cause); | ||
} | ||
|
||
@Override | ||
public CommonApiResponse<?> response() { | ||
return CommonApiResponse.noResult(code); | ||
} | ||
public static CommonApiException badRequest(ApiResponseCode code, Throwable cause, String message) { | ||
return new CommonApiException(code, 400, cause, message); | ||
} | ||
|
||
@Override | ||
int statusCode() { | ||
return 500; | ||
} | ||
public static CommonApiException serverError(ApiResponseCode code, Throwable cause) { | ||
return new CommonApiException(code, 500, cause); | ||
} | ||
} |
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.