info_pricing_strategy.go 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. // InfoPricingStrategyDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type InfoPricingStrategyDao 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 InfoPricingStrategyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // InfoPricingStrategyColumns defines and stores column names for table info_pricing_strategy.
  17. type InfoPricingStrategyColumns struct {
  18. Id string // id
  19. ProjectType string // 项目类型,0表示不限,1为全流程项目
  20. StrategyId string // 定价策略编号
  21. FeeForm string // 稿费形式,1,2,3分别代表产品置换、固定稿费、自报价
  22. Platform string // 项目平台,1-7分别代表小红书、抖音、微博、快手、b站、大众点评、知乎
  23. FansLow string // 对应粉丝量下限
  24. FansUp string // 对应粉丝量上限
  25. ServiceCharge string // 服务费,稿费形式为产品置换时填写,可以为空
  26. BaseOffer string // 基础报价
  27. Status string // 定价策略当前状态,0表示正常,1表示禁用
  28. ServiceRate string // 服务费率*1000,稿费形式为固定稿费和自报价时填写,可以为空
  29. UpdateId string // 修改管理人员id,对应user表中主键
  30. UpdateAt string // 修改时间
  31. CreateAt string // 创建时间
  32. }
  33. // infoPricingStrategyColumns holds the columns for table info_pricing_strategy.
  34. var infoPricingStrategyColumns = InfoPricingStrategyColumns{
  35. Id: "id",
  36. ProjectType: "project_type",
  37. StrategyId: "strategyId",
  38. FeeForm: "fee_form",
  39. Platform: "platform",
  40. FansLow: "fans_low",
  41. FansUp: "fans_up",
  42. ServiceCharge: "service_charge",
  43. BaseOffer: "base_offer",
  44. Status: "status",
  45. ServiceRate: "service_rate",
  46. UpdateId: "update_id",
  47. UpdateAt: "update_at",
  48. CreateAt: "create_at",
  49. }
  50. // NewInfoPricingStrategyDao creates and returns a new DAO object for table data access.
  51. func NewInfoPricingStrategyDao() *InfoPricingStrategyDao {
  52. return &InfoPricingStrategyDao{
  53. Group: "default",
  54. Table: "info_pricing_strategy",
  55. Columns: infoPricingStrategyColumns,
  56. }
  57. }
  58. // DB retrieves and returns the underlying raw database management object of current DAO.
  59. func (dao *InfoPricingStrategyDao) DB() gdb.DB {
  60. return g.DB(dao.Group)
  61. }
  62. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  63. func (dao *InfoPricingStrategyDao) Ctx(ctx context.Context) *gdb.Model {
  64. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  65. }
  66. // Transaction wraps the transaction logic using function f.
  67. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  68. // It commits the transaction and returns nil if function f returns nil.
  69. //
  70. // Note that, you should not Commit or Rollback the transaction in function f
  71. // as it is automatically handled by this function.
  72. func (dao *InfoPricingStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  73. return dao.Ctx(ctx).Transaction(ctx, f)
  74. }