25 lines
1.1 KiB
Go
25 lines
1.1 KiB
Go
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"`
|
|
}
|