fix: gorm fields && syncUserinfo dubplicate insertion
This commit is contained in:
		@@ -5,7 +5,7 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type ClientCredential struct {
 | 
			
		||||
	request.Error
 | 
			
		||||
	AccessToken string `json:"access_token"`
 | 
			
		||||
	ExpiresIn   int32  `json:"expires_in"`
 | 
			
		||||
	request.Error `gorm:"-"`
 | 
			
		||||
	AccessToken   string `json:"access_token"`
 | 
			
		||||
	ExpiresIn     int32  `json:"expires_in"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,10 +5,10 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Token struct {
 | 
			
		||||
	request.Error
 | 
			
		||||
	AccessToken  string `json:"access_token"`  //获取到的凭证
 | 
			
		||||
	ExpiresIn    int32  `json:"expires_in"`    //凭证有效时间,单位:秒
 | 
			
		||||
	RefreshToken string `json:"refresh_token"` //有效期为30天,当失效之后,需要用户重新授
 | 
			
		||||
	OpenID       string `json:"openid"  gorm:"index"`
 | 
			
		||||
	Scope        string `json:"scope"`
 | 
			
		||||
	request.Error `gorm:"-"`
 | 
			
		||||
	AccessToken   string `json:"access_token"`  //获取到的凭证
 | 
			
		||||
	ExpiresIn     int32  `json:"expires_in"`    //凭证有效时间,单位:秒
 | 
			
		||||
	RefreshToken  string `json:"refresh_token"` //有效期为30天,当失效之后,需要用户重新授
 | 
			
		||||
	OpenID        string `json:"openid"  gorm:"index"`
 | 
			
		||||
	Scope         string `json:"scope"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,14 +5,14 @@ import (
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type Userinfo struct {
 | 
			
		||||
	request.Error
 | 
			
		||||
	OpenID     string   `json:"openid" gorm:"index"`
 | 
			
		||||
	NickName   string   `json:"nickname"`
 | 
			
		||||
	Sex        int32    `json:"sex"`
 | 
			
		||||
	Province   string   `json:"province"`
 | 
			
		||||
	City       string   `json:"city"`
 | 
			
		||||
	Country    string   `json:"country"`
 | 
			
		||||
	HeadImgURL string   `json:"headimgurl"`
 | 
			
		||||
	Privilege  []string `json:"privilege" gorm:"type:text[]"`
 | 
			
		||||
	UnionID    string   `json:"unionid"`
 | 
			
		||||
	request.Error `gorm:"-"`
 | 
			
		||||
	OpenID        string   `json:"openid" gorm:"index"`
 | 
			
		||||
	NickName      string   `json:"nickname"`
 | 
			
		||||
	Sex           int32    `json:"sex"`
 | 
			
		||||
	Province      string   `json:"province"`
 | 
			
		||||
	City          string   `json:"city"`
 | 
			
		||||
	Country       string   `json:"country"`
 | 
			
		||||
	HeadImgURL    string   `json:"headimgurl"`
 | 
			
		||||
	Privilege     []string `json:"privilege" gorm:"type:text[]"`
 | 
			
		||||
	UnionID       string   `json:"unionid"`
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user