parent
4cee0e3585
commit
a529f05825
|
@ -187,7 +187,10 @@ class AudioContentQueryRepositoryImpl(private val queryFactory: JPAQueryFactory)
|
|||
Expressions.constant(0),
|
||||
pinContent.id.isNotNull,
|
||||
audioContent.isAdult,
|
||||
audioContent.releaseDate.gt(LocalDateTime.now())
|
||||
audioContent.releaseDate.gt(LocalDateTime.now()),
|
||||
Expressions.asBoolean(false),
|
||||
Expressions.asBoolean(false),
|
||||
audioContent.remaining.isNotNull.and(audioContent.remaining.loe(0))
|
||||
)
|
||||
)
|
||||
.from(audioContent)
|
||||
|
|
|
@ -666,12 +666,24 @@ class AudioContentService(
|
|||
.map {
|
||||
val commentCount = commentRepository
|
||||
.totalCountCommentByContentId(it.contentId)
|
||||
it.commentCount = commentCount
|
||||
|
||||
val likeCount = audioContentLikeRepository
|
||||
.totalCountAudioContentLike(it.contentId)
|
||||
|
||||
it.likeCount = likeCount
|
||||
it.commentCount = commentCount
|
||||
|
||||
val (isExistsAudioContent, orderType) = orderRepository.isExistOrderedAndOrderType(
|
||||
memberId = member.id!!,
|
||||
contentId = it.contentId
|
||||
)
|
||||
|
||||
if (isExistsAudioContent) {
|
||||
if (orderType == OrderType.RENTAL) {
|
||||
it.isRented = true
|
||||
} else {
|
||||
it.isOwned = true
|
||||
}
|
||||
}
|
||||
|
||||
it
|
||||
}
|
||||
|
|
|
@ -18,5 +18,8 @@ data class GetAudioContentListItem @QueryProjection constructor(
|
|||
var commentCount: Int = 0,
|
||||
val isPin: Boolean,
|
||||
val isAdult: Boolean,
|
||||
val isScheduledToOpen: Boolean
|
||||
val isScheduledToOpen: Boolean,
|
||||
var isRented: Boolean,
|
||||
var isOwned: Boolean,
|
||||
var isSoldOut: Boolean
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue