package models import ( "time" ) // OperationLog 通用操作日志 type OperationLog 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"` Operation string `orm:"column(operation)" json:"operation"` Description string `orm:"column(description);null" json:"description"` OldValue string `orm:"column(old_value);type(longtext);null" json:"old_value"` NewValue string `orm:"column(new_value);type(longtext);null" json:"new_value"` 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"` RequestUrl string `orm:"column(request_url);null" json:"request_url"` Status int8 `orm:"column(status)" json:"status"` ErrorMessage string `orm:"column(error_message);type(text);null" json:"error_message"` Duration int `orm:"column(duration);null" json:"duration"` CreateTime time.Time `orm:"column(create_time);auto_now_add" json:"create_time"` } func (o *OperationLog) TableName() string { return "sys_operation_log" }