younggee_team_reward_config.go 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. // YounggeeTeamRewardConfigDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeTeamRewardConfigDao 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 YounggeeTeamRewardConfigColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeTeamRewardConfigColumns defines and stores column names for table younggee_team_reward_config.
  17. type YounggeeTeamRewardConfigColumns struct {
  18. Id string // 自增id
  19. ProjectType string // 项目类型,1、2分别为全流程项目、选品项目
  20. Platform string // 社媒平台
  21. TaskForm string // 任务形式,1-5为实体商品寄拍、虚拟产品测评、线下探店打卡、悬赏任务、纯佣带货;
  22. ContentForm string // 内容形式,1-3为图文、视频、直播
  23. RewardReason string // 奖励原因,1-4为成团-新用户、成团-老用户、成单-申请成功、成单-结案完毕
  24. Point string // 积分奖励
  25. Money string // 现金奖励,结算额百分比
  26. CreateAt string // 创建时间
  27. }
  28. // younggeeTeamRewardConfigColumns holds the columns for table younggee_team_reward_config.
  29. var younggeeTeamRewardConfigColumns = YounggeeTeamRewardConfigColumns{
  30. Id: "id",
  31. ProjectType: "project_type",
  32. Platform: "platform",
  33. TaskForm: "task_form",
  34. ContentForm: "content_form",
  35. RewardReason: "reward_reason",
  36. Point: "point",
  37. Money: "money",
  38. CreateAt: "create_at",
  39. }
  40. // NewYounggeeTeamRewardConfigDao creates and returns a new DAO object for table data access.
  41. func NewYounggeeTeamRewardConfigDao() *YounggeeTeamRewardConfigDao {
  42. return &YounggeeTeamRewardConfigDao{
  43. Group: "default",
  44. Table: "younggee_team_reward_config",
  45. Columns: younggeeTeamRewardConfigColumns,
  46. }
  47. }
  48. // DB retrieves and returns the underlying raw database management object of current DAO.
  49. func (dao *YounggeeTeamRewardConfigDao) DB() gdb.DB {
  50. return g.DB(dao.Group)
  51. }
  52. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  53. func (dao *YounggeeTeamRewardConfigDao) Ctx(ctx context.Context) *gdb.Model {
  54. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  55. }
  56. // Transaction wraps the transaction logic using function f.
  57. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  58. // It commits the transaction and returns nil if function f returns nil.
  59. //
  60. // Note that, you should not Commit or Rollback the transaction in function f
  61. // as it is automatically handled by this function.
  62. func (dao *YounggeeTeamRewardConfigDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  63. return dao.Ctx(ctx).Transaction(ctx, f)
  64. }