user.go 1.8 KB

12345678910111213141516171819202122232425262728293031323334
  1. package entity
  2. // 用户基础信息表
  3. type User struct {
  4. MysqlFullModel
  5. Uid string `json:"uid" gorm:"index;type:varchar(64);comment:交易所ID:;"`
  6. OpenId string `json:"openId" gorm:"type:VARCHAR(64);comment:平台OPEN_ID"`
  7. Code string `json:"code" gorm:"type:VARCHAR(32);comment:平台邀请码"`
  8. RefCode string `json:"refCode" gorm:"index;type:VARCHAR(32);comment:平台上级邀请码"`
  9. ParentId int64 `json:"parentId" gorm:"type:bigint;default:0;column:parent_id;comment:上级ID"`
  10. ParentUid string `json:"parentUid" gorm:"index;type:varchar(64);default:'';comment:上级交易所ID"`
  11. ParentIds []int64 `json:"parentIds" gorm:"serializer:json;type:json;column:parent_ids;comment:上级ID路径,使用json查询"`
  12. Enable bool `json:"enable" gorm:"type:tinyint;default:0;comment:账户是否有效 1=有效 0=无效"`
  13. LockWithdraw bool `json:"lockWithdraw" gorm:"type:tinyint;default:0;comment:锁定提现 0=未锁定 1=锁定"`
  14. IsWhite bool `json:"isWhite" gorm:"type:tinyint;default:0;comment: 1=白名单 0=正常用户"`
  15. IsReinvestment bool `json:"isReinvestment" gorm:"default:0;comment:是否开启复投"`
  16. LastLoginTime int64 `json:"lastLoginTime" gorm:"comment:最近一次登陆时间"`
  17. LastLoginIp string `json:"lastLoginIp" gorm:"type:VARCHAR(200);comment:最后登陆IP"`
  18. LastLoginRemoteIp string `json:"lastLoginRemoteIp" gorm:"type:VARCHAR(200);comment:最后登陆RemoteIP"`
  19. Remark string `json:"remark" gorm:"type:VARCHAR(200);comment:备注信息"`
  20. }
  21. func (*User) TableName() string {
  22. return ModelPrefix + "user"
  23. }
  24. func (*User) Comment() string {
  25. return "用户基础信息"
  26. }
  27. func NewUser() *User {
  28. return &User{}
  29. }