| | |
| | | } |
| | | |
| | | func InsertToEs(msg structure.ResultMsg) { |
| | | defer func() { |
| | | if err := recover(); err != nil { |
| | | logger.Error("es模块儿的异常捕获:", err) |
| | | } |
| | | }() |
| | | localConfig1, err := cache.GetServerInfo() |
| | | if err != nil { |
| | | panic("配置文件不合法") |
| | | } |
| | | weedfsUrl = "http://" + localConfig1.WebPicIp + ":" + strconv.Itoa(int(localConfig1.WebPicPort)) + "/submit" |
| | | videoPersonUrl = "http://" + localConfig1.AlarmIp + ":" + strconv.Itoa(int(localConfig1.AlarmPort)) + "/" + EsInfo.EsIndex.AIOcean.IndexName + "/" + EsInfo.EsIndex.AIOcean.IndexType+"?refresh=true" |
| | | serverIp = localConfig1.AlarmIp |
| | | serverPort = strconv.Itoa(int(localConfig1.AlarmPort)) |
| | | for k,results := range msg.RuleResult { |
| | | if results != nil && len(results.([]structure.Result)) > 0{ |
| | | switch k { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | // 往es中插入人脸类型数据 |
| | | func InsertFace(msg structure.ResultMsg,key string, results interface{}) { |
| | | logger.Info("往es插入抓拍数据") |