anchorReward.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. package anchorTask
  2. import (
  3. xtime "go-common/library/time"
  4. )
  5. // TableName is used to identify table name in gorm
  6. func (ar *AnchorReward) TableName() string {
  7. return "ap_anchor_task_reward_list"
  8. }
  9. // consts .
  10. const (
  11. RewardUnUsed = int64(1)
  12. RewardUsed = int64(3)
  13. RewardExpired = int64(5)
  14. CountExpireLockKey = "xrc:lock:count_expire:lock:v1"
  15. CountExpireUserKey = "xrc:lock:count_expire:user:v1:%d"
  16. SetExpireLockKey = "xrc:lock:set_expire:lock:v1"
  17. ExpireCountTime = 86400 * 30 * 3
  18. RewardExists = int64(1)
  19. )
  20. // AnchorReward .
  21. type AnchorReward struct {
  22. Id int64 `json:"id" gorm:"comumn:id"`
  23. Uid int64 `json:"uid" gorm:"comumn:uid"`
  24. RewardId int64 `json:"reward_id" gorm:"comumn:reward_id"`
  25. Roomid int64 `json:"roomid" gorm:"comumn:roomid"`
  26. Lid int64 `json:"lid" gorm:"comumn:lid"`
  27. Source int64 `json:"source" gorm:"comumn:source"`
  28. UsePlat int64 `json:"use_plat" gorm:"comumn:use_plat"`
  29. AchieveTime xtime.Time `json:"achieve_time" gorm:"comumn:achieve_time"`
  30. UseTime xtime.Time `json:"use_time" gorm:"comumn:use_time;not null;"`
  31. StartTime xtime.Time `json:"start_time" gorm:"comumn:start_time"`
  32. EndTime xtime.Time `json:"end_time" gorm:"comumn:end_time"`
  33. ExpireTime xtime.Time `json:"expire_time" gorm:"comumnw:expire_time"`
  34. Status int64 `json:"status" gorm:"comumn:status"`
  35. Reserved1 int64 `json:"reserved1" gorm:"comumn:reserved1"`
  36. Reserved2 string `json:"reserved2" gorm:"comumn:reserved2"`
  37. Ctime xtime.Time `json:"ctime" gorm:"comumn:ctime"`
  38. Mtime xtime.Time `json:"mtime" gorm:"comumn:mtime"`
  39. }
  40. // AnchorRewardObject .
  41. type AnchorRewardObject struct {
  42. // id
  43. Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
  44. // 奖励类型 1:ss推荐卡 2:s推荐卡、任意门
  45. RewardType int64 `protobuf:"varint,2,opt,name=reward_type,json=rewardType,proto3" json:"reward_type,omitempty"`
  46. // 1:未使用,3:已使用,5:已过期
  47. Status int64 `protobuf:"varint,3,opt,name=status,proto3" json:"status,omitempty"`
  48. // 奖励id
  49. RewardId int64 `protobuf:"varint,4,opt,name=reward_id,json=rewardId,proto3" json:"reward_id,omitempty"`
  50. // 奖励名称
  51. Name string `protobuf:"bytes,5,opt,name=name,proto3" json:"name,omitempty"`
  52. // 奖励图标
  53. Icon string `protobuf:"bytes,6,opt,name=icon,proto3" json:"icon,omitempty"`
  54. // 获得时间datetime
  55. AchieveTime string `protobuf:"bytes,7,opt,name=achieve_time,json=achieveTime,proto3" json:"achieve_time,omitempty"`
  56. // 过期时间datetime
  57. ExpireTime string `protobuf:"bytes,8,opt,name=expire_time,json=expireTime,proto3" json:"expire_time,omitempty"`
  58. // 过期时间datetime
  59. UseTime string `protobuf:"bytes,8,opt,name=expire_time,json=useTime,proto3" json:"use_time,omitempty"`
  60. // 来源,1:主播任务,2:小时榜
  61. Source int64 `protobuf:"varint,9,opt,name=source,proto3" json:"source,omitempty"`
  62. // 奖励简介
  63. RewardIntro string `protobuf:"bytes,10,opt,name=reward_intro,json=rewardIntro,proto3" json:"reward_intro,omitempty"`
  64. }
  65. // AnchorRewardPager .
  66. type AnchorRewardPager struct {
  67. // 当前页码
  68. Page int64 `protobuf:"varint,1,opt,name=page,proto3" json:"page,omitempty"`
  69. // 每页大小
  70. PageSize int64 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
  71. // 总页数
  72. TotalPage int64 `protobuf:"varint,3,opt,name=total_page,json=totalPage,proto3" json:"total_page,omitempty"`
  73. // 总记录数
  74. TotalCount int64 `protobuf:"varint,4,opt,name=total_count,json=totalCount,proto3" json:"total_count,omitempty"`
  75. }