package com.gh.gamecenter.entity

import android.os.Parcelable
import com.gh.gamecenter.common.entity.LinkEntity
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
data class CatalogEntity(
    @SerializedName("_id")
    var id: String = "",
    var name: String = "",
    var switch: CatalogSwitch = CatalogSwitch(),
    @SerializedName("has_special")
    var hasSpecial: Boolean = false,
    @SerializedName("sub_catalogs")
    var subCatalog: List<SubCatalogEntity> = emptyList()
) : Parcelable {

    @Parcelize
    data class SubCatalogEntity(
        @SerializedName("_id")
        var id: String = "",
        var name: String = "",
        var icon: String = "",
        var type: String = "",
        var link: LinkEntity = LinkEntity(),
        var recommended: Boolean = false
    ) : Parcelable

    @Parcelize
    data class CatalogSwitch(
        @SerializedName("sort_hot")
        var hotSort: String = "",
        @SerializedName("sort_new")
        var newSort: String = "",
        @SerializedName("sort_star")
        var starSort: String = ""
    ) : Parcelable
}


@Parcelize
data class SpecialCatalogEntity(
    @SerializedName("_id")
    var id: String = "",
    var type: String = "",
    var link: SpecialLink = SpecialLink(),
    var image: Image = Image(),
    var data: List<Banner> = emptyList()
) : Parcelable {

    @Parcelize
    data class Banner(
        @SerializedName("_id")
        var id: String = "",
        var title: String = "",
        var image: String = "",
        var link: LinkEntity = LinkEntity()
    ) : Parcelable

    @Parcelize
    data class SpecialLink(
        @SerializedName("_id")
        var id: String = "",
        var data: List<GameEntity> = emptyList()
    ) : LinkEntity(), Parcelable

    @Parcelize
    data class Image(
        var url: String = "",
        var title: String = ""
    ) : Parcelable
}