fix
This commit is contained in:
24
internal/models/resource_event_dedup.go
Normal file
24
internal/models/resource_event_dedup.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
// ResourceEventDedup 用于资源事件幂等去重。
|
||||
type ResourceEventDedup struct {
|
||||
ID uint `gorm:"primaryKey" json:"id"`
|
||||
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
|
||||
// EventID 为外部事件唯一标识。
|
||||
EventID string `gorm:"size:128;uniqueIndex" json:"event_id"`
|
||||
// EventTime 记录事件时间,便于排查重放问题。
|
||||
EventTime time.Time `json:"event_time"`
|
||||
// ResourceType/ResourceID 便于定位被操作资源。
|
||||
ResourceType string `gorm:"size:32;index" json:"resource_type"`
|
||||
ResourceID string `gorm:"size:128;index" json:"resource_id"`
|
||||
}
|
||||
|
||||
func (ResourceEventDedup) TableName() string {
|
||||
return "logs_resource_event_dedup"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user