From 55a3ac7e5a2e2f3ae3c02c0d866926f454d5cfc6 Mon Sep 17 00:00:00 2001 From: coco1986509808 <1986509808@qq.com> Date: Thu, 30 Mar 2023 15:29:41 +0800 Subject: [PATCH] =?UTF-8?q?3.30=E6=8E=A5=E5=8F=A3=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=B0192.168.1.196=EF=BC=9A5001?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/dkha/common/enums/ApiUrlEnum.java | 4 ++-- .../server/services/impl/CompareServiceImpl.java | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java b/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java index 5a9aaa7..c3d075b 100644 --- a/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java +++ b/face-common/src/main/java/com/dkha/common/enums/ApiUrlEnum.java @@ -20,14 +20,14 @@ public enum ApiUrlEnum { //口罩人脸识别项目所用的接口地址重新定义 FACE_SEARCH("message/mask", "人脸检测"), FACE_COMPARISON("compare", "一比一比对"), +FACELIB_POSTURL("dkha/faceLib", "添加人脸"), +FACELIST_POSTURL("dkha/face", "添加人像"), ALARM_POSTURL("alarm", "查看单个报警任务(业务场景卡口)post"), ALARMS_POSTURL("alarms", "查看批量报警post"), ALARMS_STATUS("taskStatus", "视频任务状态查询"), FACELIBS_POSTURL("faceLibs", "查看人脸"), - FACELIB_POSTURL("faceLib", "添加人脸"), - FACELIST_POSTURL("face", "添加人像"), FACE_POSTURL("face", "添加人像"), TASK_POSTURL("control", "任务操作"), TASK_VEDIO_POSTURL("controlVedio", "视频比对任务操作"), 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 bc64283..57d2ff0 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 @@ -108,13 +108,13 @@ public class CompareServiceImpl implements ICompareService { throw new DkException("请上传1:1比对的两张图片"); } - //String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); - String apiUrltest = "http://192.168.1.196:5001/compare"; + String apiUrl = apiServerPrefix + ApiUrlEnum.FACE_COMPARISON.getUrl(); + // String apiUrltest = "http://192.168.1.196:5001/compare"; FaceCompareVO faceCompareVO = new FaceCompareVO(); faceCompareVO.setImage1(compareRequestVo.getUrlList().get(0)); faceCompareVO.setImage2(compareRequestVo.getUrlList().get(1)); System.out.println(); - ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrltest, faceCompareVO, ReturnVO.class); + ReturnVO returnVO = (ReturnVO)httpUtil.post(apiUrl, faceCompareVO, ReturnVO.class); ApiFaceOneSearchReturnFaceVO apiFaceOneSearchReturnFaceVO = JsonUtil.string2Obj(JsonUtil.obj2String(returnVO.getData()), new TypeReference() {}); //返回结果集 OneToOneResultVo oneToOneResultVo = new OneToOneResultVo(); @@ -168,10 +168,10 @@ public class CompareServiceImpl implements ICompareService { */ private void validateSingleFaceImage(String image) { //人脸检测url - //String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); - String faceSearchUrltest ="http://192.168.3.135:5000/message/mask"; + String faceSearchUrl = apiRequestPrefix + ApiUrlEnum.FACE_SEARCH.getUrl(); + //String faceSearchUrltest ="http://192.168.3.135:5000/message/mask"; //组装api请求数据 - ReturnVO returnVO = (ReturnVO) httpUtil.post(faceSearchUrltest + "?url=" + image, null, ReturnVO.class); + ReturnVO returnVO = (ReturnVO) httpUtil.post(faceSearchUrl + "?url=" + image, null, ReturnVO.class); System.out.println(returnVO.getCode()+returnVO.getMessage()); if (returnVO.getCode() != 200) { throw new DkException(returnVO.getMessage());