package com.gh.gamecenter.game.data

import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.entity.CommonCollectionContentEntity
import com.gh.gamecenter.home.custom.model.CustomPageData

abstract class CommonContentCollectionDetailItem {

    abstract val title: String

    abstract val image: String

    abstract val addedContent1: String

    abstract val addedContent2: String

    abstract val link: LinkEntity
}

data class CommonContentCollectionDetailOldItem(
    val data: CommonCollectionContentEntity
) : CommonContentCollectionDetailItem() {
    override val title: String
        get() = data.title
    override val image: String
        get() = data.image
    override val addedContent1: String
        get() = data.addedContent1 ?: ""
    override val addedContent2: String
        get() = data.addedContent2 ?: ""
    override val link: LinkEntity
        get() = data.linkEntity
}

data class CommonContentCollectionDetailRecommendCardItem(
    val data: CustomPageData.RecommendCard
) : CommonContentCollectionDetailItem() {
    override val title: String
        get() = data.title
    override val image: String
        get() = data.image
    override val addedContent1: String
        get() = data.addedContent
    override val addedContent2: String
        get() = ""
    override val link: LinkEntity
        get() = LinkEntity(link = data.linkId, type = data.linkType, linkText = data.linkText)
}

