diff --git a/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java index 483b077..5a01f8a 100644 --- a/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java +++ b/face-server/src/main/java/com/dkha/server/services/impl/CompareServiceImpl.java @@ -160,14 +160,31 @@ public class CompareServiceImpl implements ICompareService { private void validateSingleFaceImage(String image) { //人脸检测url //String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); - String faceSearchUrltest = 192.168.3.132:5000/message/mask; + + String faceSearchUrltest ="http://192.168.3.132:5000/message/mask"; //组装api请求数据 ReturnVO returnVO; - returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class); - if (returnVO.getCode() != 200) { - throw new DkException(returnVO.getMessage()); - } + returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class); + System.out.println(returnVO.getCode()+returnVO.getMessage()); + if (returnVO.getCode() != 200) { + throw new DkException(returnVO.getMessage()); + } //反序列化 + // 返回data格式{ + // "code": 200, + // "data": [ + // { + // "faceRect": { + // "h": 174, + // "w": 257, + // "x": 161, + // "y": 47 + // }, + // "url": "http://192.168.1.133:9000/middleware/456/1790226920.jpg" + // } + // ], + // "message": "检测到人脸" + //} List apiSearchFaceRectVOList = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference>() {}); if (UtilValidate.isEmpty(apiSearchFaceRectVOList)) { throw new DkException("当前上传中未检测到人脸,请重新上传");