| | |
| | | |
| | | initSoData() |
| | | |
| | | //initDictionary() // 初始化字典 |
| | | initDictionary() // 初始化字典 |
| | | |
| | | initChan <- true |
| | | } |
| | |
| | | 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) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | 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"` |
| | |
| | | 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) |
| | |
| | | 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 { |
| | |
| | | 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 { |