| | |
| | | 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) { |