重构增加模型枚举值定义
This commit is contained in:
@@ -14,21 +14,21 @@ const TableNameClient = "client"
|
||||
|
||||
// Client mapped from table <client>
|
||||
type Client struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:客户端ID" json:"id"` // 客户端ID
|
||||
ClientID string `gorm:"column:client_id;not null;comment:OAuth2客户端标识符" json:"client_id"` // OAuth2客户端标识符
|
||||
ClientSecret string `gorm:"column:client_secret;not null;comment:OAuth2客户端密钥" json:"client_secret"` // OAuth2客户端密钥
|
||||
RedirectURI string `gorm:"column:redirect_uri;comment:OAuth2 重定向URI" json:"redirect_uri"` // OAuth2 重定向URI
|
||||
GrantCode bool `gorm:"column:grant_code;not null;comment:允许授权码授予" json:"grant_code"` // 允许授权码授予
|
||||
GrantClient bool `gorm:"column:grant_client;not null;comment:允许客户端凭证授予" json:"grant_client"` // 允许客户端凭证授予
|
||||
GrantRefresh bool `gorm:"column:grant_refresh;not null;comment:允许刷新令牌授予" json:"grant_refresh"` // 允许刷新令牌授予
|
||||
GrantPassword bool `gorm:"column:grant_password;not null;comment:允许密码授予" json:"grant_password"` // 允许密码授予
|
||||
Spec int32 `gorm:"column:spec;not null;comment:安全规范:1-native,2-browser,3-web" json:"spec"` // 安全规范:1-native,2-browser,3-web
|
||||
Name string `gorm:"column:name;not null;comment:名称" json:"name"` // 名称
|
||||
Icon string `gorm:"column:icon;comment:图标URL" json:"icon"` // 图标URL
|
||||
Status int32 `gorm:"column:status;not null;default:1;comment:状态:0-禁用,1-正常" json:"status"` // 状态:0-禁用,1-正常
|
||||
CreatedAt core.LocalDateTime `gorm:"column:created_at;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt core.LocalDateTime `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除时间" json:"deleted_at"` // 删除时间
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:客户端ID" json:"id"` // 客户端ID
|
||||
ClientID string `gorm:"column:client_id;not null;comment:OAuth2客户端标识符" json:"client_id"` // OAuth2客户端标识符
|
||||
ClientSecret string `gorm:"column:client_secret;not null;comment:OAuth2客户端密钥" json:"client_secret"` // OAuth2客户端密钥
|
||||
RedirectURI string `gorm:"column:redirect_uri;comment:OAuth2 重定向URI" json:"redirect_uri"` // OAuth2 重定向URI
|
||||
GrantCode bool `gorm:"column:grant_code;not null;comment:允许授权码授予" json:"grant_code"` // 允许授权码授予
|
||||
GrantClient bool `gorm:"column:grant_client;not null;comment:允许客户端凭证授予" json:"grant_client"` // 允许客户端凭证授予
|
||||
GrantRefresh bool `gorm:"column:grant_refresh;not null;comment:允许刷新令牌授予" json:"grant_refresh"` // 允许刷新令牌授予
|
||||
GrantPassword bool `gorm:"column:grant_password;not null;comment:允许密码授予" json:"grant_password"` // 允许密码授予
|
||||
Spec int32 `gorm:"column:spec;not null;comment:安全规范:1-native,2-browser,3-web,4-trusted" json:"spec"` // 安全规范:1-native,2-browser,3-web,4-trusted
|
||||
Name string `gorm:"column:name;not null;comment:名称" json:"name"` // 名称
|
||||
Icon string `gorm:"column:icon;comment:图标URL" json:"icon"` // 图标URL
|
||||
Status int32 `gorm:"column:status;not null;default:1;comment:状态:0-禁用,1-正常" json:"status"` // 状态:0-禁用,1-正常
|
||||
CreatedAt core.LocalDateTime `gorm:"column:created_at;default:CURRENT_TIMESTAMP;comment:创建时间" json:"created_at"` // 创建时间
|
||||
UpdatedAt core.LocalDateTime `gorm:"column:updated_at;default:CURRENT_TIMESTAMP;comment:更新时间" json:"updated_at"` // 更新时间
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at;comment:删除时间" json:"deleted_at"` // 删除时间
|
||||
}
|
||||
|
||||
// TableName Client's table name
|
||||
|
||||
@@ -10,17 +10,17 @@ const TableNameLogsRequest = "logs_request"
|
||||
|
||||
// LogsRequest mapped from table <logs_request>
|
||||
type LogsRequest struct {
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:访问日志ID" json:"id"` // 访问日志ID
|
||||
Identity int32 `gorm:"column:identity;comment:访客身份:0-游客,1-用户,2-服务,3-管理员" json:"identity"` // 访客身份:0-游客,1-用户,2-服务,3-管理员
|
||||
Visitor int32 `gorm:"column:visitor;comment:访客ID" json:"visitor"` // 访客ID
|
||||
IP string `gorm:"column:ip;not null;comment:IP地址" json:"ip"` // IP地址
|
||||
Ua string `gorm:"column:ua;comment:用户代理" json:"ua"` // 用户代理
|
||||
Method string `gorm:"column:method;not null;comment:请求方法" json:"method"` // 请求方法
|
||||
Path string `gorm:"column:path;not null;comment:请求路径" json:"path"` // 请求路径
|
||||
Latency string `gorm:"column:latency;comment:请求延迟" json:"latency"` // 请求延迟
|
||||
Status int32 `gorm:"column:status;not null;comment:响应状态码" json:"status"` // 响应状态码
|
||||
Error string `gorm:"column:error;comment:错误信息" json:"error"` // 错误信息
|
||||
Time core.LocalDateTime `gorm:"column:time;default:CURRENT_TIMESTAMP;comment:请求时间" json:"time"` // 请求时间
|
||||
ID int32 `gorm:"column:id;primaryKey;autoIncrement:true;comment:访问日志ID" json:"id"` // 访问日志ID
|
||||
Identity int32 `gorm:"column:identity;comment:访客身份:0-游客,1-用户,2-管理员,3-公共服务,4-安全服务,5-内部服务" json:"identity"` // 访客身份:0-游客,1-用户,2-管理员,3-公共服务,4-安全服务,5-内部服务
|
||||
Visitor int32 `gorm:"column:visitor;comment:访客ID" json:"visitor"` // 访客ID
|
||||
IP string `gorm:"column:ip;not null;comment:IP地址" json:"ip"` // IP地址
|
||||
Ua string `gorm:"column:ua;comment:用户代理" json:"ua"` // 用户代理
|
||||
Method string `gorm:"column:method;not null;comment:请求方法" json:"method"` // 请求方法
|
||||
Path string `gorm:"column:path;not null;comment:请求路径" json:"path"` // 请求路径
|
||||
Latency string `gorm:"column:latency;comment:请求延迟" json:"latency"` // 请求延迟
|
||||
Status int32 `gorm:"column:status;not null;comment:响应状态码" json:"status"` // 响应状态码
|
||||
Error string `gorm:"column:error;comment:错误信息" json:"error"` // 错误信息
|
||||
Time core.LocalDateTime `gorm:"column:time;default:CURRENT_TIMESTAMP;comment:请求时间" json:"time"` // 请求时间
|
||||
}
|
||||
|
||||
// TableName LogsRequest's table name
|
||||
|
||||
Reference in New Issue
Block a user