代码推送
This commit is contained in:
17
internal/model/access_log.go
Normal file
17
internal/model/access_log.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user