-
Notifications
You must be signed in to change notification settings - Fork 2
♻️ refactor : 다대다 테이블 변환 #100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 19 commits
9d471b9
0d245a5
8490cdb
74dd3f7
bbc2c06
38eda17
bb00c6f
2724853
b20c018
64f98dc
7758a7d
60743e8
302a496
8bc2684
3e56be9
ecad4b2
847550f
83ca622
282fb6c
8e0671b
b3a33e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ build/ | |
| !**/src/test/**/build/ | ||
| *.yml | ||
| .env | ||
| data.sql | ||
|
|
||
| ### STS ### | ||
| .apt_generated | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. HashTagService는 해시태그를 정렬해서 응답하는 단순하고 명확한 책임을 잘 수행하고 있어요.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 감사합니다!! 필수 해시태그가 있기에 이렇게 수정해두었습니다!! |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 리뷰와 해시태그 사이의 연결을 관리하는 서비스로서 create, load, delete, getByReview 등의 기능을 책임별로 잘 나눈 것 같습니다! 또한 해시태그 저장 시 각 파트별 1개 이상 필수 조건을 HashTagType 기준으로 검증한 로직은 비즈니스 로직 표현이 잘 된 것 같습니다!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 감사합니다!! |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Auditorium → Seat → ReviewSeat → Review → ReviewHashTag로 전체 경로를 정확히 명시한 점이 아주 좋은 것 같습니다! DTO Projection 방식으로 성능적 이점도 챙겼습니다. 고생하셨습니다!
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 감사합니다!! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,12 @@ | ||
| package com.seeat.server.domain.image.domain.repository; | ||
|
|
||
| import com.seeat.server.domain.review.domain.entity.Review; | ||
| import com.seeat.server.domain.image.domain.entity.ReviewImage; | ||
| import org.springframework.data.jpa.repository.JpaRepository; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| public interface ReviewImageRepository extends JpaRepository<ReviewImage, Long> { | ||
| List<ReviewImage> findByReview(Review review); | ||
| List<ReviewImage> findByReview_Id(Long reviewId); | ||
|
|
||
| void deleteAllByImageUrlIn(List<String> imageUrls); | ||
| } |
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Review, Seats, Images, HashTags 등의 도메인 데이터를 명확히 분리한 것이 포인트이고, seats.get(0)을 기준으로 상영관 정보를 추출한 판단은 도메인 룰(모든 좌석은 같은 상영관)에 기반해 설계된 것으로 적절한 것 같습니다! |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| package com.seeat.server.domain.review.application.dto.response; | ||
|
|
||
| import com.seeat.server.domain.review.domain.entity.Review; | ||
| import lombok.Builder; | ||
| import java.util.List; | ||
|
|
||
| @Builder | ||
| public record ReviewSaveResponse(Long reviewId) { | ||
|
|
||
|
|
||
| /// 정적 팩토리 메서드 | ||
| public static ReviewSaveResponse from(Review review) { | ||
| return ReviewSaveResponse.builder() | ||
| .reviewId(review.getId()) | ||
| .build(); | ||
| } | ||
|
|
||
| /// 정적 팩토리 메서드 | ||
| public static List<ReviewSaveResponse> from(List<Review> reviews){ | ||
| return reviews.stream() | ||
| .map(ReviewSaveResponse::from) | ||
| .toList(); | ||
| } | ||
|
|
||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
인기 리뷰 리스트를 제공하기 위한 DTO 구성과 BestReviewSnapshot 또는 Review+해시태그+좋아요 수 기반 생성 로직을 모두 분리해서 제공한 점이 좋은 것 같습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
감사합니다!!