// ========================================================================== // Code generated by GoFrame CLI tool. DO NOT EDIT. // ========================================================================== package internal import ( "context" "github.com/gogf/gf/database/gdb" "github.com/gogf/gf/frame/g" ) // YoungeeContractSetDao is the manager for logic model data accessing and custom defined data operations functions management. type YoungeeContractSetDao struct { Table string // Table is the underlying table name of the DAO. Group string // Group is the database configuration group name of current DAO. Columns YoungeeContractSetColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage. } // YoungeeContractSetColumns defines and stores column names for table youngee_contract_set. type YoungeeContractSetColumns struct { BreakManageId string // 违约自动管理策略id ProejctType string // 项目类型:1:全流程 2:专项 ProjectForm string // 任务形式:1-4分别代表实体商品寄拍、虚拟产品测评、线下探店打卡、素材微原创 FeeForm string // 稿费形式:1,2,3分别代表产品置换、固定稿费、自报价 BreakType string // 违约类型:1-4:初稿、脚本、链接和数据 NouploadCutRatio string // 未上传 扣款比例 NotimeuploadCutRatio string // 未按照规定时间上传脚本 扣款比例 } // youngeeContractSetColumns holds the columns for table youngee_contract_set. var youngeeContractSetColumns = YoungeeContractSetColumns{ BreakManageId: "break_manage_id", ProejctType: "proejct_type", ProjectForm: "project_form", FeeForm: "fee_form", BreakType: "break_type", NouploadCutRatio: "noupload_cut_ratio", NotimeuploadCutRatio: "notimeupload_cut_ratio", } // NewYoungeeContractSetDao creates and returns a new DAO object for table data access. func NewYoungeeContractSetDao() *YoungeeContractSetDao { return &YoungeeContractSetDao{ Group: "default", Table: "youngee_contract_set", Columns: youngeeContractSetColumns, } } // DB retrieves and returns the underlying raw database management object of current DAO. func (dao *YoungeeContractSetDao) DB() gdb.DB { return g.DB(dao.Group) } // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation. func (dao *YoungeeContractSetDao) Ctx(ctx context.Context) *gdb.Model { return dao.DB().Model(dao.Table).Safe().Ctx(ctx) } // Transaction wraps the transaction logic using function f. // It rollbacks the transaction and returns the error from function f if it returns non-nil error. // It commits the transaction and returns nil if function f returns nil. // // Note that, you should not Commit or Rollback the transaction in function f // as it is automatically handled by this function. func (dao *YoungeeContractSetDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) { return dao.Ctx(ctx).Transaction(ctx, f) }