project_info.go 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. }
  35. // projectInfoColumns holds the columns for table project_info.
  36. var projectInfoColumns = ProjectInfoColumns{
  37. ProjectId: "project_id",
  38. ProjectName: "project_name",
  39. ProjectStatus: "project_status",
  40. ProjectType: "project_type",
  41. ProjectPlatform: "project_platform",
  42. ProjectForm: "project_form",
  43. TalentType: "talent_type",
  44. RecruitDdl: "recruit_ddl",
  45. ContentType: "content_type",
  46. ProjectDetail: "project_detail",
  47. ApplyNum: "apply_num",
  48. RecruitNum: "recruit_num",
  49. EnterpriseId: "enterprise_id",
  50. ProductId: "product_id",
  51. CreatedAt: "created_at",
  52. UpdatedAt: "updated_at",
  53. }
  54. // NewProjectInfoDao creates and returns a new DAO object for table data access.
  55. func NewProjectInfoDao() *ProjectInfoDao {
  56. return &ProjectInfoDao{
  57. Group: "default",
  58. Table: "project_info",
  59. Columns: projectInfoColumns,
  60. }
  61. }
  62. // DB retrieves and returns the underlying raw database management object of current DAO.
  63. func (dao *ProjectInfoDao) DB() gdb.DB {
  64. return g.DB(dao.Group)
  65. }
  66. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  67. func (dao *ProjectInfoDao) Ctx(ctx context.Context) *gdb.Model {
  68. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  69. }
  70. // Transaction wraps the transaction logic using function f.
  71. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  72. // It commits the transaction and returns nil if function f returns nil.
  73. //
  74. // Note that, you should not Commit or Rollback the transaction in function f
  75. // as it is automatically handled by this function.
  76. func (dao *ProjectInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  77. return dao.Ctx(ctx).Transaction(ctx, f)
  78. }