up oauth re

This commit is contained in:
ljw
2024-11-05 09:48:02 +08:00
parent 4321a41cd7
commit daeae19194
9 changed files with 170 additions and 175 deletions

View File

@@ -6,20 +6,21 @@ import (
type UserThird struct {
IdModel
UserId uint ` json:"user_id" gorm:"not null;index"`
UserId uint `json:"user_id" gorm:"not null;index"`
OauthUser
// UnionId string `json:"union_id" gorm:"not null;"`
UnionId string `json:"union_id" gorm:"default:'';not null;"`
// OauthType string `json:"oauth_type" gorm:"not null;"`
OauthType string `json:"oauth_type"`
Op string `json:"op" gorm:"not null;"`
ThirdType string `json:"third_type" gorm:"default:'';not null;"` //deprecated
OauthType string `json:"oauth_type" gorm:"default:'';not null;"`
Op string `json:"op" gorm:"default:'';not null;"`
TimeModel
}
func (u *UserThird) FromOauthUser(userId uint, oauthUser *OauthUser, oauthType string, op string) {
u.UserId = userId
u.OauthUser = *oauthUser
u.OauthType = oauthType
u.Op = op
u.UserId = userId
u.OauthUser = *oauthUser
u.OauthType = oauthType
u.Op = op
// make sure email is lower case
u.Email = strings.ToLower(u.Email)
}
u.Email = strings.ToLower(u.Email)
}