전남대 BE_김명진_ 2주차 과제(Step1)#141
Open
kmj452 wants to merge 13 commits intokakao-tech-campus-2nd-step2:kmj452from
Open
전남대 BE_김명진_ 2주차 과제(Step1)#141kmj452 wants to merge 13 commits intokakao-tech-campus-2nd-step2:kmj452from
kmj452 wants to merge 13 commits intokakao-tech-campus-2nd-step2:kmj452from
Conversation
Hongdonggeon
requested changes
Jul 6, 2024
Hongdonggeon
left a comment
There was a problem hiding this comment.
안녕하세요 명진님 전체적으로 잘 구현해셨네요!!
간단한 코멘트 남겨놓았습니다!
반영하시면서 궁금한점 있으면 편하게 DM 주세요 😃
| public String showEditForm(@PathVariable("id") Long id, Model model) { | ||
| if (productService.getProductById(id) == null) { | ||
| throw new RuntimeException("해당 id의 상품이 존재하지 않습니다"); | ||
| } |
There was a problem hiding this comment.
검증 로직은 Controller 계층보다 Service 계층에서 해주는게 더 좋지않을까요?
각 레이어의 역할에 대해서 학습해보시면 좋을 것 같습니다!
| import java.util.Map; | ||
|
|
||
| @RestControllerAdvice | ||
| public class GlobalExceptionHandler { |
There was a problem hiding this comment.
예측하지 못한 서버에러인 케이스도 (HttpStatus : 500 - Internal Server Error) 만들어주면 좋을 것 같아요!
| package gift.Validation; | ||
| import jakarta.validation.ConstraintValidator; | ||
| import jakarta.validation.ConstraintValidatorContext; | ||
| public class KakaoValidator implements ConstraintValidator<KaKao, String> { |
There was a problem hiding this comment.
ConstraintValidator 를 사용하셨네요 👍
카카오 검증만 이방법을 사용한 방법이 있을까요?
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
궁금한점: 카카오 라는 단어가 들어가면 협의후에 사용가능하다고 나와있는데 이건 관리자나 특수 사용자의 경우에 사용이 가능하다는 의미일까요? 커스텀 validation을 만들어 해결하긴했는데 다른 방법이 있는지 궁금합니다.
힘들었던점 :
오류를 처리하는데 힘들었습니다.... BindingResult 객체는 전역 핸들러를 사용하면 더이상 반환할 필요가 없단걸 꺠닫기까지 많은 시간이 소모되었습니다.