-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] 매거진 수정 api 변경, @Valid 적용, domain/s3로 폴더링 변경 #151
Conversation
Global Exception Handler에서 @Valid메시지만 추출할 수 있도록 변경했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니당 머지 하셔도 좋을 것 같아요
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨습니다~! 짱
String userName, | ||
@NotBlank | ||
@NotEmpty | ||
@NotBlank(message = "info는 \"\"일 수 없습니다.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
오 ""은 뭘까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"" 빈 스트링 들어올 경우에 message를 나타냅니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"" 인 이유가 궁금했습니다!
@@ -33,7 +33,7 @@ public ResponseEntity<ApiResponse> handleIllegalArgumentException(IllegalArgumen | |||
|
|||
@ExceptionHandler(MethodArgumentNotValidException.class) | |||
public ResponseEntity<ApiResponse> handleMethodArgumentNotValidException(MethodArgumentNotValidException exception){ | |||
ApiResponse response = ApiResponse.fail(EMPTY_METHOD_ARGUMENT.getMessage()); | |||
ApiResponse response = ApiResponse.fail(exception.getBindingResult().getAllErrors().get(0).getDefaultMessage()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getAllErrors의 0번째말고 다른 인덱스의 값들은 어떤게 들어있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래와 같습니당!
{ "success": false, "message": "[Field error in object 'userOnboardRequestDTO' on field 'userName': rejected value []; codes [Size.userOnboardRequestDTO.userName,Size.userName,Size.java.lang.String,Size]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [userOnboardRequestDTO.userName,userName]; arguments []; default message [userName],15,1]; default message [userName의 길이는 1글자 이상 15글자 이하여야 합니다.]]", "data": "" }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이게 0번째 인덱스의 값인가요?
question.setAnswerImage(null); | ||
question.setImageCaption(null); | ||
} else { | ||
question.setAnswerImage(questionVO.answerImage()); | ||
question.setImageCaption(questionVO.imageCaption()); | ||
} | ||
question.setMagazine(magazine); | ||
return question; | ||
}).collect(Collectors.toList()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
쓰이지 않는데 collect나 리스트 반환형이 필요한 이유가 있을까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
앗 리스트 반환이 필요합니다!
반환 후에 questionRepository에 save됩니다
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
음 해당 toQuestionEntity 메서드를 쓰는 곳 들을 보면 호출만 하고 반환값은 쓰이지 않아서요!
create, edit 메서드 모두 void 형 아닌가요?
for (int i = 0; i < requestQuestionSize; i++) { | ||
updateQuestionDetails(currentQuestions.get(i), request.questions().get(i)); | ||
} | ||
magazine.getQuestions().removeAll(currentQuestions.subList(request.questions().size(), currentQuestions.size())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
개수가 같다면 해당 로직은 실행 안해도 될거 같아요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
넵~ 수정하겠습니당
Related Issue 🚀
Work Description ✏️
PR Point 📸
기존
변화