优化表结构,重构模型,重新实现基于白银网关的提取节点流程
This commit is contained in:
44
web/models/client.go
Normal file
44
web/models/client.go
Normal file
@@ -0,0 +1,44 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"platform/web/core"
|
||||
)
|
||||
|
||||
// Client 客户端表
|
||||
type Client struct {
|
||||
core.Model
|
||||
ClientID string `json:"client_id" gorm:"column:client_id"` // OAuth2客户端标识符
|
||||
ClientSecret string `json:"client_secret" gorm:"column:client_secret"` // OAuth2客户端密钥
|
||||
RedirectURI *string `json:"redirect_uri" gorm:"column:redirect_uri"` // OAuth2 重定向URI
|
||||
Spec ClientSpec `json:"spec" gorm:"column:spec"` // 安全规范:1-native,2-browser,3-web,4-api
|
||||
Name string `json:"name" gorm:"column:name"` // 名称
|
||||
Icon *string `json:"icon" gorm:"column:icon"` // 图标URL
|
||||
Status ClientStatus `json:"status" gorm:"column:status"` // 状态:0-禁用,1-正常
|
||||
Type ClientType `json:"type" gorm:"column:type"` // 类型:0-普通,1-官方
|
||||
}
|
||||
|
||||
// ClientSpec 客户端安全规范枚举
|
||||
type ClientSpec int
|
||||
|
||||
const (
|
||||
ClientSpecNative ClientSpec = 1 // native
|
||||
ClientSpecBrowser ClientSpec = 2 // browser
|
||||
ClientSpecWeb ClientSpec = 3 // web
|
||||
ClientSpecAPI ClientSpec = 4 // api
|
||||
)
|
||||
|
||||
// ClientStatus 客户端状态枚举
|
||||
type ClientStatus int
|
||||
|
||||
const (
|
||||
ClientStatusDisabled ClientStatus = 0 // 禁用
|
||||
ClientStatusEnabled ClientStatus = 1 // 正常
|
||||
)
|
||||
|
||||
// ClientType 客户端类型枚举
|
||||
type ClientType int
|
||||
|
||||
const (
|
||||
ClientTypeNormal ClientType = 0 // 普通
|
||||
ClientTypeOfficial ClientType = 1 // 官方
|
||||
)
|
||||
Reference in New Issue
Block a user