-
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.
- Loading branch information
1 parent
ef014a8
commit 0f1d2d2
Showing
10 changed files
with
102 additions
and
8 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
9 changes: 9 additions & 0 deletions
9
src/main/java/life/offonoff/ab/exception/CommentConcurrencyException.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,9 @@ | ||
package life.offonoff.ab.exception; | ||
|
||
public class CommentConcurrencyException extends ConcurrencyViolationException { | ||
private static final String HINT = "토픽의 댓글수 업데이트 중 낙관적 락 실패"; | ||
@Override | ||
public String getHint() { | ||
return HINT; | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/life/offonoff/ab/exception/ConcurrencyViolationException.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 life.offonoff.ab.exception; | ||
|
||
import org.springframework.http.HttpStatus; | ||
|
||
public abstract class ConcurrencyViolationException extends AbException{ | ||
private static final AbCode AB_CODE = AbCode.CONCURRENCY_VIOLATION; | ||
private static final String MESSAGE = "서버 문제가 발생했습니다. 다시 시도해주세요."; | ||
|
||
public ConcurrencyViolationException() { | ||
super(MESSAGE); | ||
} | ||
|
||
@Override | ||
public int getHttpStatusCode() { | ||
return HttpStatus.CONFLICT.value(); | ||
} | ||
|
||
@Override | ||
public AbCode getAbCode() { | ||
return AB_CODE; | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/life/offonoff/ab/exception/VoteConcurrencyException.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 life.offonoff.ab.exception; | ||
|
||
public class VoteConcurrencyException extends ConcurrencyViolationException { | ||
private static final String HINT = "투표 시 동시성 문제 발생"; | ||
|
||
@Override | ||
public String getHint() { | ||
return HINT; | ||
} | ||
} |
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