liuxiaolong
2020-06-05 7c811247ecf143e08c576986a884bedadc57dd66
controllers/monitoring.go
@@ -49,9 +49,9 @@
   }
   //请求头
   localConf, err2 := cache.GetServerInfo()
   if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
   if err2 != nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
      logger.Debug("localConfig is wrong!!!")
      util.ResponseFormat(c,code.ComError,"localConf wrong")
      util.ResponseFormat(c, code.ComError, "localConf wrong")
      return
   }
   url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
@@ -73,12 +73,12 @@
      linkTagInfoAnalyServerFilterStr +
      "{\"range\":{\"linkTagInfo.picDate\":{\"gte\":\"now+8h-15s\",\"lt\":\"now+8h\"}}}" +
      "]}}" +
      "]}}," +
      "],\"minimum_should_match\":1}}," +
      "\"sort\":[{\"picDate\":{\"order\":\"desc\"}}]," +
      "\"size\":\"1000\"," +
      "\"_source\":{\"includes\":[],\"excludes\":[\"*.feature\"]}}"
   logger.Debug("monitor param:",prama)
   logger.Debug("monitor url:",url)
   logger.Debug("monitor param:", prama)
   logger.Debug("monitor url:", url)
   tokenRes := esutil.GetEsDataReq(url, prama, true)
   /*   for _, value := range tokenRes["datalist"].([]interface{}) {
      if value.(map[string]interface{})["personId"] != nil {
@@ -88,5 +88,6 @@
         }
      }
   }*/
   util.ResponseFormat(c, code.Success, tokenRes)
   tmpAllDate := esutil.ResponseData(tokenRes)
   util.ResponseFormat(c, code.Success, tmpAllDate)
}