younggee_selection_info.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. // ==========================================================================
  2. // Code generated by GoFrame CLI tool. DO NOT EDIT.
  3. // ==========================================================================
  4. package internal
  5. import (
  6. "context"
  7. "github.com/gogf/gf/database/gdb"
  8. "github.com/gogf/gf/frame/g"
  9. )
  10. // YounggeeSelectionInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeSelectionInfoDao struct {
  12. Table string // Table is the underlying table name of the DAO.
  13. Group string // Group is the database configuration group name of current DAO.
  14. Columns YounggeeSelectionInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeSelectionInfoColumns defines and stores column names for table younggee_selection_info.
  17. type YounggeeSelectionInfoColumns struct {
  18. SelectionId string // 选品项目id
  19. SelectionName string // 选品项目名称
  20. EnterpriseId string // 所属企业id
  21. ProductId string // 关联商品id
  22. ContentType string // 内容形式,1代表图文,2代表视频,3代表直播
  23. SelectionStatus string // 选品项目状态,1-8分别代表创建中、待审核、审核通过、待支付、已支付、执行中、失效、已结案
  24. TaskMode string // 任务形式,1、2分别表示悬赏任务、纯佣带货
  25. Platform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
  26. SampleMode string // 领样形式,1、2、3分别表示免费领样、垫付领样、不提供样品
  27. ProductUrl string // 带货链接
  28. SampleNum string // 样品数量
  29. RemainNum string // 剩余数量
  30. CommissionRate string // 佣金比例
  31. EstimatedCost string // 预估成本
  32. TaskReward string // 任务悬赏
  33. SampleCondition string // 领样条件
  34. RewardCondition string // 返现悬赏条件
  35. SettlementAmount string // 结算金额
  36. TaskDdl string // 招募截止时间
  37. Detail string // 卖点总结
  38. ProductSnap string // 商品信息快照
  39. ProductPhotoSnap string // 商品图片快照
  40. CreatedAt string // 创建时间
  41. UpdatedAt string // 修改时间
  42. SubmitAt string // 提交审核时间
  43. PassAt string // 审核通过时间
  44. FailReason string // 失效原因,1、2分别表示逾期未支付、项目存在风险
  45. PayAt string // 支付时间
  46. FinishAt string // 结案时间
  47. IsRead string // 是否已读
  48. AutoTaskId string // 定时任务id
  49. AutoFailAt string // 失效自动处理时间
  50. }
  51. // younggeeSelectionInfoColumns holds the columns for table younggee_selection_info.
  52. var younggeeSelectionInfoColumns = YounggeeSelectionInfoColumns{
  53. SelectionId: "selection_id",
  54. SelectionName: "selection_name",
  55. EnterpriseId: "enterprise_id",
  56. ProductId: "product_id",
  57. ContentType: "content_type",
  58. SelectionStatus: "selection_status",
  59. TaskMode: "task_mode",
  60. Platform: "platform",
  61. SampleMode: "sample_mode",
  62. ProductUrl: "product_url",
  63. SampleNum: "sample_num",
  64. RemainNum: "remain_num",
  65. CommissionRate: "commission_rate",
  66. EstimatedCost: "estimated_cost",
  67. TaskReward: "task_reward",
  68. SampleCondition: "sample_condition",
  69. RewardCondition: "reward_condition",
  70. SettlementAmount: "settlement_amount",
  71. TaskDdl: "task_ddl",
  72. Detail: "detail",
  73. ProductSnap: "product_snap",
  74. ProductPhotoSnap: "product_photo_snap",
  75. CreatedAt: "created_at",
  76. UpdatedAt: "updated_at",
  77. SubmitAt: "submit_at",
  78. PassAt: "pass_at",
  79. FailReason: "fail_reason",
  80. PayAt: "pay_at",
  81. FinishAt: "finish_at",
  82. IsRead: "is_read",
  83. AutoTaskId: "auto_task_id",
  84. AutoFailAt: "auto_fail_at",
  85. }
  86. // NewYounggeeSelectionInfoDao creates and returns a new DAO object for table data access.
  87. func NewYounggeeSelectionInfoDao() *YounggeeSelectionInfoDao {
  88. return &YounggeeSelectionInfoDao{
  89. Group: "default",
  90. Table: "younggee_selection_info",
  91. Columns: younggeeSelectionInfoColumns,
  92. }
  93. }
  94. // DB retrieves and returns the underlying raw database management object of current DAO.
  95. func (dao *YounggeeSelectionInfoDao) DB() gdb.DB {
  96. return g.DB(dao.Group)
  97. }
  98. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  99. func (dao *YounggeeSelectionInfoDao) Ctx(ctx context.Context) *gdb.Model {
  100. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  101. }
  102. // Transaction wraps the transaction logic using function f.
  103. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  104. // It commits the transaction and returns nil if function f returns nil.
  105. //
  106. // Note that, you should not Commit or Rollback the transaction in function f
  107. // as it is automatically handled by this function.
  108. func (dao *YounggeeSelectionInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  109. return dao.Ctx(ctx).Transaction(ctx, f)
  110. }