-
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.
Showing
8 changed files
with
120 additions
and
40 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
32 changes: 32 additions & 0 deletions
32
src/main/java/life/offonoff/ab/exception/AlreadyVotedException.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,32 @@ | ||
package life.offonoff.ab.exception; | ||
|
||
import life.offonoff.ab.domain.topic.choice.ChoiceOption; | ||
|
||
public class AlreadyVotedException extends DuplicateException { | ||
|
||
private static final String MESSAGE = "이미 투표했습니다."; | ||
|
||
private final Long topicId; | ||
private final ChoiceOption votedOption; | ||
|
||
public AlreadyVotedException(Long topicId, ChoiceOption votedOption) { | ||
super(MESSAGE); | ||
this.topicId = topicId; | ||
this.votedOption = votedOption; | ||
} | ||
|
||
@Override | ||
public String getHint() { | ||
return "토픽[id=" + topicId + "]에 대해 투표 선택지[choiceOption=" + votedOption + "]로 이미 투표했습니다."; | ||
} | ||
|
||
@Override | ||
public AbCode getAbCode() { | ||
return AbCode.ALREADY_VOTED; | ||
} | ||
|
||
@Override | ||
public Object getPayload() { | ||
return votedOption; | ||
} | ||
} |
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