-
Notifications
You must be signed in to change notification settings - Fork 1
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] 컨텐츠 preview, search, scrap-count 에 isPointRequired 추가 #344
Conversation
// isPointRequired를 col로 받기 위해 확인하는 쿼리, 비로그인 상태 false 리턴 | ||
private Expression<?> getIsPointRequiredByUserId(Long userId, NumberPath<Long> contentId) { | ||
return userId != null ? | ||
JPAExpressions | ||
.selectOne() | ||
.from(paymentContentHistoryEntity) | ||
.where(isContentExpired(paymentContentHistoryEntity.expiredAt) | ||
.and(paymentContentHistoryEntity.contentId.eq(contentId)) | ||
.and(paymentContentHistoryEntity.userId.eq(userId))) | ||
.exists() | ||
: Expressions.constant(false); | ||
} |
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.
IsPointRequired 가 true라면 Point를 내야 content를 볼 수 있다고 생각이 드는데요.
만약 그렇다면 결과가 비로그인시에는 true고 paymentContentHistoryEntity에 존재한다면 false여야 할 것 같습니다.
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.
맞네요 수정했습니다
추가로 exists 가 아니라 notExists 여야 포인트가 필요할때 true가 리턴되도록 수정했습니
.and(expiredAt.year().gt(today.getYear()) | ||
.or(expiredAt.year().eq(today.getYear()) |
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.
gt와 eq를 합친 ge 메서드가 있었던 거 같은데 말이죠..
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.
goe 로 수정했습니다
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.
고생하셨습니다.
PR 타입 (하나 이상의 PR 타입을 선택해주세요)
변경 사항
참고 사항
셀프 체크리스트