From 5d78b36e851a5862302f2e40c99a4477020c79bc Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期五, 20 九月 2019 13:46:52 +0800
Subject: [PATCH] 查找此人时先切图

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

diff --git a/controllers/monitoring.go b/controllers/monitoring.go
index eda4467..8586698 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"
@@ -41,12 +43,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