-
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.
[Fix] 챕터 보상 수령 처리 API 요청을 두 번 이상 보낼 수 있는 문제를 해결했습니다.
- Loading branch information
Showing
3 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
common/src/main/java/com/codingland/common/exception/chapter/HasReceivedRewardErrorCode.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,22 @@ | ||
package com.codingland.common.exception.chapter; | ||
|
||
import com.codingland.common.common.ApplicationResponse; | ||
import com.codingland.common.common.BaseErrorCode; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum HasReceivedRewardErrorCode implements BaseErrorCode { | ||
ALREADY_EXIST(HttpStatus.BAD_REQUEST, "2000", "챕터 보상을 이미 받았습니다.") | ||
; | ||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
|
||
@Override | ||
public ApplicationResponse<String> getErrorResponse() { | ||
return ApplicationResponse.server(code, message); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
common/src/main/java/com/codingland/common/exception/chapter/HasReceivedRewardException.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,15 @@ | ||
package com.codingland.common.exception.chapter; | ||
|
||
import com.codingland.common.common.BaseErrorCode; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class HasReceivedRewardException extends RuntimeException { | ||
private final BaseErrorCode errorCode; | ||
private final Throwable cause; | ||
|
||
public HasReceivedRewardException(BaseErrorCode errorCode) { | ||
this.errorCode = errorCode; | ||
this.cause = 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