fix(content): 차단된 구매자의 오디오 상세 조회를 허용한다
This commit is contained in:
@@ -538,7 +538,15 @@ class AudioContentService(
|
||||
val creator = explorerQueryRepository.getMember(creatorId)
|
||||
?: throw SodaException(messageKey = "content.error.user_not_found")
|
||||
|
||||
if (isBlockedBetweenMembers(memberId = member.id!!, creatorId = creatorId)) {
|
||||
val (isExistsAudioContent, orderType) = orderRepository.isExistOrderedAndOrderType(
|
||||
memberId = member.id!!,
|
||||
contentId = audioContent.id!!
|
||||
)
|
||||
|
||||
val isBlocked = isBlockedBetweenMembers(memberId = member.id!!, creatorId = creatorId)
|
||||
val isBlockedAndPurchased = isBlocked && isExistsAudioContent
|
||||
|
||||
if (isBlocked && !isExistsAudioContent) {
|
||||
throw SodaException(messageKey = "content.error.blocked_access")
|
||||
}
|
||||
|
||||
@@ -547,11 +555,6 @@ class AudioContentService(
|
||||
memberId = member.id!!
|
||||
)
|
||||
|
||||
val (isExistsAudioContent, orderType) = orderRepository.isExistOrderedAndOrderType(
|
||||
memberId = member.id!!,
|
||||
contentId = audioContent.id!!
|
||||
)
|
||||
|
||||
val orderSequence = if (isExistsAudioContent) {
|
||||
limitedEditionOrderRepository.getOrderSequence(
|
||||
contentId = audioContent.id!!,
|
||||
@@ -561,7 +564,12 @@ class AudioContentService(
|
||||
null
|
||||
}
|
||||
|
||||
val seriesId = repository.findSeriesIdByContentId(audioContent.id!!, isAdult)
|
||||
val seriesId = if (isBlockedAndPurchased) {
|
||||
null
|
||||
} else {
|
||||
repository.findSeriesIdByContentId(audioContent.id!!, isAdult)
|
||||
}
|
||||
|
||||
val previousContent = if (seriesId != null) {
|
||||
repository.findPreviousContent(
|
||||
seriesId = seriesId,
|
||||
@@ -592,7 +600,7 @@ class AudioContentService(
|
||||
}
|
||||
|
||||
// 댓글
|
||||
val commentList = if (audioContent.isCommentAvailable) {
|
||||
val commentList = if (!isBlockedAndPurchased && audioContent.isCommentAvailable) {
|
||||
commentRepository.findByContentId(
|
||||
cloudFrontHost = coverImageHost,
|
||||
contentId = audioContent.id!!,
|
||||
@@ -607,7 +615,7 @@ class AudioContentService(
|
||||
}
|
||||
|
||||
// 댓글 수
|
||||
val commentCount = if (audioContent.isCommentAvailable) {
|
||||
val commentCount = if (!isBlockedAndPurchased && audioContent.isCommentAvailable) {
|
||||
commentRepository.totalCountCommentByContentId(
|
||||
contentId = audioContent.id!!,
|
||||
memberId = member.id!!,
|
||||
|
||||
Reference in New Issue
Block a user