feat(home): 추천 응답 모델을 갱신한다

This commit is contained in:
2026-06-05 20:53:34 +09:00
parent 51226cf5cc
commit 44457349aa
3 changed files with 42 additions and 55 deletions

View File

@@ -2,6 +2,7 @@ package kr.co.vividnext.sodalive.v2.main.home.data
import androidx.annotation.Keep import androidx.annotation.Keep
import com.google.gson.annotations.SerializedName import com.google.gson.annotations.SerializedName
import kr.co.vividnext.sodalive.settings.event.EventItem
@Keep @Keep
data class HomeRecommendationResponse( data class HomeRecommendationResponse(
@@ -18,38 +19,34 @@ data class HomeRecommendationResponse(
@Keep @Keep
data class HomeLiveItem( data class HomeLiveItem(
@SerializedName("liveId") val liveId: Long, @SerializedName("roomId") val roomId: Long,
@SerializedName("creatorId") val creatorId: Long,
@SerializedName("imageUrl") val imageUrl: String?,
@SerializedName("title") val title: String,
@SerializedName("creatorNickname") val creatorNickname: String, @SerializedName("creatorNickname") val creatorNickname: String,
@SerializedName("beginDateTime") val beginDateTime: String? @SerializedName("creatorProfileImage") val creatorProfileImage: String
) )
@Keep @Keep
data class HomeBannerItem( data class HomeBannerItem(
@SerializedName("bannerId") val bannerId: String?, @SerializedName("imageUrl") val imageUrl: String,
@SerializedName("imageUrl") val imageUrl: String?, @SerializedName("eventItem") val eventItem: EventItem?,
@SerializedName("type") val type: String?, @SerializedName("creatorId") val creatorId: Long?,
@SerializedName("linkUrl") val linkUrl: String?, @SerializedName("seriesId") val seriesId: Long?,
@SerializedName("targetId") val targetId: Long? @SerializedName("link") val link: String?
) )
@Keep @Keep
data class HomeActiveCreatorItem( data class HomeActiveCreatorItem(
@SerializedName("creatorId") val creatorId: Long, @SerializedName("creatorNickname") val creatorNickname: String,
@SerializedName("nickname") val nickname: String, @SerializedName("creatorProfileImage") val creatorProfileImage: String,
@SerializedName("profileImage") val profileImage: String?,
@SerializedName("title") val title: String?,
@SerializedName("activityType") val activityType: String, @SerializedName("activityType") val activityType: String,
@SerializedName("activityAt") val activityAt: String? @SerializedName("activityAt") val activityAt: String,
@SerializedName("targetId") val targetId: Long?
) )
@Keep @Keep
data class HomeCreatorItem( data class HomeCreatorItem(
@SerializedName("creatorId") val creatorId: Long, @SerializedName("creatorId") val creatorId: Long,
@SerializedName("nickname") val nickname: String, @SerializedName("creatorNickname") val creatorNickname: String,
@SerializedName("profileImage") val profileImage: String? @SerializedName("creatorProfileImage") val creatorProfileImage: String
) )
@Keep @Keep
@@ -57,11 +54,10 @@ data class HomeFirstAudioContentItem(
@SerializedName("contentId") val contentId: Long, @SerializedName("contentId") val contentId: Long,
@SerializedName("creatorId") val creatorId: Long, @SerializedName("creatorId") val creatorId: Long,
@SerializedName("creatorNickname") val creatorNickname: String, @SerializedName("creatorNickname") val creatorNickname: String,
@SerializedName("creatorProfileImage") val creatorProfileImage: String?, @SerializedName("creatorProfileImage") val creatorProfileImage: String,
@SerializedName("title") val title: String, @SerializedName("title") val title: String,
@SerializedName("price") val price: Int, @SerializedName("price") val price: Int,
@SerializedName("coverImage") val coverImage: String?, @SerializedName("coverImage") val coverImage: String?,
@SerializedName("releaseDate") val releaseDate: String,
@SerializedName("isPointAvailable") val isPointAvailable: Boolean @SerializedName("isPointAvailable") val isPointAvailable: Boolean
) )
@@ -77,7 +73,7 @@ data class HomeAiCharacterItem(
@Keep @Keep
data class HomeGenreCreatorGroupItem( data class HomeGenreCreatorGroupItem(
@SerializedName("genre") val genre: String, @SerializedName("genreName") val genreName: String,
@SerializedName("creators") val creators: List<HomeCreatorItem> @SerializedName("creators") val creators: List<HomeCreatorItem>
) )

View File

@@ -30,39 +30,35 @@ fun HomeRecommendationResponse.toContent(): HomeRecommendationUiState.Content =
) )
fun HomeLiveItem.toUiModel(): HomeRecommendationLiveUiModel = HomeRecommendationLiveUiModel( fun HomeLiveItem.toUiModel(): HomeRecommendationLiveUiModel = HomeRecommendationLiveUiModel(
liveId = liveId, roomId = roomId,
creatorId = creatorId,
imageUrl = imageUrl,
title = title,
creatorNickname = creatorNickname, creatorNickname = creatorNickname,
beginDateTime = beginDateTime creatorProfileImage = creatorProfileImage
) )
fun HomeBannerItem.toUiModel(): HomeRecommendationBannerUiModel = HomeRecommendationBannerUiModel( fun HomeBannerItem.toUiModel(): HomeRecommendationBannerUiModel = HomeRecommendationBannerUiModel(
bannerId = bannerId,
imageUrl = imageUrl, imageUrl = imageUrl,
type = type, eventItem = eventItem,
linkUrl = linkUrl, creatorId = creatorId,
targetId = targetId seriesId = seriesId,
link = link
) )
fun HomeActiveCreatorItem.toUiModel(): HomeRecommendationRecentlyActiveCreatorUiModel { fun HomeActiveCreatorItem.toUiModel(): HomeRecommendationRecentlyActiveCreatorUiModel {
val recommendedActivityType = RecommendedActivityType.from(activityType) val recommendedActivityType = RecommendedActivityType.from(activityType)
return HomeRecommendationRecentlyActiveCreatorUiModel( return HomeRecommendationRecentlyActiveCreatorUiModel(
creatorId = creatorId, nickname = creatorNickname,
nickname = nickname, profileImage = creatorProfileImage,
profileImage = profileImage,
title = title,
activityType = recommendedActivityType, activityType = recommendedActivityType,
activityLabelResId = recommendedActivityType?.labelResId, activityLabelResId = recommendedActivityType?.labelResId,
activityAt = activityAt activityAt = activityAt,
targetId = targetId
) )
} }
fun HomeCreatorItem.toUiModel(): HomeRecommendationCreatorUiModel = HomeRecommendationCreatorUiModel( fun HomeCreatorItem.toUiModel(): HomeRecommendationCreatorUiModel = HomeRecommendationCreatorUiModel(
creatorId = creatorId, creatorId = creatorId,
nickname = nickname, nickname = creatorNickname,
profileImage = profileImage profileImage = creatorProfileImage
) )
fun HomeFirstAudioContentItem.toUiModel(): HomeRecommendationFirstAudioContentUiModel = fun HomeFirstAudioContentItem.toUiModel(): HomeRecommendationFirstAudioContentUiModel =
@@ -74,7 +70,6 @@ fun HomeFirstAudioContentItem.toUiModel(): HomeRecommendationFirstAudioContentUi
title = title, title = title,
price = price, price = price,
coverImage = coverImage, coverImage = coverImage,
releaseDate = releaseDate,
tags = buildSet { tags = buildSet {
add(AudioContentTag.First) add(AudioContentTag.First)
if (isPointAvailable) add(AudioContentTag.Point) if (isPointAvailable) add(AudioContentTag.Point)
@@ -96,7 +91,7 @@ fun HomeAiCharacterItem.toUiModel(): HomeRecommendationAiCharacterUiModel = Home
fun HomeGenreCreatorGroupItem.toUiModel(): HomeRecommendationGenreCreatorGroupUiModel = fun HomeGenreCreatorGroupItem.toUiModel(): HomeRecommendationGenreCreatorGroupUiModel =
HomeRecommendationGenreCreatorGroupUiModel( HomeRecommendationGenreCreatorGroupUiModel(
genre = genre, genre = genreName,
creators = creators.map { it.toUiModel() } creators = creators.map { it.toUiModel() }
) )

View File

@@ -1,5 +1,6 @@
package kr.co.vividnext.sodalive.v2.main.home.model package kr.co.vividnext.sodalive.v2.main.home.model
import kr.co.vividnext.sodalive.settings.event.EventItem
import kr.co.vividnext.sodalive.v2.widget.AudioContentTag import kr.co.vividnext.sodalive.v2.widget.AudioContentTag
import kr.co.vividnext.sodalive.v2.widget.characterchatthumbnail.CharacterChatThumbnailItem import kr.co.vividnext.sodalive.v2.widget.characterchatthumbnail.CharacterChatThumbnailItem
import kr.co.vividnext.sodalive.v2.widget.feed.FeedItem import kr.co.vividnext.sodalive.v2.widget.feed.FeedItem
@@ -51,47 +52,42 @@ fun HomeRecommendationPopularCommunityPostSection.visibleHomePopularCommunityPos
} }
data class HomeRecommendationLiveUiModel( data class HomeRecommendationLiveUiModel(
val liveId: Long, val roomId: Long,
val creatorId: Long,
val imageUrl: String?,
val title: String,
val creatorNickname: String, val creatorNickname: String,
val beginDateTime: String? val creatorProfileImage: String
) )
data class HomeRecommendationBannerUiModel( data class HomeRecommendationBannerUiModel(
val bannerId: String?, val imageUrl: String,
val imageUrl: String?, val eventItem: EventItem?,
val type: String?, val creatorId: Long?,
val linkUrl: String?, val seriesId: Long?,
val targetId: Long? val link: String?
) )
data class HomeRecommendationRecentlyActiveCreatorUiModel( data class HomeRecommendationRecentlyActiveCreatorUiModel(
val creatorId: Long,
val nickname: String, val nickname: String,
val profileImage: String?, val profileImage: String,
val title: String?,
val activityType: RecommendedActivityType?, val activityType: RecommendedActivityType?,
val activityLabelResId: Int?, val activityLabelResId: Int?,
val activityAt: String? val activityAt: String,
val targetId: Long?
) )
data class HomeRecommendationCreatorUiModel( data class HomeRecommendationCreatorUiModel(
val creatorId: Long, val creatorId: Long,
val nickname: String, val nickname: String,
val profileImage: String? val profileImage: String
) )
data class HomeRecommendationFirstAudioContentUiModel( data class HomeRecommendationFirstAudioContentUiModel(
val contentId: Long, val contentId: Long,
val creatorId: Long, val creatorId: Long,
val creatorNickname: String, val creatorNickname: String,
val creatorProfileImage: String?, val creatorProfileImage: String,
val title: String, val title: String,
val price: Int, val price: Int,
val coverImage: String?, val coverImage: String?,
val releaseDate: String,
val tags: Set<AudioContentTag> val tags: Set<AudioContentTag>
) )