宝箱taskState 数据结构
This commit is contained in:
parent
483fa7e930
commit
e93d76f316
|
|
@ -201,24 +201,27 @@
|
|||
"chest_desc": "完成福利宝箱1的全部任务后,获得R$0.1现金奖励",
|
||||
"duration_days": 3,
|
||||
"reward_type": "货币",
|
||||
"reward_value": "R$0.1",
|
||||
"reward_value": 0.1,
|
||||
"is_one_time": true,
|
||||
"status": "active",
|
||||
"tasks": [
|
||||
{
|
||||
"task_id": "chest1_task1",
|
||||
"task_name": "观看1个广告",
|
||||
"required_count": 1
|
||||
"required_count": 1,
|
||||
"task_type": 1
|
||||
},
|
||||
{
|
||||
"task_id": "chest1_task2",
|
||||
"task_name": "观看3个视频",
|
||||
"required_count": 2
|
||||
"required_count": 2,
|
||||
"task_type": 2
|
||||
},
|
||||
{
|
||||
"task_id": "chest1_task3",
|
||||
"task_name": "完成1次签到",
|
||||
"required_count": 1
|
||||
"required_count": 1,
|
||||
"task_type": 3
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -228,24 +231,27 @@
|
|||
"chest_desc": "完成福利宝箱2的全部任务后,获得R$1现金奖励",
|
||||
"duration_days": 3,
|
||||
"reward_type": "货币",
|
||||
"reward_value": "R$1",
|
||||
"reward_value": 1,
|
||||
"is_one_time": true,
|
||||
"status": "locked",
|
||||
"tasks": [
|
||||
{
|
||||
"task_id": "chest2_task1",
|
||||
"task_name": "观看15个广告",
|
||||
"required_count": 15
|
||||
"required_count": 15,
|
||||
"task_type": 1
|
||||
},
|
||||
{
|
||||
"task_id": "chest2_task2",
|
||||
"task_name": "观看30个视频",
|
||||
"required_count": 30
|
||||
"required_count": 30,
|
||||
"task_type": 2
|
||||
},
|
||||
{
|
||||
"task_id": "chest2_task3",
|
||||
"task_name": "参与1次0元购",
|
||||
"required_count": 1
|
||||
"required_count": 1,
|
||||
"task_type": 4
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -255,24 +261,27 @@
|
|||
"chest_desc": "完成福利宝箱3的全部任务后,获得R$2现金奖励",
|
||||
"duration_days": 3,
|
||||
"reward_type": "货币",
|
||||
"reward_value": "R$2",
|
||||
"reward_value": 2,
|
||||
"is_one_time": true,
|
||||
"status": "locked",
|
||||
"tasks": [
|
||||
{
|
||||
"task_id": "chest3_task1",
|
||||
"task_name": "观看30个广告",
|
||||
"required_count": 30
|
||||
"required_count": 30,
|
||||
"task_type": 1
|
||||
},
|
||||
{
|
||||
"task_id": "chest3_task2",
|
||||
"task_name": "观看50个视频",
|
||||
"required_count": 50
|
||||
"required_count": 50,
|
||||
"task_type": 2
|
||||
},
|
||||
{
|
||||
"task_id": "chest3_task3",
|
||||
"task_name": "参与10次0元购",
|
||||
"required_count": 10
|
||||
"required_count": 10,
|
||||
"task_type": 4
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ data class BoxSubTask(
|
|||
val task_id: String,
|
||||
val task_name: String,
|
||||
val required_count: Int,
|
||||
val task_type: Int,
|
||||
)
|
||||
|
||||
data class BoxTask(
|
||||
|
|
@ -70,7 +71,7 @@ data class BoxTask(
|
|||
val chest_name: String,
|
||||
val duration_days: Int,
|
||||
val reward_type: String,
|
||||
val reward_value: String,
|
||||
val reward_value: Float,
|
||||
val is_one_time: Boolean,
|
||||
val status: String,
|
||||
val tasks: List<BoxSubTask>,
|
||||
|
|
@ -35,6 +35,27 @@ class TaskManager private constructor() {
|
|||
private const val TAG_TASK_DAILY_VIDEO = "daily_video_ladder"
|
||||
private const val TAG_TASK_DAILY_AD = "daily_ad_ladder"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 宝箱子任务类型对应
|
||||
const val BOX_SUB_TASK_TYPE_AD = 1
|
||||
const val BOX_SUB_TASK_TYPE_VIDEO = 2
|
||||
const val BOX_SUB_TASK_TYPE_SIGN = 3
|
||||
const val BOX_SUB_TASK_TYPE_ZERO_BUY = 4
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@Volatile
|
||||
private var instance: TaskManager? = null
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
package com.gamedog.vididin.manager.helpers
|
||||
|
||||
import com.ama.core.architecture.util.SpUtil
|
||||
import com.gamedog.vididin.manager.taskbeans.TaskStateBox
|
||||
import com.gamedog.vididin.manager.taskbeans.TaskStateBoxRoot
|
||||
|
||||
class DailyBoxHelper: BaseTaskHelper<TaskStateBox>() {
|
||||
class DailyBoxHelper: BaseTaskHelper<TaskStateBoxRoot>() {
|
||||
|
||||
override val mSpKey = SpUtil.KEY_ACCOUNT
|
||||
override val mSpKey = SpUtil.KEY_TASK_BOX
|
||||
|
||||
override fun loadTaskFromSp() {
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +0,0 @@
|
|||
package com.gamedog.vididin.manager.taskbeans
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
|
||||
|
||||
data class TaskStateBox(
|
||||
var box: Long = 0,
|
||||
var watchedVideoNum: Int = 0,
|
||||
): Serializable {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package com.gamedog.vididin.manager.taskbeans
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
|
||||
|
||||
data class TaskStateBoxRoot(
|
||||
val startMs: Long = 0,
|
||||
val tasks: List<TaskStateBox>
|
||||
): Serializable
|
||||
|
||||
data class TaskStateBox(
|
||||
val chest_id: String,
|
||||
val chest_name: String,
|
||||
val duration_days: Int,
|
||||
val reward_type: String,
|
||||
val reward_value: Float,
|
||||
val is_one_time: Boolean,
|
||||
val status: String,
|
||||
val tasks: List<TaskStateBoxSub>
|
||||
): Serializable
|
||||
|
||||
data class TaskStateBoxSub(
|
||||
val task_id: String,
|
||||
val task_name: String,
|
||||
val required_count: Int,
|
||||
val task_type: Int, // This added by self for decide which task should be execute, detail see: #TaskManager.companion
|
||||
): Serializable
|
||||
|
||||
|
||||
|
|
@ -24,7 +24,7 @@ class SpUtil private constructor(spFileName: String) {
|
|||
const val KEY_DAILY_SIGN = "KEY_DAILY_SIGN"
|
||||
const val KEY_DAILY_WATCH_VIDEO = "KEY_DAILY_WATCH_VIDEO"
|
||||
const val KEY_DAILY_WATCH_AD_FOR_GOLD = "KEY_DAILY_WATCH_AD_FOR_GOLD"
|
||||
const val KEY_DAILY_BOX = "KEY_DAILY_BOX"
|
||||
const val KEY_TASK_BOX = "KEY_TASK_BOX"
|
||||
|
||||
const val KEY_NEWBIE_FIRST_WITHDRAW = "KEY_NEWBIE_FIRST_WITHDRAW"
|
||||
const val KEY_NEWBIE_ENABLE_NOTIFY = "KEY_NEWBIE_ENABLE_NOTIFY"
|
||||
|
|
|
|||
Loading…
Reference in New Issue