dt_task.go 8.9 KB

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