talent_pay_account_info.go 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. // TalentPayAccountInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TalentPayAccountInfoDao 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 TalentPayAccountInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TalentPayAccountInfoColumns defines and stores column names for table talent_pay_account_info.
  17. type TalentPayAccountInfoColumns struct {
  18. Id string //
  19. PayPlatform string // 支付平台,如支付宝
  20. PayAccount string // 支付账户
  21. AccountName string // 账户姓名
  22. TalentId string // 达人id(talent_info表中的id)
  23. }
  24. // talentPayAccountInfoColumns holds the columns for table talent_pay_account_info.
  25. var talentPayAccountInfoColumns = TalentPayAccountInfoColumns{
  26. Id: "id",
  27. PayPlatform: "pay_platform",
  28. PayAccount: "pay_account",
  29. AccountName: "account_name",
  30. TalentId: "talent_id",
  31. }
  32. // NewTalentPayAccountInfoDao creates and returns a new DAO object for table data access.
  33. func NewTalentPayAccountInfoDao() *TalentPayAccountInfoDao {
  34. return &TalentPayAccountInfoDao{
  35. Group: "default",
  36. Table: "talent_pay_account_info",
  37. Columns: talentPayAccountInfoColumns,
  38. }
  39. }
  40. // DB retrieves and returns the underlying raw database management object of current DAO.
  41. func (dao *TalentPayAccountInfoDao) DB() gdb.DB {
  42. return g.DB(dao.Group)
  43. }
  44. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  45. func (dao *TalentPayAccountInfoDao) Ctx(ctx context.Context) *gdb.Model {
  46. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  47. }
  48. // Transaction wraps the transaction logic using function f.
  49. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  50. // It commits the transaction and returns nil if function f returns nil.
  51. //
  52. // Note that, you should not Commit or Rollback the transaction in function f
  53. // as it is automatically handled by this function.
  54. func (dao *TalentPayAccountInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  55. return dao.Ctx(ctx).Transaction(ctx, f)
  56. }