package com.gh.gamecenter.entity

import android.os.Parcelable
import com.google.gson.annotations.SerializedName
import kotlinx.parcelize.Parcelize

@Parcelize
class AppEntity(
    var version: String? = null,

    @SerializedName("version_code")
    var versionCode: Int = 0,

    var url: String? = null,

    var size: String? = null,

    var content: String? = null,

    @SerializedName("force")
    var isForce: Boolean = false,

    @SerializedName("spare_link")
    var spareLink: String? = "",

    /**
     * NEVER（从不）
     * ONCE_ONLY（仅一次）
     * ONCE_ONLY_SECOND（仅一次（第二次打开））
     * ONCE_A_DAY（每天一次）
     * EVERY_TIME_OPEN（每次打开）
     */
    var alert: String? = null,
    // 关联64位更新
    var relation: AppEntity? = null
) : Parcelable {
    fun isAlertEveryTime() = alert == "EVERY_TIME_OPEN"

    fun isAlertOnceADay() = alert == "ONCE_A_DAY"
}


