package models import ( "time" ) // AccessLog 访问日志(针对读取/浏览/访问行为) type AccessLog struct { Id int64 `orm:"auto" json:"id"` TenantId int `orm:"column(tenant_id)" json:"tenant_id"` UserId int `orm:"column(user_id)" json:"user_id"` Username string `orm:"column(username)" json:"username"` Module string `orm:"column(module)" json:"module"` ResourceType string `orm:"column(resource_type)" json:"resource_type"` ResourceId *int `orm:"column(resource_id);null" json:"resource_id"` RequestUrl string `orm:"column(request_url);null" json:"request_url"` QueryString string `orm:"column(query_string);type(text);null" json:"query_string"` IpAddress string `orm:"column(ip_address);null" json:"ip_address"` UserAgent string `orm:"column(user_agent);null" json:"user_agent"` RequestMethod string `orm:"column(request_method);null" json:"request_method"` Duration int `orm:"column(duration);null" json:"duration"` CreateTime time.Time `orm:"column(create_time);auto_now_add" json:"create_time"` } func (a *AccessLog) TableName() string { return "sys_access_log" }