userThird.go 544 B

12345678910111213141516171819
  1. package model
  2. type UserThird struct {
  3. IdModel
  4. UserId uint ` json:"user_id" gorm:"not null;index"`
  5. OauthUser
  6. // UnionId string `json:"union_id" gorm:"not null;"`
  7. // OauthType string `json:"oauth_type" gorm:"not null;"`
  8. OauthType string `json:"oauth_type"`
  9. Op string `json:"op" gorm:"not null;"`
  10. TimeModel
  11. }
  12. func (u *UserThird) FromOauthUser(userId uint, oauthUser *OauthUser, oauthType string, op string) {
  13. u.UserId = userId
  14. u.OauthUser = *oauthUser
  15. u.OauthType = oauthType
  16. u.Op = op
  17. }