42 lines
1.8 KiB
Go
42 lines
1.8 KiB
Go
// Package event define real time data evnet operation functions
|
|
package event
|
|
|
|
// EventRecord define struct for CIM event record
|
|
type EventRecord struct {
|
|
// 事件名称
|
|
EventName string `json:"event" bson:"event"`
|
|
// 事件唯一标识符
|
|
EventUUID string `json:"event_uuid" bson:"event_uuid"`
|
|
// 事件类型
|
|
Type int `json:"type" bson:"type"`
|
|
// 事件优先级 (0-9)
|
|
Priority int `json:"priority" bson:"priority"`
|
|
// 事件状态
|
|
Status int `json:"status" bson:"status"`
|
|
// 是否已持久化到数据库,由 eventRT 消费并落库后置为 true
|
|
IsPersisted bool `json:"is_persisted" bson:"is_persisted"`
|
|
// 可选模板参数
|
|
Category string `json:"category,omitempty" bson:"category,omitempty"`
|
|
// 毫秒级时间戳 (Unix epoch)
|
|
Timestamp int64 `json:"timestamp" bson:"timestamp"`
|
|
// 事件来源 (station, platform, msa)
|
|
From string `json:"from" bson:"from"`
|
|
// 事件场景描述对象 (如阈值、当前值)
|
|
Condition map[string]any `json:"condition" bson:"condition"`
|
|
// 与事件相关的订阅信息
|
|
AttachedSubscriptions []any `json:"attached_subscriptions" bson:"attached_subscriptions"`
|
|
// 事件分析结果对象
|
|
Result map[string]any `json:"result,omitempty" bson:"result,omitempty"`
|
|
// 操作历史记录 (CIM ActivityRecord)
|
|
Operations []OperationRecord `json:"operations" bson:"operations"`
|
|
// 子站告警原始数据 (CIM Alarm 数据)
|
|
Origin map[string]any `json:"origin,omitempty" bson:"origin,omitempty"`
|
|
}
|
|
|
|
// OperationRecord 描述对事件的操作记录,如确认(acknowledgment)等
|
|
type OperationRecord struct {
|
|
Action string `json:"action" bson:"action"` // 执行的动作,如 "acknowledgment"
|
|
Op string `json:"op" bson:"op"` // 操作人/操作账号标识
|
|
TS int64 `json:"ts" bson:"ts"` // 操作发生的毫秒时间戳
|
|
}
|