recruit_strategy.go 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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. TOffer string // 达人所见报价
  26. ProjectId string // 所属项目id
  27. ServiceCharge string // 平台服务费,稿费形式为产品置换时必填
  28. SelectedNumber string // 已选数量,被企业选择的达人数量
  29. WaitingNumber string // 待发货
  30. DeliveredNumber string // 已发货
  31. SignedNumber string // 已签收
  32. MaxOffer string // 报价上限
  33. MinOffer string // 报价下限
  34. FanNumber string // 总粉丝量
  35. PlayNumber string // 总播放量
  36. LikeNumber string // 总点赞数
  37. CollectNumber string // 总收藏量
  38. CommentNumber string // 总评论数
  39. FinishNumber string // 结案数量
  40. TotalOffer string // 支付合计
  41. }
  42. // recruitStrategyColumns holds the columns for table recruit_strategy.
  43. var recruitStrategyColumns = RecruitStrategyColumns{
  44. RecruitStrategyId: "recruit_strategy_id",
  45. FeeForm: "fee_form",
  46. StrategyId: "strategy_id",
  47. FollowersLow: "followers_low",
  48. FollowersUp: "followers_up",
  49. RecruitNumber: "recruit_number",
  50. Offer: "offer",
  51. TOffer: "t_offer",
  52. ProjectId: "project_id",
  53. ServiceCharge: "service_charge",
  54. SelectedNumber: "selected_number",
  55. WaitingNumber: "waiting_number",
  56. DeliveredNumber: "delivered_number",
  57. SignedNumber: "signed_number",
  58. MaxOffer: "max_offer",
  59. MinOffer: "min_offer",
  60. FanNumber: "fan_number",
  61. PlayNumber: "play_number",
  62. LikeNumber: "like_number",
  63. CollectNumber: "collect_number",
  64. CommentNumber: "comment_number",
  65. FinishNumber: "finish_number",
  66. TotalOffer: "total_offer",
  67. }
  68. // NewRecruitStrategyDao creates and returns a new DAO object for table data access.
  69. func NewRecruitStrategyDao() *RecruitStrategyDao {
  70. return &RecruitStrategyDao{
  71. Group: "default",
  72. Table: "recruit_strategy",
  73. Columns: recruitStrategyColumns,
  74. }
  75. }
  76. // DB retrieves and returns the underlying raw database management object of current DAO.
  77. func (dao *RecruitStrategyDao) DB() gdb.DB {
  78. return g.DB(dao.Group)
  79. }
  80. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  81. func (dao *RecruitStrategyDao) Ctx(ctx context.Context) *gdb.Model {
  82. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  83. }
  84. // Transaction wraps the transaction logic using function f.
  85. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  86. // It commits the transaction and returns nil if function f returns nil.
  87. //
  88. // Note that, you should not Commit or Rollback the transaction in function f
  89. // as it is automatically handled by this function.
  90. func (dao *RecruitStrategyDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  91. return dao.Ctx(ctx).Transaction(ctx, f)
  92. }