Skip to content
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

feat : 최근 상품 코멘트 조회 api #57

Merged
merged 5 commits into from
Jul 14, 2023

Conversation

gengminy
Copy link
Member

개요

작업사항

  • 메인화면: 모든 상품들에 달린 최신 코멘트를 최대 10개까지 가져오는 api

변경로직

  • api/comment
  • domain/comment

참고사항

  • ProductCommentLike 작업 후 수정 가능성 있음

@gengminy gengminy added ✨ Feature 기능 개발 📬 API 서버 API 통신 labels Jul 12, 2023
@gengminy gengminy self-assigned this Jul 12, 2023
.where(productComment.valid.isTrue)
.orderBy(productComment.productCommentId.desc())
.select(productDetailVOProjection())
.limit(10)
Copy link
Contributor

@kingjakeu kingjakeu Jul 12, 2023

Choose a reason for hiding this comment

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

이렇게 query에 조회 size 매직넘버 다는것보다, 메소드 파람으로 들고오는게 맞아보여요
productDetailVOProjection 보다 ProductComment로 뽑아내고
코멘트 도메인이 자주 쓰일거라 ProductComment에 조인된 애들 Lazy로 걸어 놓는게 나을거 맞을거 같아요. Product 쪽 참고

Copy link
Contributor

Choose a reason for hiding this comment

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

쿼리 고치는김에, 무한 스크롤대비 offset 조회로 만들면 좋을듯

Copy link
Member Author

Choose a reason for hiding this comment

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

반영했습니다!

Comment on lines 38 to 42
@JoinColumn(name = "productId", referencedColumnName = "productId", insertable = false, updatable = false)
@JoinColumn(name = "memberId", referencedColumnName = "memberId", insertable = false, updatable = false)
val memberProductLikeMappingList: Set<MemberProductLikeMapping> = setOf()
): BaseEntity(), Serializable
Copy link
Member Author

Choose a reason for hiding this comment

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

복합키로 테이블 가져오려면 Serializable 을 implement 해야한다는데 이 부분 괜찮을까요

Copy link
Contributor

Choose a reason for hiding this comment

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

앗... 그럼 그냥 VO 처리해요.
그리고 OneToMany 가져가는 애들 편의를 위해 fetchJoin 처리 하자는거여서
ManyToOne 은 예전 형태로 해주세요... 원복처리 쏘리...

Copy link
Member Author

Choose a reason for hiding this comment

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

넵 commentDetailVO 로 롤백할게요 😥

@kingjakeu kingjakeu merged commit c49b247 into develop Jul 14, 2023
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 API 서버 API 통신 ✨ Feature 기능 개발
Projects
None yet
Development

Successfully merging this pull request may close these issues.

최근 리뷰 api
2 participants