recruit_strategy.go 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. // RecruitStrategyDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type RecruitStrategyDao 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 RecruitStrategyColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // RecruitStrategyColumns defines and stores column names for table recruit_strategy.
  17. type RecruitStrategyColumns struct {
  18. RecruitStrategyId string // 招募策略id
  19. FeeForm string // 稿费形式,1-3分别代表产品置换、固定稿费、自报价
  20. StrategyId string // 策略id
  21. FollowersLow string // 达人粉丝数下限
  22. FollowersUp string // 达人粉丝数上限
  23. RecruitNumber string // 招募数量
  24. Offer string // 报价
  25. ProjectId string // 所属项目id
  26. ServiceCharge string // 平台服务费,稿费形式为产品置换时必填
  27. SelectedNumber string // 已选数量,被企业选择的达人数量
  28. WaitingNumber string // 待发货
  29. DeliveredNumber string // 已发货
  30. SignedNumber string // 已签收
  31. }
  32. // recruitStrategyColumns holds the columns for table recruit_strategy.
  33. var recruitStrategyColumns = RecruitStrategyColumns{
  34. RecruitStrategyId: "recruit_strategy_id",
  35. FeeForm: "fee_form",
  36. StrategyId: "strategy_id",
  37. FollowersLow: "followers_low",
  38. FollowersUp: "followers_up",
  39. RecruitNumber: "recruit_number",
  40. Offer: "offer",
  41. ProjectId: "project_id",
  42. ServiceCharge: "service_charge",
  43. SelectedNumber: "selected_number",
  44. WaitingNumber: "waiting_number",
  45. DeliveredNumber: "delivered_number",
  46. SignedNumber: "signed_number",
  47. }
  48. // NewRecruitStrategyDao creates and returns a new DAO object for table data access.
  49. func NewRecruitStrategyDao() *RecruitStrategyDao {
  50. return &RecruitStrategyDao{
  51. Group: "default",
  52. Table: "recruit_strategy",
  53. Columns: recruitStrategyColumns,
  54. }
  55. }
  56. // DB retrieves and returns the underlying raw database management object of current DAO.
  57. func (dao *RecruitStrategyDao) DB() gdb.DB {
  58. return g.DB(dao.Group)
  59. }
  60. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  61. func (dao *RecruitStrategyDao) Ctx(ctx context.Context) *gdb.Model {
  62. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  63. }
  64. // Transaction wraps the transaction logic using function f.
  65. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  66. // It commits the transaction and returns nil if function f returns nil.
  67. //
  68. // Note that, you should not Commit or Rollback the transaction in function f
  69. // as it is automatically handled by this function.
  70. func (dao *RecruitStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  71. return dao.Ctx(ctx).Transaction(ctx, f)
  72. }