2026-07-27 00:18:42 +08:00
|
|
|
|
package models
|
|
|
|
|
|
|
|
|
|
|
|
import "git.apinb.com/bsm-sdk/core/database"
|
|
|
|
|
|
|
2026-07-27 14:28:23 +08:00
|
|
|
|
// AuditOperationLog 对应 audit_operation_log,保存不可变操作审计。
|
|
|
|
|
|
type AuditOperationLog struct {
|
2026-07-27 12:02:08 +08:00
|
|
|
|
Entity // 公共实体字段
|
|
|
|
|
|
OperatorIdentity string `gorm:"column:operator_identity;type:varchar(36);not null;index" json:"operator_identity"` // operator_identity 业务字段
|
|
|
|
|
|
Action string `gorm:"column:action;type:varchar(64);not null" json:"action"` // action 业务字段
|
|
|
|
|
|
ObjectType string `gorm:"column:object_type;type:varchar(64);not null" json:"object_type"` // object_type 业务字段
|
|
|
|
|
|
ObjectIdentity string `gorm:"column:object_identity;type:varchar(36);not null;index" json:"object_identity"` // object_identity 业务字段
|
|
|
|
|
|
BeforeData string `gorm:"column:before_data;type:jsonb;not null;default:'{}'" json:"before_data"` // before_data 业务字段
|
|
|
|
|
|
AfterData string `gorm:"column:after_data;type:jsonb;not null;default:'{}'" json:"after_data"` // after_data 业务字段
|
2026-07-27 00:18:42 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-07-27 14:28:23 +08:00
|
|
|
|
func init() { database.AppendMigrate(&AuditOperationLog{}) }
|
|
|
|
|
|
func (table *AuditOperationLog) TableName() string { return "audit_operation_log" }
|