Skip to content

Conversation

@zerochani
Copy link
Collaborator

6주차 미션 수행했습니다.

- Store owner 매핑을 member_id로 수정
- MemberFoodPreference에 BaseTimeEntity 상속 추가
- Photo 엔티티 Builder 패턴 정리
- 모든 관계 매핑에 fetch = FetchType.LAZY 명시적 선언
- @lob 필드에 @basic(fetch = FetchType.LAZY) 추가로 성능 최적화
- @Builder.Default 추가로 빌더 패턴에서 기본값 보장
- JPQL @query방식으로 중복 리뷰 체크
- ReviewService에 리뷰 작성 로직 구현
- MemberRepository, StoreRepository 추가
- @TestPropertySource로 H2 데이터베이스 설정 추가
- H2 의존성 추가로 빌드 실패 문제 해결
- ErrorCode enum 및 BusinessException 구현
- GlobalExceptionHandler로 전역 예외 처리
- ErrorResponse DTO로 일관된 에러 응답 제공
- ReviewService 예외 처리 개선
- MemberService 및 getMyPage 메서드 추가
- MyPageResponse DTO 생성
- ReviewRepository에 countByMemberId 메서드 추가
- InquiryRepository 생성 및 countByMemberId 메서드 추가
- NotificationSettingRepository 생성 및 findByMemberId 메서드 추가
- 메서드 이름 생성 방식에서 @query로 변경
-연관 엔티티의 속성 접근 시 JPQL 사용으로 일관성 확보
- Mission, Store 엔티티의 일대다 컬렉션에 @batchsize 적용
- N+1 문제 방지 및 메모리 페이징 문제 예방
Copy link
Collaborator

@yujin9907 yujin9907 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

계층별로 깔끔하게 분리된 코드 같아요 👍
6주차 내용에 더하여 fetch join, count 를 이용하여 n+1 문제, 페이지네이션 문제까지 깔끔하게 해결해주셨슴니다
고생 많으셨습니다!


//검색 - 별점순 필터링 및 가게별 조건 추가
@GetMapping("/search")
public List<Review> searchReview(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ModelAttribute SearchReviewRequest request 와 같이 사용해도 좋을 거 같습니다

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여러개의 파라미터를 받을 경우에 사용하면 좋네요! 감사합니다!

request.getSortDirection()
);

List<Review> reviews = queryFactory
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left join으로 인한 중복으로 인해, findMyReviews()에서는 distinct()를 호출해주셨습니다. searchReview() 에서도 사진 갯수만큼 리뷰가 중복되지 않는지, 확인이 필요할 거 같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아 제가 까먹었네요... 감사합니다!

@zerochani zerochani closed this Nov 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants