18 lines
632 B
Go
18 lines
632 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
// AccessLog 网站访问日志
|
|
type AccessLog struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
IP string `gorm:"size:45;index" json:"ip"`
|
|
Path string `gorm:"size:500;index" json:"path"`
|
|
Method string `gorm:"size:10" json:"method"`
|
|
UserAgent string `gorm:"size:500" json:"user_agent"`
|
|
Referer string `gorm:"size:500" json:"referer"`
|
|
Location string `gorm:"size:255" json:"location"` // IP 归属地
|
|
Status int `json:"status"`
|
|
Cost int `json:"cost"` // 耗时(毫秒)
|
|
CreatedAt time.Time `gorm:"index" json:"created_at"`
|
|
}
|