dt_user.go 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package daytask
  2. import (
  3. "time"
  4. )
  5. // DtUser 用户表
  6. type DtUser struct {
  7. Id int64 `json:"id" gorm:"column:id;type:bigint;primarykey;comment:用户ID"`
  8. Uid string `json:"uid" gorm:"column:uid;type:varchar(32);not null;uniqueIndex:uk_uid;comment:用户UID"`
  9. Phone string `json:"phone" gorm:"column:phone;type:varchar(32);not null;uniqueIndex:uk_phone;comment:手机号"`
  10. Password string `json:"-" gorm:"column:password;type:varchar(128);not null;comment:登录密码"`
  11. PayPassword string `json:"-" gorm:"column:pay_password;type:varchar(128);comment:支付密码"`
  12. Nickname string `json:"nickname" gorm:"column:nickname;type:varchar(64);comment:昵称"`
  13. Avatar string `json:"avatar" gorm:"column:avatar;type:varchar(255);comment:头像"`
  14. InviteCode string `json:"inviteCode" gorm:"column:invite_code;type:varchar(16);not null;uniqueIndex:uk_invite_code;comment:邀请码"`
  15. ParentId int64 `json:"parentId" gorm:"column:parent_id;type:bigint;default:0;index:idx_parent_id;comment:上级用户ID"`
  16. ParentUid string `json:"parentUid" gorm:"column:parent_uid;type:varchar(32);comment:上级用户UID"`
  17. LevelId int64 `json:"levelId" gorm:"column:level_id;type:bigint;default:1;index:idx_level_id;comment:用户等级ID"`
  18. Balance float64 `json:"balance" gorm:"column:balance;type:decimal(18,2);default:0.00;comment:账户余额(USDT)"`
  19. FrozenBalance float64 `json:"frozenBalance" gorm:"column:frozen_balance;type:decimal(18,2);default:0.00;comment:冻结余额"`
  20. TotalRecharge float64 `json:"totalRecharge" gorm:"column:total_recharge;type:decimal(18,2);default:0.00;comment:累计充值"`
  21. TotalWithdraw float64 `json:"totalWithdraw" gorm:"column:total_withdraw;type:decimal(18,2);default:0.00;comment:累计提现"`
  22. TotalTaskIncome float64 `json:"totalTaskIncome" gorm:"column:total_task_income;type:decimal(18,2);default:0.00;comment:累计任务收益"`
  23. TotalInviteIncome float64 `json:"totalInviteIncome" gorm:"column:total_invite_income;type:decimal(18,2);default:0.00;comment:累计推广收益"`
  24. TodayTaskCount int `json:"todayTaskCount" gorm:"column:today_task_count;type:int;default:0;comment:今日完成任务数"`
  25. TotalTaskCount int `json:"totalTaskCount" gorm:"column:total_task_count;type:int;default:0;comment:累计完成任务数"`
  26. DirectInviteCount int `json:"directInviteCount" gorm:"column:direct_invite_count;type:int;default:0;comment:直推人数"`
  27. TeamCount int `json:"teamCount" gorm:"column:team_count;type:int;default:0;comment:团队人数"`
  28. Status int8 `json:"status" gorm:"column:status;type:tinyint;default:1;comment:状态: 0=禁用 1=正常"`
  29. IsRealName int8 `json:"isRealName" gorm:"column:is_real_name;type:tinyint;default:0;comment:是否实名: 0=否 1=是"`
  30. RealName string `json:"realName" gorm:"column:real_name;type:varchar(64);comment:真实姓名"`
  31. IdCard string `json:"idCard" gorm:"column:id_card;type:varchar(64);comment:身份证号"`
  32. RegisterIp string `json:"registerIp" gorm:"column:register_ip;type:varchar(64);comment:注册IP"`
  33. RegisterDevice string `json:"registerDevice" gorm:"column:register_device;type:varchar(255);comment:注册设备"`
  34. LastLoginTime int64 `json:"lastLoginTime" gorm:"column:last_login_time;type:bigint;comment:最后登录时间"`
  35. LastLoginIp string `json:"lastLoginIp" gorm:"column:last_login_ip;type:varchar(64);comment:最后登录IP"`
  36. Gender int8 `json:"gender" gorm:"column:gender;type:tinyint;default:0;comment:性别: 0=未知 1=男 2=女"`
  37. Age int `json:"age" gorm:"column:age;type:int;default:0;comment:年龄"`
  38. Region string `json:"region" gorm:"column:region;type:varchar(128);comment:地区"`
  39. Remark string `json:"remark" gorm:"column:remark;type:varchar(255);comment:备注"`
  40. CreatedAt int64 `json:"createdAt" gorm:"column:created_at;type:bigint;autoCreateTime;comment:创建时间"`
  41. UpdatedAt int64 `json:"updatedAt" gorm:"column:updated_at;type:bigint;autoUpdateTime;comment:更新时间"`
  42. DeletedAt *time.Time `json:"deletedAt,omitempty" gorm:"column:deleted_at;type:datetime;index;comment:删除时间"`
  43. }
  44. func (*DtUser) TableName() string {
  45. return "dt_user"
  46. }
  47. func NewDtUser() *DtUser {
  48. return &DtUser{}
  49. }