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 기능 추가하기 #427

Merged
merged 7 commits into from
Jul 3, 2024

Conversation

AlmondBreez3
Copy link
Member

@AlmondBreez3 AlmondBreez3 commented Jun 30, 2024

🌱 관련 이슈

📌 작업 내용 및 특이사항

  • 쿠폰 조회 검색 option : 쿠폰 명
  • 발급된 쿠폰 조회 검색 option : 학번 이름 전번 쿠폰명 사용여부 회수여부
  • 라고 하네요! 이대로 구현을 했습니답
  • 쿠폰은 페이지네이션 없습니다

📝 참고사항

📚 기타

@AlmondBreez3 AlmondBreez3 self-assigned this Jun 30, 2024
@AlmondBreez3 AlmondBreez3 requested a review from a team as a code owner June 30, 2024 07:35
Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Member

@Sangwook02 Sangwook02 left a comment

Choose a reason for hiding this comment

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

Lgtm

Copy link

Job Summary for Gradle

Check Style and Test to Develop :: build-test
Gradle Root Project Requested Tasks Gradle Version Build Outcome Build Scan®
gdsc check 8.5 Build Scan published

Copy link
Contributor

@seulgi99 seulgi99 left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. 리뷰한거 읽어봐주세여~~ 일단 어프로브드립니다!

.orderBy(issuedCoupon.createdAt.desc())
.fetch();

JPAQuery<Long> countQuery =
Copy link
Contributor

@seulgi99 seulgi99 Jul 1, 2024

Choose a reason for hiding this comment

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

여기서 countQuery를 써서 하는것도 좋지만, 이렇게 동일조건으로 두번 조회하면 where문에 따른 같은양의 조인이 중복적으로
발생할거같습니다.

List fetch = queryFactory. 여기 where조건에서 보시다시피 쿠폰, 멤버를 조인해야하는데
동일 조건의 아래 countquery에서도 마찬가지로 두번의 조인이 발생하니까요!

그렇다면

List<Long> ids = queryFactory.select(issuedCoupon.id).from(issuedCoupon).where(matchesQueryOption(queryOption)).fetch();

를써서 id 리스트만 받아오고 그것의 ids.size()로 카운팅을 하면 카운트쿼리가 해결되지않을까요?

그리고 이 id리스트로 실데이터 조회시엔 where(issuedCoupon.id.in(ids))로 넣으면 중복적인 조인은 발생하지 않을거에요!!

이건 성능적으로만 생각하면 되니 가볍게 봐주세요.

Copy link
Member

@uwoobeat uwoobeat left a comment

Choose a reason for hiding this comment

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

lgtm

@AlmondBreez3 AlmondBreez3 merged commit ba32c43 into develop Jul 3, 2024
1 check passed
@AlmondBreez3 AlmondBreez3 deleted the feature/425-coupon-get-api branch July 8, 2024 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ 쿠폰 및 발급쿠폰 조회 API 관련 기능 추가
4 participants