29 lines
1.2 KiB
Go
29 lines
1.2 KiB
Go
package models
|
|
|
|
import "time"
|
|
|
|
type AuditLog struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
TraceID string `gorm:"size:96;index" json:"trace_id"`
|
|
SourceService string `gorm:"size:64;index" json:"source_service"`
|
|
ActorID string `gorm:"size:128;index" json:"actor_id"`
|
|
ActorName string `gorm:"size:128" json:"actor_name"`
|
|
Action string `gorm:"size:128;index" json:"action"`
|
|
ObjectType string `gorm:"size:128;index" json:"object_type"`
|
|
ObjectID string `gorm:"size:128;index" json:"object_id"`
|
|
OperationRisk string `gorm:"size:32;index" json:"operation_risk"`
|
|
ApprovalID string `gorm:"size:128;index" json:"approval_id"`
|
|
RequestMethod string `gorm:"size:16" json:"request_method"`
|
|
RequestPath string `gorm:"size:512" json:"request_path"`
|
|
ClientIP string `gorm:"size:64" json:"client_ip"`
|
|
BeforeJSON string `gorm:"type:text" json:"before_json"`
|
|
AfterJSON string `gorm:"type:text" json:"after_json"`
|
|
Result string `gorm:"size:32;index" json:"result"`
|
|
ErrorMessage string `gorm:"type:text" json:"error_message"`
|
|
}
|
|
|
|
func (AuditLog) TableName() string {
|
|
return "logs_audit_logs"
|
|
}
|