youngee_contract_set.go 3.1 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. // YoungeeContractSetDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YoungeeContractSetDao 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 YoungeeContractSetColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YoungeeContractSetColumns defines and stores column names for table youngee_contract_set.
  17. type YoungeeContractSetColumns struct {
  18. BreakManageId string // 违约自动管理策略id
  19. ProejctType string // 项目类型:1:全流程 2:专项
  20. ProjectForm string // 任务形式:1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创
  21. FeeForm string // 稿费形式:1,2,3分别代表产品置换、固定稿费、自报价
  22. BreakType string // 违约类型:1-4:初稿、脚本、链接和数据
  23. NouploadCutRatio string // 未上传 扣款比例
  24. NotimeuploadCutRatio string // 未按照规定时间上传脚本 扣款比例
  25. }
  26. // youngeeContractSetColumns holds the columns for table youngee_contract_set.
  27. var youngeeContractSetColumns = YoungeeContractSetColumns{
  28. BreakManageId: "break_manage_id",
  29. ProejctType: "proejct_type",
  30. ProjectForm: "project_form",
  31. FeeForm: "fee_form",
  32. BreakType: "break_type",
  33. NouploadCutRatio: "noupload_cut_ratio",
  34. NotimeuploadCutRatio: "notimeupload_cut_ratio",
  35. }
  36. // NewYoungeeContractSetDao creates and returns a new DAO object for table data access.
  37. func NewYoungeeContractSetDao() *YoungeeContractSetDao {
  38. return &YoungeeContractSetDao{
  39. Group: "default",
  40. Table: "youngee_contract_set",
  41. Columns: youngeeContractSetColumns,
  42. }
  43. }
  44. // DB retrieves and returns the underlying raw database management object of current DAO.
  45. func (dao *YoungeeContractSetDao) 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 *YoungeeContractSetDao) 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 *YoungeeContractSetDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  59. return dao.Ctx(ctx).Transaction(ctx, f)
  60. }