refactor: reorganize modules and add Linux build tooling
This commit is contained in:
26
module/base/passport/internal/models/passport_provider.go
Normal file
26
module/base/passport/internal/models/passport_provider.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"git.apinb.com/bsm-sdk/core/database"
|
||||
"git.apinb.com/bsm-sdk/core/types"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// 第三方登录配置表
|
||||
type PassportProvider struct {
|
||||
gorm.Model
|
||||
types.Std_Passport
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
Provider string `gorm:"type:varchar(20);index;not null" json:"provider"` // google, twitter, facebook, wechat, apple, custom
|
||||
ProviderID string `gorm:"type:varchar(255);index;not null" json:"provider_id"` // 第三方平台的用户ID
|
||||
Email string `gorm:"type:varchar(100)" json:"email"`
|
||||
AccessToken string `gorm:"type:text" json:"-"`
|
||||
RefreshToken string `gorm:"type:text" json:"-"`
|
||||
ExpiresAt time.Time `json:"expires_at"`
|
||||
}
|
||||
|
||||
func init() {
|
||||
database.AppendMigrate(&PassportProvider{})
|
||||
}
|
||||
Reference in New Issue
Block a user