Skip to content

Conversation

@doup2001
Copy link
Member

@doup2001 doup2001 commented Aug 4, 2025

📌 작업한 내용

  • 리뷰와 좌석 간 다대다 관계 적용을 중심으로 전반적인 도메인 및 서비스 로직 리팩토링을 진행했습니다.
  • 해시태그, 마이페이지, 리뷰 생성 관련 기능들을 포함한 전체 흐름을 재정비했습니다.
  • 검색, 마이페이지 조회, 삭제 로직 등 다양한 기능의 쿼리와 테스트도 수정하였습니다.

📁 구조/파일 변경

해시태그, 검색, 컨버터 관련 폴더 기능별로 분리
필요없는 파일 정리

♻️ 리팩토링

Review ↔ Seat 다대다 관계 도입
→ ReviewSeat 중간 테이블 생성 및 적용
기존 리뷰 도메인 및 서비스 코드 전반 수정
Projection DTO 인터페이스화 및 관련 서비스 코드 적용

✨ 기능 추가/수정

리뷰 생성 시, 프론트에 ID 응답값으로 전달되도록 수정
마이페이지 리뷰 개수 및 좋아요 수 조회 로직 수정
검색 로직 정비 및 테스트 구현
마이페이지에서 유저 레벨 계산 로직 정비

✅ 테스트 수정

다대다 관계 적용에 따라 기존 리뷰 테스트 전면 수정
마이페이지 및 검색 관련 테스트 코드 추가

🔍 참고 사항

🖼️ 스크린샷

🔗 관련 이슈

#98 #99

✅ 체크리스트

  • 로컬에서 빌드 및 테스트 완료
  • 코드 리뷰 반영 완료
  • [ㅌ] 문서화 필요 여부 확인

@doup2001 doup2001 requested review from RokChoi and soo0711 August 4, 2025 14:10
@doup2001 doup2001 self-assigned this Aug 4, 2025
@doup2001 doup2001 added ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링 📬 API 서버 API 통신 labels Aug 4, 2025
@github-actions
Copy link

github-actions bot commented Aug 4, 2025

Test Coverage Report

File Coverage [77.85%] 🍏
ReviewBestContentMediator.java 100% 🍏
HashTagType.java 100% 🍏
ReviewSeat.java 100% 🍏
Review.java 100% 🍏
ReviewHashTagService.java 96.39% 🍏
ReviewSearchService.java 95.08% 🍏
ReviewService.java 88.5% 🍏
ReviewRepositoryImpl.java 87.42% 🍏
ReviewSeatService.java 80.36% 🍏
UserProfileService.java 79.84% 🍏
ReviewImageService.java 79.79% 🍏
ReviewSortTypeConverter.java 9.38% 🍏
TheaterAuditoriumTypeConverter.java 9.38% 🍏
HashTagController.java 0% 🍏
SearchService.java 0% 🍏
ReviewController.java 0% 🍏
HashTagService.java 0% 🍏
Total Project Coverage 53.82% 🍏

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

Test Results

106 tests   - 1   106 ✅  - 1   14s ⏱️ +4s
 49 suites ±0     0 💤 ±0 
 49 files   ±0     0 ❌ ±0 

Results for commit b3a33e3. ± Comparison against base commit 1a28ff3.

This pull request removes 1 test.
com.seeat.server.domain.best.application.service.BestContentServiceIntTest$DeleteRedisCachingTest ‑ [happy] 리뷰를 작성한 사용자가 삭제할 경우, redis 인기상영관의 후기 개수와 후기 평점이 변경되는지

♻️ This comment has been updated with latest results.

Copy link
Contributor

Choose a reason for hiding this comment

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

인기 리뷰 리스트를 제공하기 위한 DTO 구성과 BestReviewSnapshot 또는 Review+해시태그+좋아요 수 기반 생성 로직을 모두 분리해서 제공한 점이 좋은 것 같습니다.

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

HashTagService는 해시태그를 정렬해서 응답하는 단순하고 명확한 책임을 잘 수행하고 있어요.
특히 Comparator.comparing(HashTag::getType)으로 타입 기준 정렬하고, DTO 변환을 분리한 점은 확장성 측면에서도 좋은 것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!! 필수 해시태그가 있기에 이렇게 수정해두었습니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

리뷰와 해시태그 사이의 연결을 관리하는 서비스로서 create, load, delete, getByReview 등의 기능을 책임별로 잘 나눈 것 같습니다! 또한 해시태그 저장 시 각 파트별 1개 이상 필수 조건을 HashTagType 기준으로 검증한 로직은 비즈니스 로직 표현이 잘 된 것 같습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

Auditorium → Seat → ReviewSeat → Review → ReviewHashTag로 전체 경로를 정확히 명시한 점이 아주 좋은 것 같습니다! DTO Projection 방식으로 성능적 이점도 챙겼습니다. 고생하셨습니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

감사합니다!!

Copy link
Contributor

Choose a reason for hiding this comment

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

Review, Seats, Images, HashTags 등의 도메인 데이터를 명확히 분리한 것이 포인트이고, seats.get(0)을 기준으로 상영관 정보를 추출한 판단은 도메인 룰(모든 좌석은 같은 상영관)에 기반해 설계된 것으로 적절한 것 같습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

ReviewSeatService는 리뷰와 좌석 간 N:N 관계 매핑 로직을 잘 구현되어 있는 것 같습니다. 다대다 관계에서 흔히 마주치는 여러 시나리오—연결, 조회, 해제, 일괄 조회—에 대한 처리가 명확하게 분리되어 있는 것 같습니다

Copy link
Contributor

Choose a reason for hiding this comment

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

네가 작성한 ReviewRepositoryImpl#searchReviewsWithFilters 는 검색 조건(키워드, 상영관 ID, 해시태그, 정렬)에 따라 유연하게 동작하도록 잘 설계된 JPA 커스텀 쿼리인 것 같습니다!

Copy link
Contributor

@soo0711 soo0711 left a comment

Choose a reason for hiding this comment

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

다대다 테이블로 변환하면 고칠게 진짜 많았는데 하나도 빠짐없이 잘 고치신 것 같습니다!! 테스트 부분도 그렇고 ReviewSeat 중간 테이블도 그렇고 정말 꼼꼼하신 것 같습니다 👍 !! hashtag도 도메인으로 따로 빼서 파일 가독성이 더 올라갔네요! 밑에 몇가지 궁금한 점 달아뒀습니다! 수고하셨습니다!

Comment on lines +3 to +5
public interface ReviewLikeCount{
Long getReviewCount();
Long getLikeCount();
Copy link
Contributor

Choose a reason for hiding this comment

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

ProjectionDTO는 인터페이스와 get을 사용하는건가요?? 진짜 궁금해서 여쭤봅니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

ProjectionDTO는 인터페이스와 get을 사용하는건가요?? 진짜 궁금해서 여쭤봅니다!

클래스 기반, 또는 인터페이스 기반 Projection 두 가지 방식으로 구분되는걸로 알고있습니다!! 기존에 인터페이스 기반 DTO로 맞춰뒀기에 일관성을 위해 인터페이스로 통일해두었습니다 ㅠㅠ!!

Comment on lines +45 to +48
Review review = reviewService.createReview(request, user.getId());

// DTO 변환
ReviewSaveResponse response = ReviewSaveResponse.from(review);
Copy link
Contributor

Choose a reason for hiding this comment

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

서비스 호출에서 DTO로 변환을 안하고 왜 컨트롤러에서 했는지 궁금합니다!

Copy link
Member Author

@doup2001 doup2001 Aug 4, 2025

Choose a reason for hiding this comment

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

서비스 호출에서 DTO로 변환을 안하고 왜 컨트롤러에서 했는지 궁금합니다!

헉 맞네요 !! 감사합니다!! 수정하겠습니다👍

Copy link
Member Author

Choose a reason for hiding this comment

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

서비스 호출에서 DTO로 변환을 안하고 왜 컨트롤러에서 했는지 궁금합니다!

테스트 로직때문에 서비스에서 Review로 끝나야했었네요!! 임시적으로 해두고 추후에 테스트 로직을 수정하는걸로 하겠습니다..!

@github-actions
Copy link

github-actions bot commented Aug 4, 2025

Test Coverage Report

File Coverage [77.85%] 🍏
ReviewBestContentMediator.java 100% 🍏
HashTagType.java 100% 🍏
ReviewSeat.java 100% 🍏
Review.java 100% 🍏
ReviewHashTagService.java 96.39% 🍏
ReviewSearchService.java 95.08% 🍏
ReviewService.java 88.5% 🍏
ReviewRepositoryImpl.java 87.42% 🍏
ReviewSeatService.java 80.36% 🍏
UserProfileService.java 79.84% 🍏
ReviewImageService.java 79.79% 🍏
ReviewSortTypeConverter.java 9.38% 🍏
TheaterAuditoriumTypeConverter.java 9.38% 🍏
HashTagController.java 0% 🍏
SearchService.java 0% 🍏
ReviewController.java 0% 🍏
HashTagService.java 0% 🍏
Total Project Coverage 53.82% 🍏

@doup2001 doup2001 merged commit c7727ea into develop Aug 4, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📬 API 서버 API 통신 ✨ Feature 기능 개발 🔨 Refactor 코드 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

📂 file : 리뷰에 뭉쳐져있는 도메인 파일 분리 🐞 bug : 리뷰와 좌석 간의 다다다 테이블로 변환 필요

4 participants