From 718bcd41127a8c5c93a20ca6dfce6e5c5fcbc4e1 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 31 十月 2019 13:47:24 +0800
Subject: [PATCH] add gbCloud

---
 controllers/monitoring.go |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/controllers/monitoring.go b/controllers/monitoring.go
index eda4467..ccb3519 100644
--- a/controllers/monitoring.go
+++ b/controllers/monitoring.go
@@ -1,9 +1,11 @@
 package controllers
 
 import (
-	"basic.com/dbapi.git"
+	"basic.com/valib/logger.git"
 	"fmt"
+	"strconv"
 	"strings"
+	"webserver/cache"
 
 	"github.com/gin-gonic/gin"
 	"webserver/extend/code"
@@ -12,6 +14,7 @@
 	"webserver/extend/util"
 )
 
+// @Security ApiKeyAuth
 // @Summary 瀹炴椂鐩戞帶
 // @Description 瀹炴椂鐩戞帶姣斿鏁版嵁
 // @Accept  json
@@ -41,12 +44,16 @@
 		taskIdStr = "{\"terms\":{\"taskId\":[\"" + esTaskId + "\"]}},"
 	}
 	//璇锋眰澶�
-	url := "http://" + config.EsInfo.Masterip + ":" + config.EsInfo.Httpport +
+	localConf, err2 := cache.GetServerInfo()
+	if err2 !=nil || localConf.AlarmIp == "" || localConf.ServerId == "" {
+		logger.Debug("localConfig is wrong!!!")
+		util.ResponseFormat(c,code.ComError,"localConf wrong")
+		return
+	}
+	url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
 		"/" + index + "/_search"
 
-	var setApi dbapi.SysSetApi
-	_, sysconf := setApi.GetServerInfo()
-	analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + sysconf.ServerId + "\"}},"
+	analyServerFilterStr := "{\"term\":{\"analyServerId\":\"" + localConf.ServerId + "\"}},"
 
 	prama := "{\"query\":{\"bool\":{\"filter\":[" +
 		cameraIdStr +

--
Gitblit v1.8.0