优化表结构,重构模型,重新实现基于白银网关的提取节点流程
This commit is contained in:
24
web/models/logs_request.go
Normal file
24
web/models/logs_request.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"platform/web/globals/orm"
|
||||
"time"
|
||||
)
|
||||
|
||||
// LogsRequest 访问日志表
|
||||
type LogsRequest struct {
|
||||
ID int32 `json:"id" gorm:"column:id"` // 访问日志ID
|
||||
IP orm.Inet `json:"ip" gorm:"column:ip;not null"` // IP地址
|
||||
UA string `json:"ua" gorm:"column:ua"` // 用户代理
|
||||
UserID *int32 `json:"user_id" gorm:"column:user_id"` // 用户ID
|
||||
ClientID *int32 `json:"client_id" gorm:"column:client_id"` // 客户端ID
|
||||
Method string `json:"method" gorm:"column:method"` // 请求方法
|
||||
Path string `json:"path" gorm:"column:path"` // 请求路径
|
||||
Status int16 `json:"status" gorm:"column:status"` // 响应状态码
|
||||
Error *string `json:"error" gorm:"column:error"` // 错误信息
|
||||
Time time.Time `json:"time" gorm:"column:time"` // 请求时间
|
||||
Latency string `json:"latency" gorm:"column:latency"` // 请求延迟
|
||||
|
||||
User *User `json:"user" gorm:"foreignKey:UserID"`
|
||||
Client *Client `json:"client" gorm:"foreignKey:ClientID"`
|
||||
}
|
||||
Reference in New Issue
Block a user