youngee_task_info.go 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. // YoungeeTaskInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YoungeeTaskInfoDao 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 YoungeeTaskInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YoungeeTaskInfoColumns defines and stores column names for table youngee_task_info.
  17. type YoungeeTaskInfoColumns struct {
  18. TaskId string // 任务id
  19. ProjectId string // 项目id
  20. TalentId string // 达人id
  21. TalentPlatformInfoSnap string // 达人平台信息快照
  22. TalentPersonalInfoSnap string // 达人个人信息快照
  23. TalentPostAddrSnap string // 收货地址快照
  24. StrategyId string // 报名选择的招募策略id
  25. TaskReward string // 任务奖励金额
  26. SettleAmount string // 待结算金额(任务奖励扣除违规扣款)
  27. TaskStatus string // 任务状态
  28. CreateDate string // 创建时间
  29. SelectDate string // 反选时间
  30. CompleteStatus string // 结束方式 1未结束 2正常结束 3反选失败 4被解约
  31. CompleteDate string // 结束时间
  32. }
  33. // youngeeTaskInfoColumns holds the columns for table youngee_task_info.
  34. var youngeeTaskInfoColumns = YoungeeTaskInfoColumns{
  35. TaskId: "task_id",
  36. ProjectId: "project_id",
  37. TalentId: "talent_id",
  38. TalentPlatformInfoSnap: "talent_platform_info_snap",
  39. TalentPersonalInfoSnap: "talent_personal_info_snap",
  40. TalentPostAddrSnap: "talent_post_addr_snap",
  41. StrategyId: "strategy_id",
  42. TaskReward: "task_reward",
  43. SettleAmount: "settle_amount",
  44. TaskStatus: "task_status",
  45. CreateDate: "create_date",
  46. SelectDate: "select_date",
  47. CompleteStatus: "complete_status",
  48. CompleteDate: "complete_date",
  49. }
  50. // NewYoungeeTaskInfoDao creates and returns a new DAO object for table data access.
  51. func NewYoungeeTaskInfoDao() *YoungeeTaskInfoDao {
  52. return &YoungeeTaskInfoDao{
  53. Group: "default",
  54. Table: "youngee_task_info",
  55. Columns: youngeeTaskInfoColumns,
  56. }
  57. }
  58. // DB retrieves and returns the underlying raw database management object of current DAO.
  59. func (dao *YoungeeTaskInfoDao) DB() gdb.DB {
  60. return g.DB(dao.Group)
  61. }
  62. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  63. func (dao *YoungeeTaskInfoDao) Ctx(ctx context.Context) *gdb.Model {
  64. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  65. }
  66. // Transaction wraps the transaction logic using function f.
  67. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  68. // It commits the transaction and returns nil if function f returns nil.
  69. //
  70. // Note that, you should not Commit or Rollback the transaction in function f
  71. // as it is automatically handled by this function.
  72. func (dao *YoungeeTaskInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  73. return dao.Ctx(ctx).Transaction(ctx, f)
  74. }