[Spring Core] 하수한 8, 9, 10단계 미션 제출합니다. #532
Open
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.
안녕하세요 김준수 리뷰어님! 이번 Spring Core 8, 9, 10단계 리뷰이로 참여하게된 하수한이라고 합니다!
이번 미션을 통해 처음 리뷰를 부탁드리는 것 같은데, 잘 부탁드립니다!
이번 단계에서는
동적으로 시간을 관리할 수 있는 기능 추가를 중심으로 진행했습니다.다음은 현재 프로젝트 구조입니다:
다음은 구현 과정에서 발생한 질문 사항입니다:
[ { "id": 1, "name": "123", "date": "2025-11-01", "time": { "time": "10:00:00", "id": 1 } } ]기존 LocalTime 타입의 time 필드를 Time 객체로 변경한 뒤로 다음과 같이 JSON 필드가 자동으로 변경되었는데, 어떠한 사유로 인해 저렇게 변경된 것인지 궁금합니다! Time 객체로 변경하면서 저 부분도 Spring에서 자동으로 파싱? 해준걸까요..?
ReservationCreateRequest에서@ValidTimeId를 통해 입력 값에 대한 검증을 수행하고 있는데, 이 custom bean validator의 경우 내부적으로TimeService.getById()를 호출하여 검증을 진행하고 있습니다. 검증 이후ReservationService::createReservation()에서도 위 메소드를 한번 더 호출하여 Time 객체를 받아오고 있는데, 이렇게 검증단에서 한번, 실제 비즈니스 로직에서 한번 더 호출함으로써 DB에 요청을 두번 날리게 되는 것이라고 보여지는데, 이게 과연 좋은 접근 방식인지 궁금합니다.긴 글 읽어주셔서 감사합니다!! 🙂