| | |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> addFace( FaceAddRequest param){ |
| | | log.info("【海康添加人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | log.info("【海康添加人脸信息】================开始====" ); |
| | | try { |
| | | String res = HKTools.addFace(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | TypeReference typeReference = new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康添加人脸信息"); |
| | | logResult(res,"海康添加人脸信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康添加人脸信息】================失败====:\n"+ e.getMessage()); |
| | |
| | | * @return |
| | | */ |
| | | public static BaseResponse<FaceAddOrEditesponse> editFace( FaceEditRequest param){ |
| | | log.info("【海康编辑人脸信息】================开始===="+JSONObject.toJSONString(param)); |
| | | log.info("【海康编辑人脸信息】================开始====" ); |
| | | String res =null; |
| | | try { |
| | | String res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | | res = HKTools.editFace(JSONObject.toJSONString(param)); |
| | | TypeReference typeReference = |
| | | new TypeReference< BaseResponse<FaceAddOrEditesponse>>(){}; |
| | | BaseResponse<FaceAddOrEditesponse> result = JSONObject.parseObject(res, typeReference.getType()); |
| | | logResult(result,"海康编辑人脸信息"); |
| | | logResult(res,"海康编辑人脸信息"); |
| | | return result; |
| | | }catch (Exception e){ |
| | | log.error("【海康编辑人脸信息】================失败====:\n"+ e.getMessage()); |
| | |
| | | log.error("【"+name+"】================失败====:\n"+ res); |
| | | } |
| | | } |
| | | private static void logResult(String res,String name) { |
| | | log.info("【"+name+"】================结果====\n"+res); |
| | | } |
| | | |
| | | } |
| | | |