Conversation
…nReservation APIs
…d in ReservationAPI 예약기능 Example Value의 cartIds를 구체적인 예시로 표현하였습니다.
3 tasks
ppusda
reviewed
Jan 28, 2025
|
|
||
| public interface ReservationCommandRepository extends JpaRepository<Reservation, Long> { | ||
|
|
||
| List<Reservation> findAllByStatus(ReservationStatus reservationStatus); |
Contributor
There was a problem hiding this comment.
CommandRepository로 나누게 되었다면 findAllByStatus는 QueryRepository로 분리하는 게 더 좋을 것 같다고 생각됩니다.
좀 더 찾아보니 아래와 같은 구조도 사용되는 것 같아서 참고하셔도 좋을 것 같아용.
복잡한 쿼리의 경우에만 분리
기존 JpaRepository 를 상속받는 Repository를 그대로 사용 (간단한 조회 및 CUD 사용)
QueryRepository (복잡한 쿼리의 경우에 사용, 보통 QueryDsl을 사용함)
이렇게 하면 QueryService의 경우 두 가지 Repository를 의존해야 한다는 점이 문제지만, 서비스가 복잡하지 않은 경우에는 이 방법이 더 좋을 것 같다고도 생각이 드네용.
향후 조회 로직을 모두 QueryDsl을 활용하여 QueryRepository에서 최적화하여 구현하여 완전히 분리하는 방법도 있을 것 같습니다.
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.
이슈
작업 내용
참고사항
이번 취지는 Reservation만 리팩토링을 진행하는것을 목표로 하였기에 전체 page defalutValue를 수정하지 않은 점 참고부탁드립니다.
CQRS 적용 및 Swagger 정리를 하였고 비즈니스 로직 수정은 Cart 리팩토링 후 진행할 것 같습니다.