younggee_talent_bank.go 3.2 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. // YounggeeTalentBankDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type YounggeeTalentBankDao 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 YounggeeTalentBankColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // YounggeeTalentBankColumns defines and stores column names for table younggee_talent_bank.
  17. type YounggeeTalentBankColumns struct {
  18. Id string // id
  19. TalentId string // 达人id,取younggee_talent_info表中的id字段值
  20. Name string // 户主姓名
  21. Phone string // 手机号
  22. Bank string // 银行
  23. BankCardNumber string // 银行卡号
  24. BankOpenAddress string // 开户地址区域码,取info_region表中的self_code字段值
  25. AlipayNumber string // 支付宝账号
  26. AlipayRealName string // 支付宝真实姓名
  27. AlipayCardId string // 支付宝身份证号
  28. BankCardId string // 银行卡身份证号
  29. CreateAt string //
  30. UpdateAt string //
  31. }
  32. // younggeeTalentBankColumns holds the columns for table younggee_talent_bank.
  33. var younggeeTalentBankColumns = YounggeeTalentBankColumns{
  34. Id: "id",
  35. TalentId: "talent_id",
  36. Name: "name",
  37. Phone: "phone",
  38. Bank: "bank",
  39. BankCardNumber: "bank_card_number",
  40. BankOpenAddress: "bank_open_address",
  41. AlipayNumber: "alipay_number",
  42. AlipayRealName: "alipay_real_name",
  43. AlipayCardId: "alipay_card_id",
  44. BankCardId: "bank_card_id",
  45. CreateAt: "create_at",
  46. UpdateAt: "update_at",
  47. }
  48. // NewYounggeeTalentBankDao creates and returns a new DAO object for table data access.
  49. func NewYounggeeTalentBankDao() *YounggeeTalentBankDao {
  50. return &YounggeeTalentBankDao{
  51. Group: "default",
  52. Table: "younggee_talent_bank",
  53. Columns: younggeeTalentBankColumns,
  54. }
  55. }
  56. // DB retrieves and returns the underlying raw database management object of current DAO.
  57. func (dao *YounggeeTalentBankDao) 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 *YounggeeTalentBankDao) 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 *YounggeeTalentBankDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  71. return dao.Ctx(ctx).Transaction(ctx, f)
  72. }