project_info.go 3.7 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. // ProjectInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type ProjectInfoDao 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 ProjectInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // ProjectInfoColumns defines and stores column names for table project_info.
  17. type ProjectInfoColumns struct {
  18. ProjectId string // 项目id
  19. ProjectName string // 项目名称
  20. ProjectStatus string // 项目状态,1-10分别代表创建中、待审核、审核通过、招募中、招募完毕、待支付、已支付、失效、执行中、已结案
  21. ProjectType string // 项目类型,1代表全流程项目,2代表专项项目
  22. ProjectPlatform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
  23. ProjectForm string // 项目形式,1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
  24. TalentType string // 达人类型
  25. RecruitDdl string // 招募截止时间
  26. ContentType string // 内容形式,1代表图文,2代表视频
  27. ProjectDetail string // 项目详情
  28. ApplyNum string // 报名人数
  29. RecruitNum string // 已招募人数
  30. EnterpriseId string // 所属企业id
  31. ProductId string // 关联商品id
  32. CreatedAt string // 创建时间
  33. UpdatedAt string // 修改时间
  34. FeeForm string // 稿费形式列表
  35. }
  36. // projectInfoColumns holds the columns for table project_info.
  37. var projectInfoColumns = ProjectInfoColumns{
  38. ProjectId: "project_id",
  39. ProjectName: "project_name",
  40. ProjectStatus: "project_status",
  41. ProjectType: "project_type",
  42. ProjectPlatform: "project_platform",
  43. ProjectForm: "project_form",
  44. TalentType: "talent_type",
  45. RecruitDdl: "recruit_ddl",
  46. ContentType: "content_type",
  47. ProjectDetail: "project_detail",
  48. ApplyNum: "apply_num",
  49. RecruitNum: "recruit_num",
  50. EnterpriseId: "enterprise_id",
  51. ProductId: "product_id",
  52. CreatedAt: "created_at",
  53. UpdatedAt: "updated_at",
  54. FeeForm: "fee_form",
  55. }
  56. // NewProjectInfoDao creates and returns a new DAO object for table data access.
  57. func NewProjectInfoDao() *ProjectInfoDao {
  58. return &ProjectInfoDao{
  59. Group: "default",
  60. Table: "project_info",
  61. Columns: projectInfoColumns,
  62. }
  63. }
  64. // DB retrieves and returns the underlying raw database management object of current DAO.
  65. func (dao *ProjectInfoDao) 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 *ProjectInfoDao) 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 *ProjectInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  79. return dao.Ctx(ctx).Transaction(ctx, f)
  80. }