@@ -0,0 +1,102 @@
|
||||
package taskser
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"91porn-server/models/v/dailytaskmod"
|
||||
"91porn-server/models/v/oncetaskmod"
|
||||
"91porn-server/models/v/prizemod"
|
||||
"91porn-server/models/v/taskmod"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||
)
|
||||
|
||||
type TaskStatus int
|
||||
|
||||
const (
|
||||
UnDone TaskStatus = iota + 1 // 未完成
|
||||
Finish // 已完成
|
||||
Receive // 已领取
|
||||
ReDo // 重做
|
||||
)
|
||||
|
||||
// 签到信息返回
|
||||
type SignDetailsResponse struct {
|
||||
List []Config `json:"list"` // 列表
|
||||
Value int64 `json:"value"` // 累计签到天数
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
ID primitive.ObjectID `json:"id"` // 文档ID
|
||||
Title string `json:"title"` // 任务标题
|
||||
Desc string `json:"desc"` // 任务描述
|
||||
Prizes []prizemod.Prize `json:"prizes"` // 奖品列表
|
||||
FinishCondition int64 `json:"finishCondition"` // 达成条件
|
||||
FinishValue int64 `json:"finishValue"` // 完成数量
|
||||
Status TaskStatus `json:"status"` // 任务状态 1:未完成 2:已完成 3:已领取
|
||||
BoonType taskmod.ConfigType `json:"boonType"` // 福利类型
|
||||
IsToday bool `json:"isToday"` // 是否是今日任务
|
||||
}
|
||||
|
||||
type TaskResponse struct {
|
||||
JewelBoxDetails struct {
|
||||
List []Config `json:"list"` // 列表
|
||||
Value int64 `json:"value"` // 累计活跃值
|
||||
TotalValue int64 `json:"totalValue"` // 总活跃值
|
||||
} `json:"jewelBoxDetails"` // 宝箱详情
|
||||
TaskList []Config `json:"taskList"` // 任务列表
|
||||
}
|
||||
|
||||
type TaskDetailsResponse struct {
|
||||
TaskList []Config `json:"taskList"` // 任务列表
|
||||
Value int64 `json:"value"` // 累计金币/充值金额
|
||||
}
|
||||
|
||||
type DailyTaskResponse struct {
|
||||
ID primitive.ObjectID `json:"id"` // 任务id
|
||||
Title string `json:"title"` // 任务标题
|
||||
Img string `json:"img"` // 任务图标
|
||||
Type dailytaskmod.DailyTaskTypeEnum `json:"type"` // 0 每日广告点击; 1 每日邀请
|
||||
Desc string `json:"desc"` // 任务说明
|
||||
Link string `json:"link"` // 跳转地址
|
||||
Status int `json:"status"` // 0 未完成; 1 已完成未领取; 2 已领取
|
||||
StartAt time.Time `json:"startAt"` // 场次开始时间;CountdownType=1 时为红包雨场次时间,否则零值
|
||||
EndAt time.Time `json:"endAt"` // 场次结束时间;CountdownType=1 时为红包雨场次时间,否则零值
|
||||
CountdownType int `json:"countdownType"` // 倒计时类型 0-无 1-红包雨倒计时
|
||||
}
|
||||
|
||||
type DailyTaskResponseDetail struct {
|
||||
Prizes []*prizemod.Prize `json:"prizes"` // 奖品列表, 与签到相同
|
||||
FinishCondition uint64 `json:"finishCondition"` // 达成条件. 比如点击广告任务中, 表示3次点击才可以领取奖励
|
||||
FinishCount uint64 `json:"finishCount"` // 已完成数量. 比如比如点击广告任务中 2表示已经点击2次广告
|
||||
Status int `json:"status"` // 0 未完成; 1 已完成未领取; 2 已领取
|
||||
}
|
||||
|
||||
type OnceTaskResponse struct {
|
||||
ID primitive.ObjectID `json:"id"` // 任务id
|
||||
Title string `json:"title"` // 任务标题
|
||||
Img string `json:"img"` // 任务图标
|
||||
Type oncetaskmod.OnceTaskTypeEnum `json:"type"` // 0 每日广告点击; 1 每日邀请
|
||||
Prizes []*prizemod.Prize `json:"prizes"` // 奖品列表, 与签到相同
|
||||
Desc string `json:"desc"` // 任务说明
|
||||
Link string `json:"link"` // 跳转地址
|
||||
Status int `json:"status"` // 0 未完成; 1 已完成未领取; 2 已领取
|
||||
StartAt time.Time `json:"startAt"` // 场次开始时间;CountdownType=1 时为红包雨场次时间,否则零值
|
||||
EndAt time.Time `json:"endAt"` // 场次结束时间;CountdownType=1 时为红包雨场次时间,否则零值
|
||||
CountdownType int `json:"countdownType"` // 倒计时类型 0-无 1-红包雨倒计时
|
||||
}
|
||||
|
||||
type NewTaskResponse struct {
|
||||
DailyTasks []DailyTaskResponse `json:"dailyTask"`
|
||||
OnceTasks []OnceTaskResponse `json:"onceTask"`
|
||||
GrowthTasks []*GrowthTaskResponse `json:"growthTasks"`
|
||||
}
|
||||
|
||||
type GrowthTaskResponse struct {
|
||||
ID primitive.ObjectID `json:"id"` // 任务id
|
||||
Title string `json:"title"` // 任务标题
|
||||
Img string `json:"img"` // 任务图标
|
||||
Type int `json:"type" bson:"type"` // 配置类型 1-购买金币
|
||||
SubTitle string `json:"subTitle"` // 子标题
|
||||
Status int `json:"status"` // 0 未完成; 1 已完成未领取; 2 已领取
|
||||
}
|
||||
Reference in New Issue
Block a user