task.go 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. package newcomer
  2. import (
  3. "go-common/library/time"
  4. )
  5. const (
  6. //RewardCanActivate reward receive state 0-可激活 >1-已激活不可点击>2-已过期不可点击
  7. RewardCanActivate int8 = iota
  8. //RewardActivatedNotClick reward activated state 1-已激活不可点击
  9. RewardActivatedNotClick
  10. //RewardExpireNotClick reward activated state 2-已过期不可点击
  11. RewardExpireNotClick
  12. )
  13. const (
  14. //DefualtTaskType 0-默认任务
  15. DefualtTaskType int8 = iota
  16. // NewcomerTaskType 1-新手任务
  17. NewcomerTaskType
  18. // AdvancedTaskType 2-进阶任务
  19. AdvancedTaskType
  20. // MonthTaskType 3-月常任务
  21. MonthTaskType
  22. )
  23. const (
  24. _ int8 = iota
  25. // Bcoin 1-B币券
  26. Bcoin
  27. // BigMember 2-大会员服务
  28. BigMember
  29. // MemberBuy 3-会员购
  30. MemberBuy
  31. // IncentivePlan 4-激励计划
  32. IncentivePlan
  33. // PersonalCenter 5-个人中心
  34. PersonalCenter
  35. )
  36. const (
  37. //UserTaskLevel0 未解锁任务
  38. UserTaskLevel0 int8 = iota
  39. //UserTaskLevel01 只解锁新手任务
  40. UserTaskLevel01
  41. //UserTaskLevel02 解锁新手与进阶任务
  42. UserTaskLevel02
  43. )
  44. const (
  45. //FreezeState 任务或奖励被冻结状态
  46. FreezeState = -1
  47. //NormalState 任务或奖励正常状态
  48. NormalState = 0
  49. //HiddenState 任务或奖励隐藏状态
  50. HiddenState = 1
  51. //RewardBaseType 基础奖励
  52. RewardBaseType = 0
  53. //RewardGiftType 礼包奖励
  54. RewardGiftType = 1
  55. //NoBindTask 用户未绑定任务
  56. NoBindTask = -1
  57. //BindTask 用户已绑定任务
  58. BindTask = 0
  59. //TaskIncomplete 任务未完成
  60. TaskIncomplete = -1
  61. //TaskCompleted 任务完成
  62. TaskCompleted = 0
  63. //RewardNotAvailable 奖励不可领取
  64. RewardNotAvailable = -1
  65. //RewardAvailable 奖励可领取
  66. RewardAvailable = 0
  67. //RewardReceived 奖励已领取
  68. RewardReceived = 1
  69. //RewardUnlock 奖励未解锁
  70. RewardUnlock = 2
  71. //RewardNeedActivate 奖励可激活
  72. RewardNeedActivate = 1
  73. //RewardNoneedActivate 奖励不可激活
  74. RewardNoneedActivate = 0
  75. //FromWeb web端
  76. FromWeb = 1
  77. //FromH5 h5端
  78. FromH5 = 2
  79. )
  80. const (
  81. _ int8 = iota
  82. //TargetType001 该UID下开放浏览的稿件≥1
  83. TargetType001
  84. //TargetType002 该UID分享自己视频的次数≥1
  85. TargetType002
  86. //TargetType003 该UID在创作学院的观看记录≥1
  87. TargetType003
  88. //TargetType004 该UID下所有avid的获得评论数≥3
  89. TargetType004
  90. //TargetType005 该UID下所有avid获得分享数≥3
  91. TargetType005
  92. //TargetType006 该UID的所有avid的获得收藏数≥5
  93. TargetType006
  94. //TargetType007 该UID下所有avid的获得硬币数≥5
  95. TargetType007
  96. //TargetType008 该UID下所有avid获得点赞数≥5
  97. TargetType008
  98. //TargetType009 该UID下所有avid的获得弹幕数≥5
  99. TargetType009
  100. //TargetType010 该UID的粉丝数≥10
  101. TargetType010
  102. //TargetType011 任务完成期间该UID的水印开关为打开状态
  103. TargetType011
  104. //TargetType012 该UID的关注列表含有“哔哩哔哩创作中心”
  105. TargetType012
  106. //TargetType013 用手机投稿上传视频
  107. TargetType013
  108. //TargetType014 该UID下开放浏览的稿件≥5
  109. TargetType014
  110. //TargetType015 该UID下任意avid的获得点击量≥1000
  111. TargetType015
  112. //TargetType016 该UID下任意avid的评论≥30
  113. TargetType016
  114. //TargetType017 该UID下任意avid的获得分享数≥10
  115. TargetType017
  116. //TargetType018 该UID下任意avid的获得收藏数≥30
  117. TargetType018
  118. //TargetType019 该UID下任意avid的获得硬币数≥50
  119. TargetType019
  120. //TargetType020 该UID下任意avid的获得点赞数≥50
  121. TargetType020
  122. //TargetType021 该UID下任意avid的获得弹幕数≥50
  123. TargetType021
  124. //TargetType022 该UID的粉丝数≥1000
  125. TargetType022
  126. //TargetType023 该UID的激励计划状态为已开通
  127. TargetType023
  128. //TargetType024 该UID粉丝勋章为开启状态
  129. TargetType024
  130. )
  131. const (
  132. _ int8 = iota
  133. //ArcUpCount UpCount get archives count
  134. ArcUpCount
  135. //AcaPlayCount get all play achive count.
  136. AcaPlayCount
  137. //DataUpStat get up stat from hbase
  138. DataUpStat
  139. //AccProfileWithStat get account
  140. AccProfileWithStat
  141. //WmWaterMark get watermark.
  142. WmWaterMark
  143. //AccRelation get all relation state.
  144. AccRelation
  145. //DataUpArchiveStat 获取最高播放/评论/弹幕/...数
  146. DataUpArchiveStat
  147. //OrderGrowAccountState 获取up主状态 type 类型 0 视频 2 专栏 3 素材.
  148. OrderGrowAccountState
  149. //MedalCheckMedal get medal
  150. MedalCheckMedal
  151. )
  152. const (
  153. //MsgFinishedCount 发送未完成任务状态
  154. MsgFinishedCount = 1
  155. //MsgForWaterMark 发送用户设置水印消息
  156. MsgForWaterMark = 1
  157. //MsgForAcademyFavVideo 发送用户已在创作学院观看过自己喜欢的视频的消息
  158. MsgForAcademyFavVideo = 2
  159. //MsgForGrowAccount 发送用户已在参加激励计划的消息
  160. MsgForGrowAccount = 3
  161. //MsgForOpenFansMedal 成功开通粉丝勋章
  162. MsgForOpenFansMedal = 4
  163. )
  164. var (
  165. // TaskRedirectMap task map for app
  166. TaskRedirectMap = map[string]map[int8][]string{
  167. "android": {
  168. TargetType001: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  169. TargetType002: []string{"去分享", "activity://uper/manuscript-list/"},
  170. TargetType003: []string{"前往", "https://member.bilibili.com/college?from=task"},
  171. TargetType004: []string{"前往", "activity://uper/manuscript-list/"},
  172. TargetType005: []string{"前往", "activity://uper/manuscript-list/"},
  173. TargetType006: []string{"前往", "activity://uper/manuscript-list/"},
  174. TargetType007: []string{"前往", "activity://uper/manuscript-list/"},
  175. TargetType008: []string{"前往", "activity://uper/manuscript-list/"},
  176. TargetType009: []string{"前往", "activity://uper/manuscript-list/"},
  177. TargetType010: []string{"前往", "activity://uper/manuscript-list/"},
  178. TargetType011: []string{"去设置", "https://member.bilibili.com/studio/gabriel/watermark"},
  179. TargetType012: []string{"去关注", ""},
  180. TargetType013: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  181. TargetType014: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  182. TargetType015: []string{"前往", "activity://uper/manuscript-list/"},
  183. TargetType016: []string{"前往", "activity://uper/manuscript-list/"},
  184. TargetType017: []string{"前往", "activity://uper/manuscript-list/"},
  185. TargetType018: []string{"前往", "activity://uper/manuscript-list/"},
  186. TargetType019: []string{"前往", "activity://uper/manuscript-list/"},
  187. TargetType020: []string{"前往", "activity://uper/manuscript-list/"},
  188. TargetType021: []string{"前往", "activity://uper/manuscript-list/"},
  189. TargetType022: []string{"前往", "https://member.bilibili.com/studio/gabriel/fans-manage/overview"},
  190. TargetType023: []string{"去加入", "https://member.bilibili.com/studio/up-allowance-h5#/"},
  191. TargetType024: []string{"去开通", "https://member.bilibili.com/studio/gabriel/fans-manage/medal"},
  192. },
  193. "ios": {TargetType001: []string{"去投稿", "/uper/user_center/add_archive/"},
  194. TargetType002: []string{"去分享", "/uper/user_center/archive_list"},
  195. TargetType003: []string{"前往", "https://member.bilibili.com/college?from=task"},
  196. TargetType004: []string{"前往", "/uper/user_center/archive_list"},
  197. TargetType005: []string{"前往", "/uper/user_center/archive_list"},
  198. TargetType006: []string{"前往", "/uper/user_center/archive_list"},
  199. TargetType007: []string{"前往", "/uper/user_center/archive_list"},
  200. TargetType008: []string{"前往", "/uper/user_center/archive_list"},
  201. TargetType009: []string{"前往", "/uper/user_center/archive_list"},
  202. TargetType010: []string{"前往", "/uper/user_center/archive_list"},
  203. TargetType011: []string{"去设置", "https://member.bilibili.com/studio/gabriel/watermark"},
  204. TargetType012: []string{"去关注", ""},
  205. TargetType013: []string{"去投稿", "/uper/user_center/add_archive/"},
  206. TargetType014: []string{"去投稿", "/uper/user_center/add_archive/"},
  207. TargetType015: []string{"前往", "/uper/user_center/archive_list"},
  208. TargetType016: []string{"前往", "/uper/user_center/archive_list"},
  209. TargetType017: []string{"前往", "/uper/user_center/archive_list"},
  210. TargetType018: []string{"前往", "/uper/user_center/archive_list"},
  211. TargetType019: []string{"前往", "/uper/user_center/archive_list"},
  212. TargetType020: []string{"前往", "/uper/user_center/archive_list"},
  213. TargetType021: []string{"前往", "/uper/user_center/archive_list"},
  214. TargetType022: []string{"前往", "https://member.bilibili.com/studio/gabriel/fans-manage/overview"},
  215. TargetType023: []string{"去加入", "https://member.bilibili.com/studio/up-allowance-h5#/"},
  216. TargetType024: []string{"去开通", "https://member.bilibili.com/studio/gabriel/fans-manage/medal"},
  217. },
  218. }
  219. // H5RedirectMap task map for app
  220. H5RedirectMap = map[string]map[int8][]string{
  221. "android": {
  222. TargetType001: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  223. TargetType002: []string{"去分享", "bilibili://uper/user_center/manuscript-list/"},
  224. TargetType003: []string{"前往", "https://member.bilibili.com/college?from=task"},
  225. TargetType004: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  226. TargetType005: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  227. TargetType006: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  228. TargetType007: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  229. TargetType008: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  230. TargetType009: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  231. TargetType010: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  232. TargetType011: []string{"去设置", "https://member.bilibili.com/studio/gabriel/watermark"},
  233. TargetType012: []string{"去关注", "去关注"},
  234. TargetType013: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  235. TargetType014: []string{"去投稿", "bilibili://uper/user_center/add_archive/"},
  236. TargetType015: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  237. TargetType016: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  238. TargetType017: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  239. TargetType018: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  240. TargetType019: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  241. TargetType020: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  242. TargetType021: []string{"前往", "bilibili://uper/user_center/manuscript-list/"},
  243. TargetType022: []string{"前往", "https://member.bilibili.com/studio/gabriel/fans-manage/overview"},
  244. TargetType023: []string{"去加入", "https://member.bilibili.com/studio/up-allowance-h5#/"},
  245. TargetType024: []string{"去开通", "https://member.bilibili.com/studio/gabriel/fans-manage/medal"},
  246. },
  247. "ios": {TargetType001: []string{"去投稿", "/uper/user_center/add_archive/"},
  248. TargetType002: []string{"去分享", "/uper/user_center/archive_list"},
  249. TargetType003: []string{"前往", "https://member.bilibili.com/college?from=task"},
  250. TargetType004: []string{"前往", "/uper/user_center/archive_list"},
  251. TargetType005: []string{"前往", "/uper/user_center/archive_list"},
  252. TargetType006: []string{"前往", "/uper/user_center/archive_list"},
  253. TargetType007: []string{"前往", "/uper/user_center/archive_list"},
  254. TargetType008: []string{"前往", "/uper/user_center/archive_list"},
  255. TargetType009: []string{"前往", "/uper/user_center/archive_list"},
  256. TargetType010: []string{"前往", "/uper/user_center/archive_list"},
  257. TargetType011: []string{"去设置", "https://member.bilibili.com/studio/gabriel/watermark"},
  258. TargetType012: []string{"去关注", "去关注"},
  259. TargetType013: []string{"去投稿", "/uper/user_center/add_archive/"},
  260. TargetType014: []string{"去投稿", "/uper/user_center/add_archive/"},
  261. TargetType015: []string{"前往", "/uper/user_center/archive_list"},
  262. TargetType016: []string{"前往", "/uper/user_center/archive_list"},
  263. TargetType017: []string{"前往", "/uper/user_center/archive_list"},
  264. TargetType018: []string{"前往", "/uper/user_center/archive_list"},
  265. TargetType019: []string{"前往", "/uper/user_center/archive_list"},
  266. TargetType020: []string{"前往", "/uper/user_center/archive_list"},
  267. TargetType021: []string{"前往", "/uper/user_center/archive_list"},
  268. TargetType022: []string{"前往", "https://member.bilibili.com/studio/gabriel/fans-manage/overview"},
  269. TargetType023: []string{"去加入", "https://member.bilibili.com/studio/up-allowance-h5#/"},
  270. TargetType024: []string{"去开通", "https://member.bilibili.com/studio/gabriel/fans-manage/medal"},
  271. },
  272. }
  273. // TaskGroupTipMap taskGroup tips for h5
  274. TaskGroupTipMap = map[int8]map[int64]string{
  275. RewardNotAvailable: {
  276. 1: "快迈出你的第一步吧~~",
  277. 2: "数据会在完成任务的第二天上午12:00进行核实哦。",
  278. 3: "数据会在完成任务的第二天上午12:00进行核实哦。",
  279. 4: "完成全部新手任务就可以解锁大礼包哦~",
  280. 5: "数据会在完成任务的第二天上午12:00进行核实哦。",
  281. 6: "数据会在完成任务的第二天上午12:00进行核实哦。",
  282. 7: "数据会在完成任务的第二天上午12:00进行核实哦。",
  283. 8: "完成全部任务就可以解锁大礼包哦~",
  284. },
  285. RewardAvailable: {
  286. 1: "会员购优惠券领取后就即时生效了哦~",
  287. 2: "B币券领取后就即时生效了哦~",
  288. 3: "大会员代金券领取后就即时生效了哦~",
  289. 4: "会员购优惠券领取后就即时生效了哦~",
  290. 5: "会员购优惠券领取后就即时生效了哦~",
  291. 6: "大会员代金券领取后就即时生效了哦~",
  292. 7: "B币券领取后就即时生效了哦~",
  293. 8: "双倍激励卡领取后需激活才可使用哦~",
  294. },
  295. RewardReceived: {
  296. 1: "可以在我的奖品查看领奖记录哦~",
  297. 2: "可以在我的奖品查看领奖记录哦~",
  298. 3: "可以在我的奖品查看领奖记录哦~",
  299. 4: "可以在我的奖品查看领奖记录哦~",
  300. 5: "可以在我的奖品查看领奖记录哦~",
  301. 6: "可以在我的奖品查看领奖记录哦~",
  302. 7: "可以在我的奖品查看领奖记录哦~",
  303. 8: "可以在我的奖品查看领奖记录哦~",
  304. },
  305. RewardUnlock: {
  306. 1: "完成全部新手任务就可以解锁大礼包哦~",
  307. 2: "完成全部新手任务就可以解锁大礼包哦~",
  308. 3: "完成全部新手任务就可以解锁大礼包哦~",
  309. 4: "完成全部新手任务就可以解锁大礼包哦~",
  310. 5: "完成全部新手任务就可以解锁大礼包哦~",
  311. 6: "完成全部新手任务就可以解锁大礼包哦~",
  312. 7: "完成全部新手任务就可以解锁大礼包哦~",
  313. 8: "完成全部新手任务就可以解锁大礼包哦~",
  314. },
  315. }
  316. // GiftTipMap gift tips for h5
  317. GiftTipMap = map[int8]map[int8]string{
  318. RewardNotAvailable: {
  319. 1: "完成全部新手任务马上就能领头像挂件了呢~",
  320. 2: "完成全部进阶任务马上就能领头像挂件了呢~",
  321. },
  322. RewardAvailable: {
  323. 1: "头像挂件领取后即时生效哦~",
  324. 2: "头像挂件领取后即时生效哦~",
  325. },
  326. RewardReceived: {
  327. 1: "可以去我的奖品查看领奖记录哦~",
  328. 2: "可以去我的奖品查看领奖记录哦~",
  329. },
  330. //RewardUnlock:{
  331. // 1:"",
  332. // 2:"再完成n个任务就能领取了呢",
  333. //},
  334. }
  335. )
  336. // Task for def task struct.
  337. type Task struct {
  338. ID int64 `json:"id"`
  339. GroupID int64 `json:"-"`
  340. Type int8 `json:"type"`
  341. State int8 `json:"-"`
  342. Title string `json:"title"`
  343. Desc string `json:"desc"`
  344. Comment string `json:"-"`
  345. TargetType int8 `json:"-"`
  346. TargetValue int `json:"-"`
  347. CompleteSate int8 `json:"complete_state"`
  348. Label string `json:"label,omitempty"`
  349. Redirect string `json:"redirect,omitempty"`
  350. Rank int64 `json:"-"`
  351. Extra string `json:"extra"`
  352. FanRange string `json:"-"`
  353. UpTime time.Time `json:"-"`
  354. DownTime time.Time `json:"-"`
  355. Online int8 `json:"-"`
  356. CTime time.Time `json:"-"`
  357. MTime time.Time `json:"-"`
  358. }
  359. // AppTasks for def task struct.
  360. type AppTasks struct {
  361. ID int64 `json:"id"`
  362. Type int8 `json:"type"`
  363. Title string `json:"title"`
  364. Label string `json:"label"`
  365. Redirect string `json:"redirect"`
  366. }
  367. //TaskGroup for newcomer & advanced tasks
  368. type TaskGroup struct {
  369. Tasks []*Task `json:"tasks"`
  370. GroupID int64 `json:"group_id"`
  371. RewardID []int64 `json:"reward_id"`
  372. Completed int64 `json:"completed"`
  373. Incomplete int64 `json:"incomplete"`
  374. }
  375. // TaskList for def task list.
  376. type TaskList struct {
  377. TaskGroups []*TaskGroup `json:"task_groups"`
  378. TotalCompleted int64 `json:"total_completed"`
  379. TotalIncomplete int64 `json:"total_incomplete"`
  380. }
  381. // Reward for def reward struct
  382. type Reward struct {
  383. ID int64 `json:"id"`
  384. ParentID int64 `json:"parent_id"`
  385. Type int8 `json:"type"`
  386. State int8 `json:"state"`
  387. IsActive int8 `json:"is_active"`
  388. PriceID string `json:"price_id"`
  389. PrizeUnit int `json:"prize_unit"`
  390. Expire int `json:"expire"`
  391. Name string `json:"name"`
  392. Logo string `json:"logo"`
  393. Comment string `json:"comment"`
  394. UnlockLogo string `json:"unlock_logo"`
  395. NameExtra string `json:"name_extra"`
  396. CTime time.Time `json:"-"`
  397. MTime time.Time `json:"-"`
  398. }
  399. // TaskReward def to combine task and reward data structures
  400. type TaskReward struct {
  401. Mid int64
  402. //task data
  403. TaskID int64
  404. TaskGroupID int64
  405. TaskTitle string
  406. TaskDesc string
  407. TaskType int8
  408. TaskState int8
  409. TaskCompleteSate int8
  410. Label string
  411. Redirect string
  412. //reward data
  413. RewardID int64
  414. RewardParentID int64
  415. RewardName string
  416. RewardLogo string
  417. RewardType int8
  418. RewardState int8
  419. RewardPriceID string
  420. }
  421. // TaskKind for newcomer & advanced & monthly task classification
  422. type TaskKind struct {
  423. Type int8 `json:"type"`
  424. State int8 `json:"state"`
  425. Completed int64 `json:"completed"`
  426. Total int64 `json:"total"`
  427. }
  428. //TaskRewardGroup for newcomer & advanced tasks
  429. type TaskRewardGroup struct {
  430. GroupID int64 `json:"group_id"`
  431. Tasks []*Task `json:"tasks"`
  432. Rewards []*Reward `json:"rewards"`
  433. RewardState int8 `json:"reward_state"` // -1-不可领取 , 0-可领取 , 1-已领取
  434. Completed int64 `json:"completed"`
  435. Total int64 `json:"total"`
  436. TaskType int8 `json:"task_type,omitempty"`
  437. Tip string `json:"tip,omitempty"`
  438. }
  439. // TaskGift for def struct
  440. type TaskGift struct {
  441. State int8 `json:"state"` // -1-不可领取 ,0-可领取 , 1-已领取
  442. Type int8 `json:"type,omitempty"`
  443. Rewards []*Reward `json:"rewards"`
  444. Tip string `json:"tip,omitempty"`
  445. }
  446. // TaskRewardList for def task list.
  447. type TaskRewardList struct {
  448. TaskReceived int8 `json:"task_received"` // -1-未领取任务,0-已领取任务
  449. TaskType int8 `json:"task_type"`
  450. TaskKinds []*TaskKind `json:"task_kinds"`
  451. TaskGroups []*TaskRewardGroup `json:"task_groups"`
  452. TaskGift []*TaskGift `json:"task_gift"`
  453. }
  454. // RewardReceive for def reward receive records.
  455. type RewardReceive struct {
  456. ID int64 `json:"id"`
  457. MID int64 `json:"mid"`
  458. TaskGiftID int64 `json:"task_gift_id"`
  459. TaskGroupID int64 `json:"task_group_id"`
  460. RewardID int64 `json:"reward_id"`
  461. RewardType int8 `json:"reward_type"`
  462. State int8 `json:"state"`
  463. ReceiveTime time.Time `json:"receive_time"`
  464. CTime time.Time `json:"ctime"`
  465. MTime time.Time `json:"mtime"`
  466. ExpireTime time.Time `json:"expire_time"`
  467. RewardName string `json:"reward_name"`
  468. }
  469. // RewardReceiveGroup for reward receive group
  470. type RewardReceiveGroup struct {
  471. Count int `json:"count"`
  472. RewardType int8 `json:"reward_type"`
  473. RewardTypeName string `json:"reward_type_name"`
  474. RewardTypeLogo string `json:"reward_type_logo"`
  475. Comment string `json:"comment"`
  476. Items []*RewardReceive `json:"items"`
  477. }
  478. // UserTask for def user task struct.
  479. type UserTask struct {
  480. ID int64 `json:"id"`
  481. MID int64 `json:"mid"`
  482. TaskID int64 `json:"task_id"`
  483. TaskGroupID int64 `json:"task_group_id"`
  484. TaskType int8 `json:"task_type"`
  485. State int8 `json:"state"`
  486. TaskBindTime time.Time `json:"task_bind_time"`
  487. CTime time.Time `json:"ctime"`
  488. MTime time.Time `json:"mtime"`
  489. }
  490. // IndexNewcomer for index show
  491. type IndexNewcomer struct {
  492. TaskReceived int8 `json:"task_received"`
  493. SubZero bool `json:"sub_zero"`
  494. NoReceive int `json:"no_receive"`
  495. Tasks []*Task `json:"tasks"`
  496. }
  497. // AppIndexNewcomer for index show
  498. type AppIndexNewcomer struct {
  499. TaskReceived int8 `json:"task_received"`
  500. H5URL string `json:"h5_url"`
  501. AppTasks []*AppTasks `json:"tasks"`
  502. }
  503. // CheckTaskStateReq check task state req by creative-job grpc client.
  504. type CheckTaskStateReq struct {
  505. MID int64
  506. TaskID int64
  507. }
  508. // TaskGroupReward for def task-group-reward
  509. type TaskGroupReward struct {
  510. ID int64 `json:"id"`
  511. TaskGroupID int64 `json:"task_group_id"`
  512. RewardID int64 `json:"reward_id"`
  513. State int8 `json:"state"`
  514. Comment string `json:"comment"`
  515. CTime time.Time `json:"ctime"`
  516. MTime time.Time `json:"mtime"`
  517. }
  518. // GiftReward for gift reward
  519. type GiftReward struct {
  520. ID int64 `json:"id"`
  521. RootType int8 `json:"root_type"`
  522. TaskType int8 `json:"task_type"`
  523. RewardID int64 `json:"reward_id"`
  524. State int8 `json:"state"`
  525. Comment string `json:"comment"`
  526. CTime time.Time `json:"ctime"`
  527. MTime time.Time `json:"mtime"`
  528. }
  529. //TaskMsg for newcomer task finish notify.
  530. type TaskMsg struct {
  531. MID int64 `json:"mid"`
  532. Count int64 `json:"count"`
  533. From int `json:"from"`
  534. TimeStamp int64 `json:"timestamp"`
  535. }
  536. // H5TaskRewardList for def task list.
  537. type H5TaskRewardList struct {
  538. TaskReceived int8 `json:"task_received"` // -1-未领取任务,0-已领取任务
  539. TaskGroups []*TaskRewardGroup `json:"task_groups"`
  540. TaskGift []*TaskGift `json:"task_gifts"`
  541. }
  542. //PubTask for def struct
  543. type PubTask struct {
  544. ID int64 `json:"id"`
  545. Type int8 `json:"type"`
  546. Title string `json:"title"`
  547. Desc string `json:"desc"`
  548. State int8 `json:"state"`
  549. }
  550. //PubTaskList for def struct
  551. type PubTaskList struct {
  552. TaskReceived int8 `json:"task_received"`
  553. Tasks []*PubTask `json:"tasks"`
  554. }
  555. // TaskGroupEntity for def struct
  556. type TaskGroupEntity struct {
  557. ID int64 `json:"id"`
  558. Rank int64 `json:"rank"`
  559. State int8 `json:"state"`
  560. RootType int8 `json:"root_type"`
  561. Type int8 `json:"type"`
  562. Online int8 `json:"online"`
  563. CTime time.Time `json:"ctime"`
  564. MTime time.Time `json:"mtime"`
  565. }
  566. // TaskRewardEntity for def struct
  567. type TaskRewardEntity struct {
  568. ID int64 `json:"id"`
  569. TaskID int64 `json:"task_id"`
  570. RewardID int64 `json:"reward_id"`
  571. State int8 `json:"state"`
  572. Type int8 `json:"type"`
  573. Comment string `json:"comment"`
  574. CTime time.Time `json:"ctime"`
  575. MTime time.Time `json:"mtime"`
  576. }
  577. // RewardReceive2 for def reward receive records.
  578. type RewardReceive2 struct {
  579. ID int64 `json:"id"`
  580. MID int64 `json:"mid"`
  581. OID int64 `json:"oid"`
  582. Type int8 `json:"type"`
  583. RewardID int64 `json:"reward_id"`
  584. RewardType int8 `json:"reward_type"`
  585. State int8 `json:"state"`
  586. ReceiveTime time.Time `json:"receive_time"`
  587. CTime time.Time `json:"ctime"`
  588. MTime time.Time `json:"mtime"`
  589. RewardName string `json:"reward_name"`
  590. }