info_youngee_strategy.go 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. // InfoYoungeeStrategyDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoYoungeeStrategyDao 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 InfoYoungeeStrategyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoYoungeeStrategyColumns defines and stores column names for table info_youngee_strategy.
  17. type InfoYoungeeStrategyColumns struct {
  18. Id string // id
  19. ProjectType string // 项目类型,0表示不限,1为全流程项目,2为选品项目
  20. StrategyId string // 定价策略编号
  21. Platform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
  22. TaskType string // 任务形式,实体商品寄拍、虚拟产品测评、线下探店打卡、悬赏任务、纯佣带货
  23. ContentType string // 内容形式 图文、视频、直播
  24. Reason string // 奖励原因,成团-新用户、成团-老用户、成单-申请成功、成单-结案完毕;
  25. Points string // 积分奖励
  26. Cash string // 现金奖励
  27. Status string // '定价策略当前状态,0表示正常,1表示禁用',
  28. CreateAt string // 创建时间
  29. }
  30. // infoYoungeeStrategyColumns holds the columns for table info_youngee_strategy.
  31. var infoYoungeeStrategyColumns = InfoYoungeeStrategyColumns{
  32. Id: "id",
  33. ProjectType: "project_type",
  34. StrategyId: "strategyId",
  35. Platform: "platform",
  36. TaskType: "task_type",
  37. ContentType: "content_type",
  38. Reason: "reason",
  39. Points: "points",
  40. Cash: "cash",
  41. Status: "status",
  42. CreateAt: "create_at",
  43. }
  44. // NewInfoYoungeeStrategyDao creates and returns a new DAO object for table data access.
  45. func NewInfoYoungeeStrategyDao() *InfoYoungeeStrategyDao {
  46. return &InfoYoungeeStrategyDao{
  47. Group: "default",
  48. Table: "info_youngee_strategy",
  49. Columns: infoYoungeeStrategyColumns,
  50. }
  51. }
  52. // DB retrieves and returns the underlying raw database management object of current DAO.
  53. func (dao *InfoYoungeeStrategyDao) DB() gdb.DB {
  54. return g.DB(dao.Group)
  55. }
  56. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  57. func (dao *InfoYoungeeStrategyDao) Ctx(ctx context.Context) *gdb.Model {
  58. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  59. }
  60. // Transaction wraps the transaction logic using function f.
  61. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  62. // It commits the transaction and returns nil if function f returns nil.
  63. //
  64. // Note that, you should not Commit or Rollback the transaction in function f
  65. // as it is automatically handled by this function.
  66. func (dao *InfoYoungeeStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  67. return dao.Ctx(ctx).Transaction(ctx, f)
  68. }