talent_info.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. // TalentInfoDao is the manager for logic model data accessing and custom defined data operations functions management.
  11. type TalentInfoDao 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 TalentInfoColumns // Columns is the short type for Columns, which contains all the column names of Table for convenient usage.
  15. }
  16. // TalentInfoColumns defines and stores column names for table talent_info.
  17. type TalentInfoColumns struct {
  18. Id string //
  19. TalentWxOpenid string // 达人的微信openid
  20. TalentWxNickname string // 达人的微信昵称
  21. TalentWxNumber string // 达人微信号
  22. TalentGender string // 性别,0未知 1男 2女
  23. TalentPhoneNumber string // 电话号码
  24. TalentAgeBracket string // 年龄段,取tallent_age_bracket表id
  25. TalentSkinType string // 肤质,取tallent_skin_type表的id
  26. TalentNationality string // 国籍,取tallent_nationality表id
  27. VisitStoreRegion string // 探店区域,取region_info表中的self_code
  28. ApprovalStatus string // 审核状态 0提交未审核 1审核通过 2审核失败
  29. ApprovalDate string // 审核时间
  30. Enabled string // 是否上架(激活)
  31. EnabledDate string // 上架(激活)时间
  32. InBlacklist string // 是否加入黑名单 0否 1是
  33. CreateDate string // 创建时间
  34. LastLoginDate string // 最后登录时间
  35. AliName string // 支付宝姓名
  36. AliAccount string // 支付宝账号
  37. }
  38. // talentInfoColumns holds the columns for table talent_info.
  39. var talentInfoColumns = TalentInfoColumns{
  40. Id: "id",
  41. TalentWxOpenid: "talent_wx_openid",
  42. TalentWxNickname: "talent_wx_nickname",
  43. TalentWxNumber: "talent_wx_number",
  44. TalentGender: "talent_gender",
  45. TalentPhoneNumber: "talent_phone_number",
  46. TalentAgeBracket: "talent_age_bracket",
  47. TalentSkinType: "talent_skin_type",
  48. TalentNationality: "talent_nationality",
  49. VisitStoreRegion: "visit_store_region",
  50. ApprovalStatus: "approval_status",
  51. ApprovalDate: "approval_date",
  52. Enabled: "enabled",
  53. EnabledDate: "enabled_date",
  54. InBlacklist: "in_blacklist",
  55. CreateDate: "create_date",
  56. LastLoginDate: "last_login_date",
  57. AliName: "ali_name",
  58. AliAccount: "ali_account",
  59. }
  60. // NewTalentInfoDao creates and returns a new DAO object for table data access.
  61. func NewTalentInfoDao() *TalentInfoDao {
  62. return &TalentInfoDao{
  63. Group: "default",
  64. Table: "talent_info",
  65. Columns: talentInfoColumns,
  66. }
  67. }
  68. // DB retrieves and returns the underlying raw database management object of current DAO.
  69. func (dao *TalentInfoDao) DB() gdb.DB {
  70. return g.DB(dao.Group)
  71. }
  72. // Ctx creates and returns the Model for current DAO, It automatically sets the context for current operation.
  73. func (dao *TalentInfoDao) Ctx(ctx context.Context) *gdb.Model {
  74. return dao.DB().Model(dao.Table).Safe().Ctx(ctx)
  75. }
  76. // Transaction wraps the transaction logic using function f.
  77. // It rollbacks the transaction and returns the error from function f if it returns non-nil error.
  78. // It commits the transaction and returns nil if function f returns nil.
  79. //
  80. // Note that, you should not Commit or Rollback the transaction in function f
  81. // as it is automatically handled by this function.
  82. func (dao *TalentInfoDao) Transaction(ctx context.Context, f func(ctx context.Context, tx *gdb.TX) error) (err error) {
  83. return dao.Ctx(ctx).Transaction(ctx, f)
  84. }