| | |
| | | logger.Debug("localConfig is wrong!!!") |
| | | return |
| | | } |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit" |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | //根据人脸坐标扣出人脸小图 |
| | | t1 := time.Now() |
| | | cutFaceImgData := util.SubImg(*pI, int(rcFace.Left), int(rcFace.Top), int(rcFace.Right), int(rcFace.Bottom)) |
| | |
| | | feature = fea |
| | | } |
| | | if personPicUrl != "" && feature != "" { |
| | | var dbpApi dbapi.DbPersonApi |
| | | b,d := dbpApi.JoinDbTable(reqBody.TableIds, feature, personPicUrl) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success,d) |
| | | return |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,"加入失败") |
| | | return |
| | | //将这张抓拍的照片下载下来上传到collection=persistent的集合中,防止被清理掉 |
| | | picB, e3 := util.DownLoad("http://" + personPicUrl) |
| | | if e3 == nil { |
| | | var weedfsUri = "http://"+localConf.WebPicIp+":"+strconv.Itoa(int(localConf.WebPicPort))+"/submit?collection=persistent" |
| | | newPersonPicUrl, e4 := WeedFSClient.UploadFile(weedfsUri, "capturePerson", picB) |
| | | if e4 == nil { |
| | | var dbpApi dbapi.DbPersonApi |
| | | b,d := dbpApi.JoinDbTable(reqBody.TableIds, feature, newPersonPicUrl) |
| | | if b { |
| | | util.ResponseFormat(c,code.Success,d) |
| | | return |
| | | } else { |
| | | util.ResponseFormat(c,code.ComError,"加入失败") |
| | | return |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | util.ResponseFormat(c,code.ComError,"加入失败") |