younggee_talent_team.go 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. // YounggeeTalentTeamDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeTalentTeamDao 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 YounggeeTalentTeamColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeTalentTeamColumns defines and stores column names for table younggee_talent_team.
  17. type YounggeeTalentTeamColumns struct {
  18. Id string // 递增id
  19. TeamId string // young之团id,10位随机数
  20. TalentId string // 团长达人id,对应youngee_talent_info中id字段
  21. ProjectId string // 项目id
  22. SelectionId string // 选品id
  23. ProjectType string // 项目类型,1为项目,2为选品
  24. ProjectName string // 项目名称
  25. ProjectPhoto string // 项目主图
  26. Platform string // 项目平台
  27. TeamStatus string // young之团状态,1表示创建中,2表示开团中,3表示已结束
  28. NumApply string // 报名人数
  29. NumApplySuccess string // 申请成功人数
  30. NumEnd string // 结案人数
  31. PointIncome string // 积分收益
  32. MoneyIncome string // 现金收益
  33. CreateAt string // 成团时间
  34. EndAt string // 结束时间
  35. }
  36. // younggeeTalentTeamColumns holds the columns for table younggee_talent_team.
  37. var younggeeTalentTeamColumns = YounggeeTalentTeamColumns{
  38. Id: "id",
  39. TeamId: "team_id",
  40. TalentId: "talent_id",
  41. ProjectId: "project_id",
  42. SelectionId: "selection_id",
  43. ProjectType: "project_type",
  44. ProjectName: "project_name",
  45. ProjectPhoto: "project_photo",
  46. Platform: "platform",
  47. TeamStatus: "team_status",
  48. NumApply: "num_apply",
  49. NumApplySuccess: "num_apply_success",
  50. NumEnd: "num_end",
  51. PointIncome: "point_income",
  52. MoneyIncome: "money_income",
  53. CreateAt: "create_at",
  54. EndAt: "end_at",
  55. }
  56. // NewYounggeeTalentTeamDao creates and returns a new DAO object for table data access.
  57. func NewYounggeeTalentTeamDao() *YounggeeTalentTeamDao {
  58. return &YounggeeTalentTeamDao{
  59. Group: "default",
  60. Table: "younggee_talent_team",
  61. Columns: younggeeTalentTeamColumns,
  62. }
  63. }
  64. // DB retrieves and returns the underlying raw database management object of current DAO.
  65. func (dao *YounggeeTalentTeamDao) DB() gdb.DB {
  66. return g.DB(dao.Group)
  67. }
  68. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  69. func (dao *YounggeeTalentTeamDao) Ctx(ctx context.Context) *gdb.Model {
  70. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  71. }
  72. // Transaction wraps the transaction logic using function f.
  73. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  74. // It commits the transaction and returns nil if function f returns nil.
  75. //
  76. // Note that, you should not Commit or Rollback the transaction in function f
  77. // as it is automatically handled by this function.
  78. func (dao *YounggeeTalentTeamDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  79. return dao.Ctx(ctx).Transaction(ctx, f)
  80. }