dt_task.go 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. package daytask
  2. import (
  3. "time"
  4. )
  5. // DtTaskCategory 任务分类表
  6. type DtTaskCategory struct {
  7. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:分类ID"`
  8. Name string `json:"name" gorm:"column:name;type:varchar(64);not null;comment:分类名称"`
  9. NameVi string `json:"nameVi" gorm:"column:name_vi;type:varchar(64);comment:分类名称(越南语)"`
  10. Icon string `json:"icon" gorm:"column:icon;type:varchar(255);comment:分类图标"`
  11. Platform string `json:"platform" gorm:"column:platform;type:varchar(32);comment:关联平台: tiktok/youtube/instagram/facebook"`
  12. Description string `json:"description" gorm:"column:description;type:varchar(255);comment:分类描述"`
  13. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=启用"`
  14. Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
  15. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
  16. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  17. }
  18. func (*DtTaskCategory) TableName() string {
  19. return "dt_task_category"
  20. }
  21. func NewDtTaskCategory() *DtTaskCategory {
  22. return &DtTaskCategory{}
  23. }
  24. // DtTask 任务表
  25. type DtTask struct {
  26. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:任务ID"`
  27. TaskNo string `json:"taskNo" gorm:"column:task_no;type:varchar(32);not null;uniqueIndex:uk_task_no;comment:任务编号"`
  28. CategoryId int64 `json:"categoryId" gorm:"column:category_id;type:bigint;not null;index:idx_category_id;comment:分类ID"`
  29. Title string `json:"title" gorm:"column:title;type:varchar(128);not null;comment:任务标题"`
  30. TitleVi string `json:"titleVi" gorm:"column:title_vi;type:varchar(128);comment:任务标题(越南语)"`
  31. Description string `json:"description" gorm:"column:description;type:text;comment:任务描述"`
  32. DescriptionVi string `json:"descriptionVi" gorm:"column:description_vi;type:text;comment:任务描述(越南语)"`
  33. Cover string `json:"cover" gorm:"column:cover;type:varchar(255);comment:封面图"`
  34. TargetUrl string `json:"targetUrl" gorm:"column:target_url;type:varchar(512);comment:目标链接"`
  35. TaskType int8 `json:"taskType" gorm:"column:task_type;type:tinyint;default:1;comment:任务类型: 1=关注 2=点赞 3=评论 4=分享 5=观看"`
  36. RewardAmount float64 `json:"rewardAmount" gorm:"column:reward_amount;type:decimal(18,2);default:0.00;comment:任务奖励(USDT)"`
  37. TotalCount int `json:"totalCount" gorm:"column:total_count;type:int;default:0;comment:任务总量"`
  38. RemainCount int `json:"remainCount" gorm:"column:remain_count;type:int;default:0;comment:剩余数量"`
  39. CompletedCount int `json:"completedCount" gorm:"column:completed_count;type:int;default:0;comment:完成数量"`
  40. DailyLimit int `json:"dailyLimit" gorm:"column:daily_limit;type:int;default:1;comment:每人每日限制"`
  41. TotalLimit int `json:"totalLimit" gorm:"column:total_limit;type:int;default:1;comment:每人总限制"`
  42. StartTime int64 `json:"startTime" gorm:"column:start_time;type:bigint;comment:开始时间"`
  43. EndTime int64 `json:"endTime" gorm:"column:end_time;type:bigint;comment:结束时间"`
  44. RequireScreenshot int8 `json:"requireScreenshot" gorm:"column:require_screenshot;type:tinyint;default:1;comment:是否需要截图: 0=否 1=是"`
  45. AutoAudit int8 `json:"autoAudit" gorm:"column:auto_audit;type:tinyint;default:0;comment:是否自动审核: 0=否 1=是"`
  46. AuditTimeout int `json:"auditTimeout" gorm:"column:audit_timeout;type:int;default:24;comment:审核超时(小时)"`
  47. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:0;index:idx_status;comment:状态: 0=草稿 1=上架 2=下架 3=已结束"`
  48. Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
  49. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  50. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  51. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  52. DeletedAt *time.Time `json:"deletedAt,omitempty" gorm:"column:deleted_at;type:datetime;index;comment:删除时间"`
  53. }
  54. func (*DtTask) TableName() string {
  55. return "dt_task"
  56. }
  57. func NewDtTask() *DtTask {
  58. return &DtTask{}
  59. }
  60. // DtTaskStep 任务步骤表
  61. type DtTaskStep struct {
  62. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:步骤ID"`
  63. TaskId int64 `json:"taskId" gorm:"column:task_id;type:bigint;not null;index:idx_task_id;comment:任务ID"`
  64. StepNo int `json:"stepNo" gorm:"column:step_no;type:int;default:1;comment:步骤序号"`
  65. Title string `json:"title" gorm:"column:title;type:varchar(128);not null;comment:步骤标题"`
  66. TitleVi string `json:"titleVi" gorm:"column:title_vi;type:varchar(128);comment:步骤标题(越南语)"`
  67. Description string `json:"description" gorm:"column:description;type:text;comment:步骤说明"`
  68. DescriptionVi string `json:"descriptionVi" gorm:"column:description_vi;type:text;comment:步骤说明(越南语)"`
  69. Image string `json:"image" gorm:"column:image;type:varchar(255);comment:示例图片"`
  70. RequireUpload int8 `json:"requireUpload" gorm:"column:require_upload;type:tinyint;default:0;comment:是否需要上传凭证: 0=否 1=是"`
  71. Sort int `json:"sort" gorm:"column:sort;type:int;default:0;comment:排序"`
  72. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
  73. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  74. }
  75. func (*DtTaskStep) TableName() string {
  76. return "dt_task_step"
  77. }
  78. func NewDtTaskStep() *DtTaskStep {
  79. return &DtTaskStep{}
  80. }
  81. // DtUserTask 用户任务记录表
  82. type DtUserTask struct {
  83. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:记录ID"`
  84. OrderNo string `json:"orderNo" gorm:"column:order_no;type:varchar(32);not null;uniqueIndex:uk_order_no;comment:订单编号"`
  85. UserId int64 `json:"userId" gorm:"column:user_id;type:bigint;not null;index:idx_user_id;comment:用户ID"`
  86. UserUid string `json:"userUid" gorm:"column:user_uid;type:varchar(32);comment:用户UID"`
  87. TaskId int64 `json:"taskId" gorm:"column:task_id;type:bigint;not null;index:idx_task_id;comment:任务ID"`
  88. TaskNo string `json:"taskNo" gorm:"column:task_no;type:varchar(32);comment:任务编号"`
  89. TaskTitle string `json:"taskTitle" gorm:"column:task_title;type:varchar(128);comment:任务标题"`
  90. RewardAmount float64 `json:"rewardAmount" gorm:"column:reward_amount;type:decimal(18,2);default:0.00;comment:奖励金额"`
  91. Screenshots string `json:"screenshots" gorm:"column:screenshots;type:json;comment:截图凭证列表"`
  92. SubmitTime int64 `json:"submitTime" gorm:"column:submit_time;type:bigint;comment:提交时间"`
  93. AuditTime int64 `json:"auditTime" gorm:"column:audit_time;type:bigint;comment:审核时间"`
  94. AuditAdminId int64 `json:"auditAdminId" gorm:"column:audit_admin_id;type:bigint;comment:审核管理员ID"`
  95. AuditRemark string `json:"auditRemark" gorm:"column:audit_remark;type:varchar(255);comment:审核备注"`
  96. RejectReason string `json:"rejectReason" gorm:"column:reject_reason;type:varchar(255);comment:拒绝原因"`
  97. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:0;index:idx_status;comment:状态: 0=进行中 1=待审核 2=已通过 3=已拒绝 4=已取消"`
  98. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;index:idx_created_at;comment:创建时间"`
  99. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  100. }
  101. func (*DtUserTask) TableName() string {
  102. return "dt_user_task"
  103. }
  104. func NewDtUserTask() *DtUserTask {
  105. return &DtUserTask{}
  106. }