panlei
2019-09-24 dd0f12730e13b91f25fac58ae70855d4fa7265a4
insertdata/insertDataToEs.go
@@ -29,11 +29,11 @@
   DbTablePersons string `yaml:"dbTablePersons"`
}
func InitInsertEs() {
   weedfsUrl = "http://"+WeedFs.Ip+":"+strconv.Itoa(WeedFs.UploadPort)+"/submit"
   videoPersonUrl = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.VideoPersons.IndexName+"/"+EsInfo.EsIndex.VideoPersons.IndexType
   personAction = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.Personaction.IndexName+"/"+EsInfo.EsIndex.Personaction.IndexType
}
//func InitInsertEs() {
//   weedfsUrl = "http://"+WeedFs.Ip+":"+strconv.Itoa(WeedFs.UploadPort)+"/submit"
//   videoPersonUrl = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.VideoPersons.IndexName+"/"+EsInfo.EsIndex.VideoPersons.IndexType
//   personAction = "http://"+EsInfo.Masterip+":"+EsInfo.Httpport+"/"+EsInfo.EsIndex.Personaction.IndexName+"/"+EsInfo.EsIndex.Personaction.IndexType
//}
// 人脸的数据结构
type PerVideoPicture struct {
@@ -140,6 +140,13 @@
         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.VideoPersons.IndexName+"/"+EsInfo.EsIndex.VideoPersons.IndexType
   personAction = "http://"+localConfig1.AlarmIp+":"+strconv.Itoa(int(localConfig1.AlarmPort))+"/"+EsInfo.EsIndex.Personaction.IndexName+"/"+EsInfo.EsIndex.Personaction.IndexType
   InsertFace(msg, "")
   // 如果标签中含有持续时间首次报警的timeLabel的话则不需要过人体追踪,不然就没的插入了
   fk := ruleserver.TrackOrNot(msg.RuleResult)
@@ -222,8 +229,8 @@
            if linkId != "" {
               linksId = linkId
            }
            logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10))
            logger.Info("人脸的分值:",face.Score)
            //logger.Info("人脸的id:",strconv.FormatUint(face.Id, 10))
            //logger.Info("人脸的分值:",face.Score)
            pervideo := PerVideoPicture{
               esDataId,
               msg.Cid,