sunty
2020-08-20 c738ec5996011f51549d18dd2ff2417e509f1399
EsClient.go
@@ -575,6 +575,29 @@
   s["allSource"] = allSource
   return s, nil
}
//解析抓拍库人员结构
func PerSonAnalysis(preData []map[string]interface{}) (sources []map[string]interface{}, err error) {
   source := make(map[string]interface{}, 0)
   for _, key := range preData {
      info := key
      targetInfo := info["targetInfo"].([]interface{})[0].(map[string]interface{})
      source["personId"] = targetInfo["belongsTargetId"].(string)
      source["cameraId"] = info["cameraId"].(string)
      source["cameraName"] = info["cameraName"].(string)
      source["cameraAddr"] = info["cameraAddr"].(string)
      source["targetScore"] = int(targetInfo["targetScore"].(float64))
      source["personRect"] = targetInfo["targetLocation"].(map[string]interface{})
      source["startTime"] = info["picDate"].(string)
      pixMaxUrl := info["picMaxUrl"].([]interface{})
      source["startBackGroundPicUrl"] = pixMaxUrl[0]
      source["endTime"] = info["updateTime"].(string)
      source["endBackGroundPicUrl"] = pixMaxUrl[len(pixMaxUrl)-1]
      sources = append(sources, source)
   }
   return sources, nil
}
func Sourcelist(buf []byte) (sources []map[string]interface{}, err error) {