From b0500fee9c01e17c81b9293b244c8ed88dc9ca29 Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期五, 11 十月 2019 15:12:25 +0800 Subject: [PATCH] add swagger --- 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