package com.gh.gamecenter.entity

import com.gh.gamecenter.common.entity.LinkEntity
import com.gh.gamecenter.gamedetail.entity.ZoneEntity
import com.google.gson.annotations.SerializedName

data class ForumDetailEntity(
    @SerializedName("_id")
    var id: String = "",
    var game: SimpleGame = SimpleGame(),
    var background: String = "",
    var name: String = "",
    var icon: String = "",
    var moderator: ArrayList<UserEntity> = arrayListOf(),
    @SerializedName("top")
    var topLink: ArrayList<TopLinkEntity> = arrayListOf(),
    @SerializedName("zone_tab")
    var zone: ZoneEntity? = null,
    var me: MeEntity = MeEntity(),
    var type: String = "", //game_bbs/official_bbs
    var hot: Int = 0 // 热度值
) {

    data class TopLinkEntity(
        var category: CategoryEntity? = null
    ) : LinkEntity()

    data class CategoryEntity(
        @SerializedName("_id")
        var id: String = "",
        var title: String = "",
        var style: Style = Style()
    )

    data class Style(
        var color: String = "",
        @SerializedName("font_color")
        var fontColor: String = ""
    )

    fun convertForumDetailEntityToForumEntity(): ForumEntity {
        val forumEntity = ForumEntity()
        forumEntity.id = id
        forumEntity.name = name
        forumEntity.icon = icon
        forumEntity.game = game
        forumEntity.orderTag = System.currentTimeMillis()
        forumEntity.unread = false
        forumEntity.type = type
        return forumEntity
    }
}