Skip to content

Commit

Permalink
[style] : 코드 리포멧팅
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun2371 committed Aug 7, 2024
1 parent 36ae9ea commit 63a553e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/main/java/com/dnd/gongmuin/answer/service/AnswerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ public class AnswerService {
private final QuestionPostRepository questionPostRepository;
private final AnswerRepository answerRepository;

private static void validateIfQuestioner(Member member, QuestionPost questionPost) {
if (!questionPost.isQuestioner(member)) {
throw new ValidationException(QuestionPostErrorCode.NOT_AUTHORIZED);
}
}

@Transactional
public AnswerDetailResponse registerAnswer(
Long questionPostId,
Expand Down Expand Up @@ -60,12 +66,6 @@ public AnswerDetailResponse chooseAnswer(
return AnswerMapper.toAnswerDetailResponse(answer);
}

private static void validateIfQuestioner(Member member, QuestionPost questionPost) {
if (!questionPost.isQuestioner(member)) {
throw new ValidationException(QuestionPostErrorCode.NOT_AUTHORIZED);
}
}

private void validateIfQuestionPostExists(Long questionPostId) {
boolean isExists = questionPostRepository.existsById(questionPostId);
if (!isExists) {
Expand Down

0 comments on commit 63a553e

Please sign in to comment.