package com.gh.gamecenter.entity

import android.os.Parcelable
import com.gh.gamecenter.home.custom.model.CustomPageData
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

data class CommonCollectionEntity(
    @SerializedName("_id")
    val id: String = "",
    val name: String = "",
    val type: String = "",
    val style: String = "",
    val more: Int = 0,
    val layout: Int = -1, // 对应自定义页面的layout样式
    @SerializedName("home_page_style")
    val homePageStyle: String = "horizontal_sliding", //首页样式 （横排滑动：horizontal_sliding 竖排一行两个：1-2）
    @SerializedName("vertical_line")
    val verticalLine: String = "", // 竖排时才有数据，代表竖排行数控制
    @SerializedName("common_collection_content")
    val collectionList: MutableList<CommonCollectionContentEntity> = mutableListOf(),
    @SerializedName("common_collection_recommend_cards")
    private val _commonCollectionRecommendCards: List<CustomPageData.RecommendCard>? = null
) {

    val commonCollectionRecommendCards: List<CustomPageData.RecommendCard>
        get() = _commonCollectionRecommendCards ?: emptyList()

    val layoutChinese: String
        get() = when (layout) {
            0 -> "轮播banner"
            1 -> "导航栏"
            2 -> "金刚区"
            3 -> "横向滑动banner"
            4 -> "双列banner"
            5 -> "横排竖式卡片"
            6 -> "双列竖式卡片"
            7 -> "竖式图文列表"
            8 -> "横排图文列表"
            9 -> "内容标签泳道"
            10 -> "通知栏目"
            11 -> "公告横幅"
            12 -> "推荐卡片"
            else -> ""
        }
}

@Parcelize
data class CommonCollectionContentEntity(
    @SerializedName("_id")
    private val _id: String? = null,
    val title: String = "",
    val style: String = "",
    val image: String = "",
    @SerializedName("link")
    val linkEntity: ExposureLinkEntity,
    @SerializedName("added_content_1")
    var addedContent1: String? = "",
    @SerializedName("added_content_2")
    var addedContent2: String? = "",
) : Parcelable {

    val id: String
        get() = _id ?: ""
}