From 3566c2630dc2ac33e03fb6df5ec2cd19e1625a68 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 27 九月 2019 15:49:55 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.1.14:10010/r/webserver

---
 controllers/es.go |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/controllers/es.go b/controllers/es.go
index 091c86b..d566366 100644
--- a/controllers/es.go
+++ b/controllers/es.go
@@ -1,12 +1,13 @@
 package controllers
 
 import (
-	"basic.com/dbapi.git"
+	"basic.com/valib/logger.git"
 	"fmt"
 	"github.com/gin-gonic/gin"
 	"math/rand"
 	"strconv"
 	"strings"
+	"webserver/cache"
 	"webserver/extend/code"
 	"webserver/extend/config"
 	"webserver/extend/esutil"
@@ -103,12 +104,15 @@
 	esSize := strconv.Itoa(webSize)
 	//浣跨敤es搴曞眰鏈哄埗澶勭悊鍒嗛〉
 	//璇锋眰澶�
-	url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
+	localConf, err2 := cache.GetServerInfo()
+	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