数据 输入输出 处理
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB

package models
import "time"
type EsAlarmResp struct {
Took int `json:"took"`
TimedOut bool `json:"timed_out"`
Shards struct {
Total int `json:"total"`
Successful int `json:"successful"`
Skipped int `json:"skipped"`
Failed int `json:"failed"`
} `json:"_shards"`
Hits struct {
Total int `json:"total"`
MaxScore float64 `json:"max_score"`
Hits []HitAlarm `json:"hits"`
} `json:"hits"`
}
type HitAlarm struct {
Index string `json:"_index"`
Type string `json:"_type"`
Id string `json:"_id"`
Score float64 `json:"_score"`
Source EsAlarm `json:"_source"`
}
type EsAlarm struct {
StartTime time.Time `json:"start_time"`
AlarmTypeCode string `json:"alarm_type_code"`
State int `json:"state"` //0 新,1次数,2等级提升,3自动恢复,
AlarmCount int `json:"alarm_count"`
AlarmTypeId int `json:"alarm_type_id"`
EndTime time.Time `json:"end_time"`
StructureId int `json:"structure_id"`
SourceTypeId int `json:"source_type_id"`
AlarmContent string `json:"alarm_content"`
SourceName string `json:"source_name"`
SourceId string `json:"source_id"`
InitialLevel int `json:"initial_level"`
CurrentLevel int `json:"current_level"`
Detail string `json:"detail"`
AlarmCode string `json:"alarm_code"`
IsTriggerPart bool `json:"isTriggerPart"`
}