task_base_info.go 3.8 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. // TaskBaseInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TaskBaseInfoDao 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 TaskBaseInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TaskBaseInfoColumns defines and stores column names for table task_base_info.
  17. type TaskBaseInfoColumns struct {
  18. TaskId string // 任务基础信息id
  19. TaskName string // 任务名称
  20. TaskPlatform string // 任务平台id,取third_platform_info表id
  21. TaskMode string // 任务模式 1置换任务 2稿费任务 3折扣任务
  22. BusinessType string // 业务类型 1实物 2虚拟 3线下
  23. ContentForm string // 内容形式 低4位为图片和视频类型,0001原创图片 0010指定图片 0100原创视频 1000指定视频 5~6位为文案类型 010000为原创文案 100000为指定文案 第7位为是否直播01000000为直播00000000为非直播
  24. OtherForm string // 其他形式 1不限 2仅单品 3仅合辑
  25. StartTime string // 作品发布时间
  26. EndTime string // 作品结束时间
  27. DeadlineTime string // 任务报名截至日期
  28. TaskStatus string // 任务状态:1待支付(待上线) 2执行中 3已结案
  29. TaskCreateFlag string // 创建任务时提交状态
  30. BrandId string // 品牌id
  31. ProductId string // 任务商品id
  32. CreatedAt string // 创建时间
  33. OnlineTime string // 上线时间
  34. BrandName string // 品牌名称
  35. }
  36. // taskBaseInfoColumns holds the columns for table task_base_info.
  37. var taskBaseInfoColumns = TaskBaseInfoColumns{
  38. TaskId: "task_id",
  39. TaskName: "task_name",
  40. TaskPlatform: "task_platform",
  41. TaskMode: "task_mode",
  42. BusinessType: "business_type",
  43. ContentForm: "content_form",
  44. OtherForm: "other_form",
  45. StartTime: "start_time",
  46. EndTime: "end_time",
  47. DeadlineTime: "deadline_time",
  48. TaskStatus: "task_status",
  49. TaskCreateFlag: "task_create_flag",
  50. BrandId: "brand_id",
  51. ProductId: "product_id",
  52. CreatedAt: "created_at",
  53. OnlineTime: "online_time",
  54. BrandName: "brand_name",
  55. }
  56. // NewTaskBaseInfoDao creates and returns a new DAO object for table data access.
  57. func NewTaskBaseInfoDao() *TaskBaseInfoDao {
  58. return &TaskBaseInfoDao{
  59. Group: "default",
  60. Table: "task_base_info",
  61. Columns: taskBaseInfoColumns,
  62. }
  63. }
  64. // DB retrieves and returns the underlying raw database management object of current DAO.
  65. func (dao *TaskBaseInfoDao) 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 *TaskBaseInfoDao) 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 *TaskBaseInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  79. return dao.Ctx(ctx).Transaction(ctx, f)
  80. }