You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
3.3 KiB
68 lines
3.3 KiB
6 months ago
|
// 自动生成模板Provider
|
||
|
package model
|
||
|
|
||
|
import "shop-api/global"
|
||
|
|
||
|
// 如果含有time.Time 请自行import time包
|
||
|
type Provider struct {
|
||
|
global.MG_MODEL
|
||
|
Owner string `gorm:"size:50;comment:用户所属" json:"owner" ` // 用户所属
|
||
|
Name string `gorm:"size:50;comment:提供者名称" json:"name" ` // 提供者名称
|
||
|
Category string `gorm:"size:50;comment:提供者分类" json:"category" ` // 提供者分类 1-社交 2-支付 3-媒体 4-其他
|
||
|
Code string `gorm:"size:50;comment:提供者代码" json:"code" ` // 提供者代码 google facebook twitter tiktok
|
||
|
Logo string `gorm:"size:50;comment:提供者logo" json:"logo" ` // 提供者logo
|
||
|
ClientID string `gorm:"size:50;comment:客户端ID" json:"client_id" ` // 客户端ID
|
||
|
ClientSecret string `gorm:"size:50;comment:客户端密钥" json:"client_secret" ` // 客户端密钥
|
||
|
Scope string `gorm:"size:50;comment:作用域" json:"scope" ` // 作用域
|
||
|
TokenType string `gorm:"size:50;comment:令牌类型" json:"token_type" ` // 令牌类型 Bearer urlencoded
|
||
|
RedirectURI string `gorm:"size:50;comment:重定向URI" json:"redirect_uri" ` // 重定向URI
|
||
|
RedirectURIByAnd string `gorm:"size:50;comment:重定向URI" json:"redirect_uri_by_and" ` // 重定向URI(安卓)
|
||
|
RedirectURIByIos string `gorm:"size:50;comment:重定向URI" json:"redirect_uri_by_ios" ` // 重定向URI(IOS)
|
||
|
AuthURI string `gorm:"size:50;comment:认证URI" json:"auth_uri" ` // 认证URI
|
||
|
TokenURI string `gorm:"size:50;comment:令牌URI" json:"token_uri" ` // 令牌URI
|
||
|
TokenCheckURI string `gorm:"size:50;comment:令牌校验URI" json:"token_check_uri" ` // 令牌校验URI
|
||
|
UserInfoURI string `gorm:"size:50;comment:用户信息URI" json:"user_info_uri" ` // 用户信息URI
|
||
|
}
|
||
|
|
||
|
type ClentProvider struct {
|
||
|
Web []Provider `json:"web"`
|
||
|
Android []Provider `json:"android"`
|
||
|
Ios []Provider `json:"ios"`
|
||
|
}
|
||
|
|
||
|
type ProviderSimple struct {
|
||
|
Name string `gorm:"size:50;comment:提供者名称" json:"name" ` // 提供者名称
|
||
|
Code string `gorm:"size:50;comment:提供者代码" json:"code" ` // 提供者代码 google facebook twitter tiktok
|
||
|
Logo string `gorm:"size:50;comment:提供者logo" json:"logo" ` // 提供者logo
|
||
|
}
|
||
|
|
||
|
type ProviderUser struct {
|
||
|
UserID string `gorm:"size:50;comment:用户ID" json:"user_id" ` // 用户ID
|
||
|
NickName string `gorm:"size:50;comment:昵称" json:"nick_name" ` // 昵称
|
||
|
Avatar string `gorm:"size:50;comment:头像" json:"avatar" ` // 头像
|
||
|
Email string `gorm:"size:50;comment:邮箱" json:"email" ` // 邮箱
|
||
|
Phone string `gorm:"size:50;comment:手机号" json:"phone" ` // 手机号
|
||
|
}
|
||
|
|
||
|
type FacebookUserInfo struct {
|
||
|
UnionId string `json:"id"`
|
||
|
UserName string `json:"name"`
|
||
|
Email string `json:"email"`
|
||
|
Picture struct {
|
||
|
Data struct {
|
||
|
URL string `json:"url"`
|
||
|
} `json:"data"`
|
||
|
} `json:"picture"`
|
||
|
}
|
||
|
|
||
|
type TiktokUser struct {
|
||
|
OpenID string `json:"open_id"`
|
||
|
UnionID string `json:"union_id"`
|
||
|
AvatarURL string `json:"avatar_url"`
|
||
|
DisplayName string `json:"display_name"`
|
||
|
}
|
||
|
|
||
|
func (Provider) TableName() string {
|
||
|
return "provider"
|
||
|
}
|