콘텐츠 상세, 팔로잉 리스트, 시리즈 상세 API

- 알림과 팔로우 상태값 추가
This commit is contained in:
Klaus 2024-09-13 19:24:40 +09:00
parent 20938e7d43
commit fd3d596d57
6 changed files with 23 additions and 12 deletions

View File

@ -450,8 +450,10 @@ class AudioContentService(
val creator = explorerQueryRepository.getMember(creatorId)
?: throw SodaException("없는 사용자 입니다.")
val notificationUserIds = explorerQueryRepository.getNotificationUserIds(creatorId)
val isFollowing = notificationUserIds.contains(member.id)
val creatorFollowing = explorerQueryRepository.getCreatorFollowing(
creatorId = creatorId,
memberId = member.id!!
)
// 구매 여부 확인
val isExistsBundleAudioContent = bundleAudioContentList
@ -640,7 +642,9 @@ class AudioContentService(
} else {
"$coverImageHost/profile/default-profile.png"
},
isFollowing = isFollowing
isFollowing = creatorFollowing?.isFollow ?: false,
isFollow = creatorFollowing?.isFollow ?: false,
isNotify = creatorFollowing?.isNotify ?: false
)
)
}

View File

@ -47,5 +47,7 @@ data class AudioContentCreator(
val creatorId: Long,
val nickname: String,
val profileImageUrl: String,
val isFollowing: Boolean
val isFollowing: Boolean,
val isFollow: Boolean,
val isNotify: Boolean
)

View File

@ -61,7 +61,7 @@ class ContentSeriesService(
throw SodaException("잘못된 시리즈 입니다.\n다시 시도해 주세요")
}
val isFollow = explorerQueryRepository.isFollow(
val creatorFollowing = explorerQueryRepository.getCreatorFollowing(
creatorId = series.member!!.id!!,
memberId = member.id!!
)
@ -102,7 +102,8 @@ class ContentSeriesService(
creatorId = series.member!!.id!!,
nickname = series.member!!.nickname,
profileImage = "$coverImageHost/${series.member!!.profileImage}",
isFollow = isFollow
isFollow = creatorFollowing?.isFollow ?: false,
isNotice = creatorFollowing?.isNotify ?: false
),
rentalMinPrice = rentalMinPrice,
rentalMaxPrice = rentalMaxPrice,

View File

@ -27,6 +27,7 @@ data class GetSeriesDetailResponse(
val creatorId: Long,
val nickname: String,
val profileImage: String,
val isFollow: Boolean
val isFollow: Boolean,
val isNotice: Boolean
)
}

View File

@ -1,13 +1,16 @@
package kr.co.vividnext.sodalive.live.recommend
import com.querydsl.core.annotations.QueryProjection
data class GetCreatorFollowingAllListResponse(
val totalCount: Int,
val items: List<GetCreatorFollowingAllListItem>
)
data class GetCreatorFollowingAllListItem(
data class GetCreatorFollowingAllListItem @QueryProjection constructor(
val creatorId: Long,
val nickname: String,
val profileImageUrl: String,
val isFollow: Boolean
val isFollow: Boolean,
val isNotify: Boolean
)

View File

@ -239,12 +239,12 @@ class LiveRecommendRepository(
return queryFactory
.select(
Projections.constructor(
GetCreatorFollowingAllListItem::class.java,
QGetCreatorFollowingAllListItem(
member.id,
member.nickname,
member.profileImage.prepend("/").prepend(cloudFrontHost),
Expressions.asBoolean(true)
Expressions.asBoolean(true),
creatorFollowing.isNotify
)
)
.from(creatorFollowing)