project_info.go 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  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. AutoFailAt string // 失效自动处理时间
  36. AutoTaskId string // 定时任务id
  37. AutoDefaultId string // 违约状态id
  38. PaymentAmount string // 支付金额
  39. PayAt string // 支付时间
  40. AutoScriptBreakAt string // 脚本违约自动处理时间
  41. AutoSketchBreakAt string // 初稿违约自动处理时间
  42. FailReason string // 失效原因,1、2分别表示逾期未支付、项目存在风险
  43. PassAt string // 审核通过时间
  44. FinishAt string // 结案时间
  45. EstimatedCost string // 预估成本
  46. IsRead string // 是否已读
  47. SettlementAmount string // 结算金额
  48. ProductSnap string // 商品信息快照
  49. ProductPhotoSnap string // 商品图片快照
  50. SubmitAt string // 提交审核时间
  51. }
  52. // projectInfoColumns holds the columns for table project_info.
  53. var projectInfoColumns = ProjectInfoColumns{
  54. ProjectId: "project_id",
  55. ProjectName: "project_name",
  56. ProjectStatus: "project_status",
  57. ProjectType: "project_type",
  58. ProjectPlatform: "project_platform",
  59. ProjectForm: "project_form",
  60. TalentType: "talent_type",
  61. RecruitDdl: "recruit_ddl",
  62. ContentType: "content_type",
  63. ProjectDetail: "project_detail",
  64. ApplyNum: "apply_num",
  65. RecruitNum: "recruit_num",
  66. EnterpriseId: "enterprise_id",
  67. ProductId: "product_id",
  68. CreatedAt: "created_at",
  69. UpdatedAt: "updated_at",
  70. FeeForm: "fee_form",
  71. AutoFailAt: "auto_fail_at",
  72. AutoTaskId: "auto_task_id",
  73. AutoDefaultId: "auto_default_id",
  74. PaymentAmount: "payment_amount",
  75. PayAt: "pay_at",
  76. AutoScriptBreakAt: "auto_script_break_at",
  77. AutoSketchBreakAt: "auto_sketch_break_at",
  78. FailReason: "fail_reason",
  79. PassAt: "pass_at",
  80. FinishAt: "finish_at",
  81. EstimatedCost: "estimated_cost",
  82. IsRead: "is_read",
  83. SettlementAmount: "settlement_amount",
  84. ProductSnap: "product_snap",
  85. ProductPhotoSnap: "product_photo_snap",
  86. SubmitAt: "submit_at",
  87. }
  88. // NewProjectInfoDao creates and returns a new DAO object for table data access.
  89. func NewProjectInfoDao() *ProjectInfoDao {
  90. return &ProjectInfoDao{
  91. Group: "default",
  92. Table: "project_info",
  93. Columns: projectInfoColumns,
  94. }
  95. }
  96. // DB retrieves and returns the underlying raw database management object of current DAO.
  97. func (dao *ProjectInfoDao) DB() gdb.DB {
  98. return g.DB(dao.Group)
  99. }
  100. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  101. func (dao *ProjectInfoDao) Ctx(ctx context.Context) *gdb.Model {
  102. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  103. }
  104. // Transaction wraps the transaction logic using function f.
  105. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  106. // It commits the transaction and returns nil if function f returns nil.
  107. //
  108. // Note that, you should not Commit or Rollback the transaction in function f
  109. // as it is automatically handled by this function.
  110. func (dao *ProjectInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  111. return dao.Ctx(ctx).Transaction(ctx, f)
  112. }