67 lines
1.8 KiB
Kotlin
67 lines
1.8 KiB
Kotlin
package com.gh.gamecenter.entity
|
|
|
|
import android.os.Parcelable
|
|
import com.gh.gamecenter.feature.entity.GameSubjectData
|
|
import com.gh.gamecenter.home.custom.model.CustomPageItem
|
|
import kotlinx.parcelize.IgnoredOnParcel
|
|
import kotlinx.parcelize.Parcelize
|
|
|
|
@Parcelize
|
|
class SubjectData(
|
|
// 入口必填
|
|
var subjectId: String?,
|
|
var subjectName: String?,
|
|
var isOrder: Boolean?,
|
|
// 专题内参数
|
|
var sort: String = "", // Filter:评分/最新/最热/更新
|
|
var filter: String = "", // Filter: 类型(分类)
|
|
var tagType: String? = "", // 游戏Item 标签类型
|
|
var briefStyle: String = "",
|
|
var subjectType: SubjectType = SubjectType.NORMAL,
|
|
var subjectStyle: String = "",
|
|
|
|
var requireUpdateSetting: Boolean = false, // 多专题页面需要专题页面自行获取专题配置
|
|
var isAdData: Boolean = false,
|
|
var adId: String = "", // 广告ID(本地字段),不为空时为广告专题
|
|
var codeId: String = "" // 广告CODE_ID(本地字段),不为空时为广告专题
|
|
) : Parcelable, Cloneable {
|
|
|
|
@IgnoredOnParcel
|
|
val subjectStyleChinese: String
|
|
get() = CustomPageItem.subjectTypeToComponentStyle[subjectStyle] ?: ""
|
|
|
|
fun deepCopy(): SubjectData {
|
|
return super.clone() as SubjectData
|
|
}
|
|
|
|
fun toGameSubjectData(): GameSubjectData {
|
|
return GameSubjectData(
|
|
id = subjectId,
|
|
name = subjectName,
|
|
isOrder = isOrder ?: false,
|
|
briefStyle = briefStyle,
|
|
tag = tagType
|
|
)
|
|
}
|
|
|
|
/**
|
|
* 专题类型
|
|
*/
|
|
enum class SubjectType {
|
|
/**
|
|
* 普通专题
|
|
*/
|
|
NORMAL,
|
|
|
|
/**
|
|
* QQ小游戏专题
|
|
*/
|
|
QQ_GAME,
|
|
|
|
/**
|
|
* 微信小游戏专题
|
|
*/
|
|
WECHAT_GAME
|
|
}
|
|
}
|