fix: 홈 메인 API - 인기 크리에이터

- 팔로잉 여부 추가
This commit is contained in:
Klaus 2025-07-21 18:21:53 +09:00
parent e068b57062
commit 3d695069a2
3 changed files with 15 additions and 3 deletions

View File

@ -75,7 +75,13 @@ class HomeService(
} }
.map { .map {
val followerCount = explorerQueryRepository.getNotificationUserIds(it.id!!).size val followerCount = explorerQueryRepository.getNotificationUserIds(it.id!!).size
it.toExplorerSectionCreator(imageHost, followerCount) val follow = if (memberId != null) {
explorerQueryRepository.isFollow(it.id!!, memberId = memberId)
} else {
false
}
it.toExplorerSectionCreator(imageHost, follow, followerCount = followerCount)
} }
val latestContentThemeList = contentThemeService.getActiveThemeOfContent( val latestContentThemeList = contentThemeService.getActiveThemeOfContent(

View File

@ -15,5 +15,6 @@ data class GetExplorerSectionCreatorResponse(
val nickname: String, val nickname: String,
val tags: String, val tags: String,
val profileImageUrl: String, val profileImageUrl: String,
val follow: Boolean,
val followerCount: Int val followerCount: Int
) )

View File

@ -123,7 +123,11 @@ data class Member(
} }
} }
fun toExplorerSectionCreator(imageHost: String, followerCount: Int = 0): GetExplorerSectionCreatorResponse { fun toExplorerSectionCreator(
imageHost: String,
follow: Boolean = false,
followerCount: Int = 0
): GetExplorerSectionCreatorResponse {
return GetExplorerSectionCreatorResponse( return GetExplorerSectionCreatorResponse(
id = id!!, id = id!!,
nickname = nickname, nickname = nickname,
@ -136,7 +140,8 @@ data class Member(
} else { } else {
"$imageHost/profile/default-profile.png" "$imageHost/profile/default-profile.png"
}, },
followerCount = followerCount followerCount = followerCount,
follow = follow
) )
} }
} }