user.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. package entity
  2. import "gopkg.in/guregu/null.v3"
  3. type User struct {
  4. Id int64 `db:"id"` //编号:w
  5. Gender int `db:"gender"` //性别
  6. Mobile string `db:"mobile"` //手机号
  7. Name string `db:"name"` //昵称
  8. Age int `db:"age"` //真实姓名
  9. Password string `db:"password" json:"-"` //用户密码
  10. PasswordSalt string `db:"password_salt" json:"-"` //密码盐值
  11. Status int `db:"status"` //用户状态
  12. CreatedAt string `db:"created_at"` //创建日期
  13. Extra string `db:"extra"` //普通账户时按需存储,或存储第三方账户信息
  14. AccountType uint `db:"account_type"` //账户类型
  15. Avatar string `db:"avatar"`
  16. IsAcceptProto string `db:"is_accept_up"`
  17. IsNew bool `json:"is_new"`
  18. Height int `db:"height"` //身高
  19. Weight int `db:"weight"` //体重
  20. BirthDay string `db:"birthday"` //生日
  21. Hobby string `db:"hobby"` //喜好
  22. }
  23. type UserDB struct {
  24. Id int64 `db:"id"` //编号:w
  25. Gender null.Int `db:"gender"` //性别
  26. Mobile string `db:"mobile"` //手机号
  27. Name null.String `db:"name"` //昵称
  28. Age null.Int `db:"age"` //真实姓名
  29. Password string `db:"password" json:"-"` //用户密码
  30. PasswordSalt string `db:"password_salt" json:"-"` //密码盐值
  31. Status int `db:"status"` //用户状态
  32. CreatedAt string `db:"created_at"` //创建日期
  33. Extra null.String `db:"extra"`
  34. AccountType uint `db:"account_type"`
  35. Avatar string `db:"avatar"`
  36. IsAcceptProto string `db:"is_accept_up"`
  37. IsNew bool `json:"is_new"`
  38. }