|
|
@ -208,17 +208,17 @@ func (the *ESHelper) SearchThemeData(index string, queryBody string) ([]models.E |
|
|
|
return themes, err |
|
|
|
} |
|
|
|
|
|
|
|
func (the *ESHelper) SearchAlarmThemeData(index string, queryBody string) ([]string, error) { |
|
|
|
var sensorNames []string |
|
|
|
func (the *ESHelper) SearchAlarmThemeData(index string, queryBody string) ([]models.EsAlarmTheme, error) { |
|
|
|
var sensors []models.EsAlarmTheme |
|
|
|
themesResp, err := the.searchAlarmThemes(index, queryBody) |
|
|
|
|
|
|
|
var sensorName string |
|
|
|
var sensor models.EsAlarmTheme |
|
|
|
for _, themesResptheme := range themesResp.Hits.Hits { |
|
|
|
sensorName = themesResptheme.Source.SensorName |
|
|
|
sensorNames = append(sensorNames, sensorName) |
|
|
|
sensor = themesResptheme.Source |
|
|
|
sensors = append(sensors, sensor) |
|
|
|
} |
|
|
|
|
|
|
|
return sensorNames, err |
|
|
|
return sensors, err |
|
|
|
} |
|
|
|
|
|
|
|
func (the *ESHelper) BulkWrite(index, reqBody string) { |
|
|
|