liuxiaolong
2019-10-11 b0500fee9c01e17c81b9293b244c8ed88dc9ca29
service/EnableStatusControlService.go
@@ -1,7 +1,6 @@
package service
import (
   "basic.com/dbapi.git"
   "basic.com/valib/logger.git"
   "encoding/json"
   "fmt"
@@ -15,14 +14,13 @@
func GetVerificationData() []map[string]interface{} {
   localConf, err2 := cache.GetServerInfo()
   if err2 !=nil || localConf.AlarmIp == "" {
   if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
      logger.Debug("localConfig is wrong!!!")
      return nil
   }
   url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
      "/" + config.EsInfo.EsIndex.DbTables.IndexName + "/_search"
   var setApi dbapi.SysSetApi
   _, sysconf := setApi.GetServerInfo()
   jsonDSL := `{
   "query": {
      "bool": {
@@ -33,7 +31,7 @@
            },
            {
               "terms": {
                  "analyServerId": ["` + sysconf.ServerId + `",""]
                  "analyServerId": ["` + localConf.ServerId + `",""]
               }
            }
         ]
@@ -90,7 +88,7 @@
   }
   enable := strconv.Itoa(status)
   localConf, err2 := cache.GetServerInfo()
   if err2 !=nil || localConf.AlarmIp == "" {
   if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
      logger.Debug("localConfig is wrong!!!")
      return "localConf wrong"
   }