From d22ebc2f716bcea4ff88b4fc8df389b872c6acb3 Mon Sep 17 00:00:00 2001
From: panlei <2799247126@qq.com>
Date: 星期一, 18 十一月 2019 20:55:01 +0800
Subject: [PATCH] 该配置
---
insertdata/config.go | 5 +----
insertdata/insertDataToEs.go | 7 +++----
cache/cache.go | 8 ++++----
3 files changed, 8 insertions(+), 12 deletions(-)
diff --git a/cache/cache.go b/cache/cache.go
index 4906057..bb844ca 100644
--- a/cache/cache.go
+++ b/cache/cache.go
@@ -59,7 +59,7 @@
initSoData()
- //initDictionary() // 鍒濆鍖栧瓧鍏�
+ initDictionary() // 鍒濆鍖栧瓧鍏�
initChan <- true
}
@@ -141,9 +141,9 @@
var api dbapi.DicApi
flag, dics := api.FindByType("")
if flag {
- for key, dics1 := range dics.(map[string]interface{}) {
- for _,dic := range dics1.([]interface{}) {
- cMap.Set(PREFIX_DIC+key+dic.(Dic).value, dic)
+ for key, dics1 := range dics.(map[string][]Dic) {
+ for _,dic := range dics1 {
+ cMap.Set(PREFIX_DIC+key+dic.value, dic)
}
}
}
diff --git a/insertdata/config.go b/insertdata/config.go
index 64c6b67..e8cab1a 100644
--- a/insertdata/config.go
+++ b/insertdata/config.go
@@ -25,10 +25,7 @@
}
type esindexlist struct {
- VideoPersons index `mapstructure:"videopersons"`
- DbTables index `mapstructure:"dbtables"`
- Dbtablepersons index `mapstructure:"dbtablepersons"`
- Personaction index `mapstructure:"personaction"`
+ AIOcean index `mapstructure:"aiocean"`
}
type index struct {
IndexName string `mapstructure:"index"`
diff --git a/insertdata/insertDataToEs.go b/insertdata/insertDataToEs.go
index b03ad7e..4a14019 100644
--- a/insertdata/insertDataToEs.go
+++ b/insertdata/insertDataToEs.go
@@ -164,8 +164,7 @@
panic("閰嶇疆鏂囦欢涓嶅悎娉�")
}
weedfsUrl = "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/submit"
- videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.VideoPersons.IndexName + "/" + EsInfo.EsIndex.VideoPersons.IndexType
- personAction = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.Personaction.IndexName + "/" + EsInfo.EsIndex.Personaction.IndexType
+ videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.AIOcean.IndexName + "/" + EsInfo.EsIndex.AIOcean.IndexType
InsertFace(msg)
InsertYolo(msg)
InsertTarget(msg)
@@ -465,7 +464,7 @@
logger.Info("json parse error ", err)
return
}
- resp1, err2 := EsReq("POST", personAction, requstbody)
+ resp1, err2 := EsReq("POST", videoPersonUrl, requstbody)
if err2 != nil {
logger.Error("寰�ES鎻掑叆鏁版嵁澶辫触", err)
} else {
@@ -626,7 +625,7 @@
logger.Info("json parse error ", err)
return
}
- resp1, err2 := EsReq("POST", personAction, requstbody)
+ resp1, err2 := EsReq("POST", videoPersonUrl, requstbody)
if err2 != nil {
logger.Error("寰�ES鎻掑叆鏁版嵁澶辫触", err)
} else {
--
Gitblit v1.8.0