model.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. package model
  2. // OriginPerm origin token.
  3. type OriginPerm struct {
  4. Mid int64 `json:"mid"`
  5. AppID int32 `json:"appid"`
  6. AppSubID int32 `json:"app_subid"`
  7. AccessToken string `json:"access_token"`
  8. RefreshToken string `json:"refresh_token"`
  9. CreateAt int64 `json:"create_at"`
  10. Expires int64 `json:"expires"`
  11. Ctime string `json:"ctime"`
  12. Mtime string `json:"mtime"`
  13. }
  14. // OriginAsoAccount origin aso account.
  15. type OriginAsoAccount struct {
  16. Mid int64 `json:"mid"`
  17. Uname string `json:"uname"`
  18. Mtime string `json:"modify_time"`
  19. }
  20. // OriginMember origin member.
  21. type OriginMember struct {
  22. Mid int64 `json:"mid"`
  23. Face string `json:"face"`
  24. Mtime string `json:"modify_time"`
  25. }
  26. // Info account info.
  27. type Info struct {
  28. Mid int64 `json:"mid"`
  29. Uname string `json:"uname"`
  30. Face string `json:"face"`
  31. Email string `json:"email"`
  32. Tel string `json:"tel"`
  33. }
  34. // Equals check info equals.
  35. func (m *Info) Equals(other *Info) bool {
  36. return m.Mid == other.Mid && m.Uname == other.Uname && m.Face == other.Face
  37. }
  38. // AsoAccount aso account.
  39. type AsoAccount struct {
  40. Mid int64 `json:"mid"`
  41. UserID string `json:"userid"`
  42. Uname string `json:"uname"`
  43. Pwd string `json:"pwd"`
  44. Salt string `json:"salt"`
  45. Email string `json:"email"`
  46. Tel string `json:"tel"`
  47. CountryID int64 `json:"country_id"`
  48. MobileVerified int8 `json:"mobile_verified"`
  49. Isleak int8 `json:"isleak"`
  50. Mtime string `json:"mtime"`
  51. }
  52. // Equals check perm equals, check all non primary key fields exclude create_at.
  53. func (m *Perm) Equals(other *Perm) bool {
  54. return m.Mid == other.Mid && m.AppID == other.AppID && m.AccessToken == other.AccessToken && m.RefreshToken == other.RefreshToken && m.AppSubID == other.AppSubID && m.Expires == other.Expires
  55. }