From 449c4b9a06eb4b2e8de37e4ac13c3dd8d424d43d Mon Sep 17 00:00:00 2001 From: liuxiaolong <736321739@qq.com> Date: 星期二, 22 十月 2019 16:55:51 +0800 Subject: [PATCH] update route --- controllers/es.go | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/controllers/es.go b/controllers/es.go index a2c591b..d566366 100644 --- a/controllers/es.go +++ b/controllers/es.go @@ -1,7 +1,6 @@ package controllers import ( - "basic.com/dbapi.git" "basic.com/valib/logger.git" "fmt" "github.com/gin-gonic/gin" @@ -106,16 +105,14 @@ //浣跨敤es搴曞眰鏈哄埗澶勭悊鍒嗛〉 //璇锋眰澶� 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)) + "/" + index + "/_search?search_type=dfs_query_then_fetch" - var setApi dbapi.SysSetApi - _, sysconf := setApi.GetServerInfo() - analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}}," + analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + localConf.ServerId + "\"}}," //璇锋眰浣� prama := "{\"from\":\"" + esFrom + "\",\"size\":\"" + esSize + "\"," + -- Gitblit v1.8.0