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

---
 controllers/taglist.go |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/controllers/taglist.go b/controllers/taglist.go
index d897d74..cd863a3 100644
--- a/controllers/taglist.go
+++ b/controllers/taglist.go
@@ -2,8 +2,11 @@
 
 import (
 	"basic.com/dbapi.git"
+	"basic.com/valib/logger.git"
 	"encoding/json"
 	"fmt"
+	"strconv"
+	"webserver/cache"
 	"webserver/extend/code"
 	"webserver/extend/config"
 	"webserver/extend/esutil"
@@ -50,7 +53,12 @@
 //鍒ゆ柇搴曞簱鏄惁鏈夋暟鎹�
 func GetTotalFromDb(id string) (flag bool) {
 	flag = false
-	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 false
+	}
+	url := "http://" + localConf.AlarmIp + ":" + strconv.Itoa(int(localConf.AlarmPort)) +
 		"/" + config.EsInfo.EsIndex.VideoPersons.IndexName + "/_search"
 	prama := "{\"query\":{\"bool\":{\"filter\":[{\"term\":{\"baseInfo.tableId\":\"" + id + "\"}}]}},\"size\":0}"
 	buf, err := esutil.EsReq("POST", url, []byte(prama))

--
Gitblit v1.8.0