dt_user.go 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package entity
  2. // DtUser 用户表
  3. type DtUser struct {
  4. MysqlFullModel
  5. Uid string `json:"uid" gorm:"type:varchar(32);uniqueIndex:uk_uid;comment:用户UID"`
  6. Phone string `json:"phone" gorm:"type:varchar(32);uniqueIndex:uk_phone;comment:手机号"`
  7. Email string `json:"email" gorm:"type:varchar(128);index:idx_email;comment:邮箱"`
  8. Password string `json:"-" gorm:"type:varchar(128);comment:登录密码"`
  9. PayPassword string `json:"-" gorm:"type:varchar(128);comment:支付密码"`
  10. Nickname string `json:"nickname" gorm:"type:varchar(64);comment:昵称"`
  11. Avatar string `json:"avatar" gorm:"type:varchar(255);comment:头像"`
  12. InviteCode string `json:"inviteCode" gorm:"type:varchar(16);uniqueIndex:uk_invite_code;comment:邀请码"`
  13. ParentId int64 `json:"parentId" gorm:"default:0;index:idx_parent_id;comment:上级用户ID"`
  14. ParentUid string `json:"parentUid" gorm:"type:varchar(32);comment:上级用户UID"`
  15. LevelId int64 `json:"levelId" gorm:"default:1;index:idx_level_id;comment:用户等级ID"`
  16. Balance float64 `json:"balance" gorm:"type:decimal(18,2);default:0.00;comment:账户余额(USDT)"`
  17. FrozenBalance float64 `json:"frozenBalance" gorm:"type:decimal(18,2);default:0.00;comment:冻结余额"`
  18. TotalRecharge float64 `json:"totalRecharge" gorm:"type:decimal(18,2);default:0.00;comment:累计充值"`
  19. TotalWithdraw float64 `json:"totalWithdraw" gorm:"type:decimal(18,2);default:0.00;comment:累计提现"`
  20. TotalTaskIncome float64 `json:"totalTaskIncome" gorm:"type:decimal(18,2);default:0.00;comment:累计任务收益"`
  21. TotalInviteIncome float64 `json:"totalInviteIncome" gorm:"type:decimal(18,2);default:0.00;comment:累计推广收益"`
  22. TodayTaskCount int `json:"todayTaskCount" gorm:"default:0;comment:今日完成任务数"`
  23. TotalTaskCount int `json:"totalTaskCount" gorm:"default:0;comment:累计完成任务数"`
  24. DirectInviteCount int `json:"directInviteCount" gorm:"default:0;comment:直推人数"`
  25. TeamCount int `json:"teamCount" gorm:"default:0;comment:团队人数"`
  26. Status int8 `json:"status" gorm:"default:1;comment:状态: 0=禁用 1=正常"`
  27. IsRealName int8 `json:"isRealName" gorm:"default:0;comment:是否实名: 0=否 1=是"`
  28. RealName string `json:"realName" gorm:"type:varchar(64);comment:真实姓名"`
  29. IdCard string `json:"idCard" gorm:"type:varchar(64);comment:身份证号"`
  30. RegisterIp string `json:"registerIp" gorm:"type:varchar(64);comment:注册IP"`
  31. RegisterDevice string `json:"registerDevice" gorm:"type:varchar(255);comment:注册设备"`
  32. LastLoginTime int64 `json:"lastLoginTime" gorm:"comment:最后登录时间"`
  33. LastLoginIp string `json:"lastLoginIp" gorm:"type:varchar(64);comment:最后登录IP"`
  34. Remark string `json:"remark" gorm:"type:varchar(255);comment:备注"`
  35. ContinuousSignDays int `json:"continuousSignDays" gorm:"default:0;comment:连续签到天数"`
  36. TotalSignDays int `json:"totalSignDays" gorm:"default:0;comment:累计签到天数"`
  37. TotalIncome float64 `json:"totalIncome" gorm:"type:decimal(18,2);default:0.00;comment:累计收益"`
  38. }
  39. func (*DtUser) TableName() string {
  40. return "dt_user"
  41. }
  42. func (*DtUser) Comment() string {
  43. return "用户表"
  44. }
  45. func NewDtUser() *DtUser {
  46. return &DtUser{}
  47. }