task_procedure_buy_samples_info.go 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. // TaskProcedureBuySamplesInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TaskProcedureBuySamplesInfoDao 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 TaskProcedureBuySamplesInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TaskProcedureBuySamplesInfoColumns defines and stores column names for table task_procedure_buy_samples_info.
  17. type TaskProcedureBuySamplesInfoColumns struct {
  18. TpbId string //
  19. TaskBaseId string // 任务id(对应task_base_info表id字段)
  20. PlatformName string // 平台对应的名称
  21. BuySamplesCost string // 拍单费用
  22. BuySamplesRefund string // 拍单退费
  23. BuySamplesUrl string // 拍单链接
  24. SyncLogistics string // 是否同步物流信息 0不同步 1同步
  25. }
  26. // taskProcedureBuySamplesInfoColumns holds the columns for table task_procedure_buy_samples_info.
  27. var taskProcedureBuySamplesInfoColumns = TaskProcedureBuySamplesInfoColumns{
  28. TpbId: "tpb_id",
  29. TaskBaseId: "task_base_id",
  30. PlatformName: "platform_name",
  31. BuySamplesCost: "buy_samples_cost",
  32. BuySamplesRefund: "buy_samples_refund",
  33. BuySamplesUrl: "buy_samples_url",
  34. SyncLogistics: "sync_logistics",
  35. }
  36. // NewTaskProcedureBuySamplesInfoDao creates and returns a new DAO object for table data access.
  37. func NewTaskProcedureBuySamplesInfoDao() *TaskProcedureBuySamplesInfoDao {
  38. return &TaskProcedureBuySamplesInfoDao{
  39. Group: "default",
  40. Table: "task_procedure_buy_samples_info",
  41. Columns: taskProcedureBuySamplesInfoColumns,
  42. }
  43. }
  44. // DB retrieves and returns the underlying raw database management object of current DAO.
  45. func (dao *TaskProcedureBuySamplesInfoDao) DB() gdb.DB {
  46. return g.DB(dao.Group)
  47. }
  48. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  49. func (dao *TaskProcedureBuySamplesInfoDao) Ctx(ctx context.Context) *gdb.Model {
  50. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  51. }
  52. // Transaction wraps the transaction logic using function f.
  53. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  54. // It commits the transaction and returns nil if function f returns nil.
  55. //
  56. // Note that, you should not Commit or Rollback the transaction in function f
  57. // as it is automatically handled by this function.
  58. func (dao *TaskProcedureBuySamplesInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  59. return dao.Ctx(ctx).Transaction(ctx, f)
  60. }