zhangzengfei
2024-05-29 332fc6ad5edca596ecd23876aa9db7452b45f804
client/faces.go
@@ -12,6 +12,7 @@
const (
   FacesUrI = "/VIID/Faces"
   PersonsUrI = "/VIID/Persons"
)
func FaceCapture(msg []byte) int {
@@ -36,3 +37,27 @@
   logger.Debug("Post faces success.")
   return stat.StatusCode
}
func PersonCapture(msg []byte) int {
   if clientStatus != vo.StatusSuccess {
      return clientStatus
   }
   url := fmt.Sprintf("%s://%s:%s%s", config.ClientConf.Proto, config.ClientConf.ServerAddr, config.ClientConf.ServerPort, PersonsUrI)
   rsp, err := util.HttpPost(url, headers, msg)
   if err != nil {
      logger.Warn("Post person failed, %s", err.Error())
      return vo.StatusOtherError
   }
   var stat vo.ResponseStatus
   err = json.Unmarshal(rsp, &stat)
   if err != nil {
      logger.Warn("Post person response unmarshal failed, %s", err.Error())
      return vo.StatusOtherError
   }
   logger.Debug("Post person success.")
   return stat.StatusCode
}