package entity import ( "gitlab.wodcloud.com/smart-operation/so-operation-api/src/pkg/beagle/jsontime" ) // Alert 预警 type Alert struct { Id int `json:"id"` // 预警id AlertPoint string `json:"alert_point"` // 预警点:预警分类/预警规则名称 ClassParentName/AlertRulesName AlertRulesId string `json:"alert_rules_id"` // 告警规则id AlertRulesName string `json:"alert_rules_name"` // 告警规则名称 RiskLevel int `json:"risk_level"` // 风险等级,1:低风险,2:一般风险,3:较大风险,4:重大风险 AlertTime jsontime.Time `json:"alert_time"` // 预警时间 ClassId int `json:"class_id"` // 预警对象id(级联:预警分类/预警对象) ClassParentName string `json:"class_parent_name"` // 预警分类名称 TODO 该字段做关联存储或查询 ClassName string `json:"class_name"` // 预警对象名称 TODO 该字段做关联存储或查询 MetricConfigId string `json:"metric_config_id"` // 预警指标id MetricConfigName string `json:"metric_config_name"` // 预警指标名称 AlertRuleType string `json:"alert_rule_type"` // 预警规则类型id TODO 该字段做关联存储或查询 AlertRuleTypeName string `json:"alert_rule_type_name"` // 预警规则类型名称 TODO 该字段做关联存储或查询 CurrentValue float64 `json:"current_value"` // 当前报警值 AlertCondition AlertCondition `json:"alert_condition"` // 预警范围 NotificationCount int `json:"notification_count"` // 通知人数 PushCount int `json:"push_count"` // 推送次数 LastPushTime jsontime.Time `json:"last_push_time"` // 最近推送时间 Status int `json:"status"` // 状态,1:已恢复 2:未恢复 3:已关闭 PushRecords []PushRecord `json:"push_records"` // 推送记录列表 DisposedList []Disposed `json:"disposed_list"` // 处置列表 IsDisposed int `json:"is_disposed"` // 是否处置(工单管理),1:已处置,2:未处置 通过DisposedList逻辑处理回显 CloseRemark string `json:"close_remark"` // 关闭备注(预警关闭提醒) CloseUser string `json:"close_user"` // 关闭用户,预警关闭提醒 CloseTime jsontime.Time `json:"close_time"` // 关闭关闭时间,预警关闭提醒 DeferPush int `json:"defer_push"` // 延迟三天推送: 0:否 1:是 三天内将不再自动推送该告警信息给处置人员,可手动推送,但告警数据依然会出现 CreatedBy string `json:"created_by"` // 创建人 CreatedAt jsontime.Time `json:"created_at"` // 创建时间 UpdatedBy string `json:"updated_by"` // 更新人 UpdatedAt jsontime.Time `json:"updated_at"` // 更新时间 } type Disposed struct { IsDisposed int `json:"is_disposed"` // 是否处置(工单管理),1:已处置,2:未处置 DisposalContent string `json:"disposal_content"` // 处置内容(工单管理,结果反馈) DisposalUser string `json:"disposal_user"` // 处置人(工单管理,结果反馈) DisposalTime jsontime.Time `json:"disposal_time"` // 处置时间(工单管理,结果反馈) } type OpenSearchIds struct { Ids struct { Values []string `json:"values"` } `json:"ids"` } type PushRecord struct { Id int `json:"id" xorm:"'id' pk autoincr"` // 主键id(数组唯一标识) AlertId int `json:"alert_id" xorm:"alert_id"` // 告警id AlertRulesId string `json:"alert_rules_id" xorm:"'alert_rules_id'"` // 告警规则id RiskLevel int `json:"risk_level" xorm:"'risk_level'"` // 风险等级,1:低风险,2:一般风险,3:较大风险,4:重大风险 NotifyMethod []string `json:"notify_method" xorm:"notify_method"` // 预警通知方式 dingtalk sms SystemAccount string `json:"system_account" xorm:"system_account"` // 预警推送用户 PushTime jsontime.Time `json:"push_time" xorm:"'push_time'"` // 推送时间 PushType int `json:"push_type" xorm:"'push_type'"` // 推送类型,1:自动推送,2:手动推送 Status int `json:"status" xorm:"'status'"` // 推送状态,1:成功,2:失败 UserName string `json:"user_name" xorm:"user_name"` // 推送用户名称 Phone string `json:"phone" xorm:"phone"` // 推送手机号 CreatedBy string `json:"created_by" xorm:"'created_by'"` // 创建人 CreatedAt jsontime.Time `json:"created_at" xorm:"'created_at'"` // 创建时间 UpdatedBy string `json:"updated_by" xorm:"'updated_by'"` // 更新人 UpdatedAt jsontime.Time `json:"updated_at" xorm:"'updated_at'"` // 更新时间 }