-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Controller advice 에 로깅 추가 * refactor: 스택 트레이스 로깅 추가 * feat: 리뷰그룹 생성시 길이 검증 로깅 추가 * feat: 답변 길이 검증 로깅 추가 * feat: 리뷰 그룹 코드 검증 검증 로깅 추가 * feat: 리뷰 조회 검증 검증 로깅 추가 * feat: 선택된 키워드 존재하지 않는 검증 로깅 추가 * feat: 중복 선택된 키워드 검증 로깅 추가 * feat: 키워드 조회 검증 로깅 추가 * feat: 선택 키워드 갯수 검증 로깅 추가 * feat: 선택된 질문 중복 검증 로깅 추가 * feat: 질문 조회 검증 로깅 추가 * feat: 중복 질문 검증 로깅 추가 * feat: 스프링 발생 예외 로깅에 메세지 추가 * feat: 인코딩 설정 * style: 개행 수정 Co-authored-by: Donghoon Lee <[email protected]> * style: 개행 및 공백 수정 * refactor: 불필요한 검증 제거 - 선택된 키워드와 질문이 DB에 있는지를 validator 에서 검증한 후에도, repository.getById 를 할 때 한번 더 검증이 들어간다. 따라서 'DB에 있는지'에 대한 검증을 validator 에서 할 필요는 없다는 판단 하에 해당 로직을 삭제한다. --------- Co-authored-by: Donghoon Lee <[email protected]>
- Loading branch information
Showing
26 changed files
with
128 additions
and
105 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
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/reviewme/keyword/domain/exception/DuplicateKeywordException.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,10 +1,14 @@ | ||
package reviewme.keyword.domain.exception; | ||
|
||
import java.util.List; | ||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class DuplicateKeywordException extends BadRequestException { | ||
|
||
public DuplicateKeywordException() { | ||
public DuplicateKeywordException(List<Long> selectedKeywordIds) { | ||
super("키워드는 중복되지 않게 선택해 주세요."); | ||
log.info("Selected keywords are duplicated - selectedKeywordIds: {}", selectedKeywordIds); | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
backend/src/main/java/reviewme/keyword/domain/exception/KeywordLimitExceedException.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,10 +1,13 @@ | ||
package reviewme.keyword.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class KeywordLimitExceedException extends BadRequestException { | ||
|
||
public KeywordLimitExceedException(int minSize, int maxSize) { | ||
super("키워드는 최소 %d개, 최대 %d개 선택할 수 있어요.".formatted(minSize, maxSize)); | ||
log.info("Selected keywords are out of bound - minSize:{}, maxSize: {}", minSize, maxSize); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
backend/src/main/java/reviewme/keyword/domain/exception/KeywordNotFoundException.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,10 +1,13 @@ | ||
package reviewme.keyword.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.NotFoundException; | ||
|
||
@Slf4j | ||
public class KeywordNotFoundException extends NotFoundException { | ||
|
||
public KeywordNotFoundException() { | ||
public KeywordNotFoundException(long id) { | ||
super("키워드가 존재하지 않아요."); | ||
log.info("Keyword not found by id - id: {}", id); | ||
} | ||
} |
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
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/reviewme/question/domain/exception/DuplicateQuestionException.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,10 +1,14 @@ | ||
package reviewme.question.domain.exception; | ||
|
||
import java.util.List; | ||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class DuplicateQuestionException extends BadRequestException { | ||
|
||
public DuplicateQuestionException() { | ||
public DuplicateQuestionException(List<Long> selectedQuestionIds) { | ||
super("질문은 중복될 수 없어요."); | ||
log.info("Selected questions are duplicated - selectedQuestionIds: {}", selectedQuestionIds); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
backend/src/main/java/reviewme/question/domain/exception/QuestionNotFoundException.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,10 +1,13 @@ | ||
package reviewme.question.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.NotFoundException; | ||
|
||
@Slf4j | ||
public class QuestionNotFoundException extends NotFoundException { | ||
|
||
public QuestionNotFoundException() { | ||
public QuestionNotFoundException(long questionId) { | ||
super("질문이 존재하지 않아요."); | ||
log.info("Question not found - questionId: {}", questionId); | ||
} | ||
} |
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
6 changes: 5 additions & 1 deletion
6
backend/src/main/java/reviewme/review/domain/exception/InvalidAnswerLengthException.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,10 +1,14 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class InvalidAnswerLengthException extends BadRequestException { | ||
|
||
public InvalidAnswerLengthException(int minLength, int maxLength) { | ||
public InvalidAnswerLengthException(int answerLength, int minLength, int maxLength) { | ||
super("답변의 길이는 %d자 이상 %d자 이하여야 합니다.".formatted(minLength, maxLength)); | ||
log.info("AnswerLength is out of bound - answerLength:{}, minLength: {}, maxLength: {}", | ||
answerLength, minLength, maxLength); | ||
} | ||
} |
8 changes: 6 additions & 2 deletions
8
...end/src/main/java/reviewme/review/domain/exception/InvalidProjectNameLengthException.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,10 +1,14 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class InvalidProjectNameLengthException extends BadRequestException { | ||
|
||
public InvalidProjectNameLengthException(int maxLength) { | ||
super("프로젝트 이름은 1글자 이상 %d글자 이하여야 해요.".formatted(maxLength)); | ||
public InvalidProjectNameLengthException(int projectNameLength, int minLength, int maxLength) { | ||
super("프로젝트 이름은 %d글자 이상 %d글자 이하여야 해요.".formatted(minLength, maxLength)); | ||
log.info("ProjectName is out of bound - projectNameLength:{}, minLength:{}, maxLength: {}", | ||
projectNameLength, minLength, maxLength); | ||
} | ||
} |
8 changes: 6 additions & 2 deletions
8
...nd/src/main/java/reviewme/review/domain/exception/InvalidRevieweeNameLengthException.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,10 +1,14 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class InvalidRevieweeNameLengthException extends BadRequestException { | ||
|
||
public InvalidRevieweeNameLengthException(int maxLength) { | ||
super("리뷰이 이름은 1글자 이상 %d글자 이하여야 해요.".formatted(maxLength)); | ||
public InvalidRevieweeNameLengthException(int revieweeNameLength, int minLength, int maxLength) { | ||
super("리뷰이 이름은 %d글자 이상 %d글자 이하여야 해요.".formatted(minLength, maxLength)); | ||
log.info("RevieweeName is out of bound - revieweeNameLength:{}, minLength:{}, maxLength: {}", | ||
revieweeNameLength, minLength, maxLength); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
.../java/reviewme/review/domain/exception/ReviewGroupNotFoundByGroupAccessCodeException.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,13 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.NotFoundException; | ||
|
||
@Slf4j | ||
public class ReviewGroupNotFoundByGroupAccessCodeException extends NotFoundException { | ||
|
||
public ReviewGroupNotFoundByGroupAccessCodeException(String groupAccessCode) { | ||
super("리뷰 그룹을 찾을 수 없어요."); | ||
log.info("ReviewGroup not found by groupAccessCode - groupAccessCode: {}", groupAccessCode); | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...ava/reviewme/review/domain/exception/ReviewGroupNotFoundByRequestReviewCodeException.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,13 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.NotFoundException; | ||
|
||
@Slf4j | ||
public class ReviewGroupNotFoundByRequestReviewCodeException extends NotFoundException { | ||
|
||
public ReviewGroupNotFoundByRequestReviewCodeException(String requestReviewCode) { | ||
super("리뷰 요청 코드에 대한 리뷰 그룹을 찾을 수 없어요."); | ||
log.info("ReviewGroup not found by requestReviewCode - requestReviewCode: {}", requestReviewCode); | ||
} | ||
} |
10 changes: 0 additions & 10 deletions
10
backend/src/main/java/reviewme/review/domain/exception/ReviewGroupNotFoundException.java
This file was deleted.
Oops, something went wrong.
5 changes: 4 additions & 1 deletion
5
...end/src/main/java/reviewme/review/domain/exception/ReviewIsNotInReviewGroupException.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,10 +1,13 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.BadRequestException; | ||
|
||
@Slf4j | ||
public class ReviewIsNotInReviewGroupException extends BadRequestException { | ||
|
||
public ReviewIsNotInReviewGroupException() { | ||
public ReviewIsNotInReviewGroupException(long reviewId, long reviewGroupId) { | ||
super("리뷰 그룹에 해당하는 리뷰가 아니에요."); | ||
log.info("Review is not in review group - reviewId: {}, reviewGroupId: {}", reviewId, reviewGroupId); | ||
} | ||
} |
5 changes: 4 additions & 1 deletion
5
backend/src/main/java/reviewme/review/domain/exception/ReviewNotFoundException.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,10 +1,13 @@ | ||
package reviewme.review.domain.exception; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import reviewme.global.exception.NotFoundException; | ||
|
||
@Slf4j | ||
public class ReviewNotFoundException extends NotFoundException { | ||
|
||
public ReviewNotFoundException() { | ||
public ReviewNotFoundException(long id) { | ||
super("리뷰가 존재하지 않아요."); | ||
log.info("ReviewNotFoundException is occurred - id: {}", id); | ||
} | ||
} |
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.