From 712ef81c6b8813a498a66cf61ffcd37e5c502c8c Mon Sep 17 00:00:00 2001
From: sunty <1172534965@qq.com>
Date: 星期五, 01 十一月 2019 13:45:30 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 service/EnableStatusControlService.go |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/service/EnableStatusControlService.go b/service/EnableStatusControlService.go
index 045f9b9..a0439b1 100644
--- a/service/EnableStatusControlService.go
+++ b/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"
 	}

--
Gitblit v1.8.0