feat: backend core - auth, user, role, permission, device, webhook, monitoring, cache, repository, service, middleware, API handlers
This commit is contained in:
23
internal/domain/operation_log.go
Normal file
23
internal/domain/operation_log.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package domain
|
||||
|
||||
import "time"
|
||||
|
||||
// OperationLog 操作日志
|
||||
type OperationLog struct {
|
||||
ID int64 `gorm:"primaryKey;autoIncrement" json:"id"`
|
||||
UserID *int64 `gorm:"index" json:"user_id,omitempty"`
|
||||
OperationType string `gorm:"type:varchar(50)" json:"operation_type"`
|
||||
OperationName string `gorm:"type:varchar(100)" json:"operation_name"`
|
||||
RequestMethod string `gorm:"type:varchar(10)" json:"request_method"`
|
||||
RequestPath string `gorm:"type:varchar(200)" json:"request_path"`
|
||||
RequestParams string `gorm:"type:text" json:"request_params"`
|
||||
ResponseStatus int `json:"response_status"`
|
||||
IP string `gorm:"type:varchar(50)" json:"ip"`
|
||||
UserAgent string `gorm:"type:varchar(500)" json:"user_agent"`
|
||||
CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
|
||||
}
|
||||
|
||||
// TableName 指定表名
|
||||
func (OperationLog) TableName() string {
|
||||
return "operation_logs"
|
||||
}
|
||||
Reference in New Issue
Block a user