package com.gh.gamecenter.entity

import android.os.Parcelable
import com.gh.gamecenter.common.annotation.Synchronize
import com.gh.gamecenter.qa.entity.SourceEntity
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
class RatingComment(
    @SerializedName("_id")
    val id: String = "",
    @Synchronize
    var content: String = "",
    val order: Int = 0,
    @Synchronize
    val me: MeEntity = MeEntity(),
    @Synchronize
    private var device: String = "",
    @Synchronize
    var time: Long = 0,
    @Synchronize
    var vote: Int = 0,
    @Synchronize
    var star: Int = 0,
    @Synchronize
    var reply: Int = 0,
    val user: UserEntity = UserEntity(),
    @SerializedName("is_service")
    var isServiceComment: Boolean = false,
    @SerializedName("attached")
    var replyData: Reply? = null,
    @Synchronize
    @SerializedName("is_edit_content")
    var isEditContent: Boolean? = null,
    @SerializedName("game_version")
    val gameVersion: String = "",
    @SerializedName("is_jingxuan")
    val isWonderful: Boolean = false,
    val active: Boolean = true,
    @Synchronize
    var audit: Boolean = false,
    var ignore: Boolean = false,//此评分是否计入总分
    @SerializedName("_source")
    val source: SourceEntity? = null
) : Parcelable {
    fun getDevice(): String {
        return device.trim()
    }

    fun setDevice(device: String) {
        this.device = device
    }

    @Parcelize
    class Reply(
        val user: UserEntity = UserEntity(),
        val content: String = "",
        @SerializedName("is_service")
        var isService: Boolean = false
    ) : Parcelable
}
