添加人像库处理算法端返回结果代码调整

master
GoblinsWang 2023-05-09 14:30:35 +08:00
parent 0a4da40b6b
commit bd9f27dc09
1 changed files with 4 additions and 4 deletions

View File

@ -73,18 +73,18 @@ public class FaceLibraryServiceImpl extends ServiceImpl<FaceLibraryMapper, FaceL
FaceLibraryVO faceLibraryVO = new FaceLibraryVO();
faceLibraryVO.setLibraryId(faceLibrary.getIdFactory().toString());
faceLibraryVO.setName(faceLibrary.getFactoryName());
String result = (String) httpUtil.post(link + ApiUrlEnum.FACELIB_POSTURL.getUrl(), faceLibraryVO, String.class);
if(! result.equals("ok")){
throw new DkException("算法端新增库失败");
ApiVO faceLibrary1 = (ApiVO) httpUtil.post(link + ApiUrlEnum.FACELIB_POSTURL.getUrl(), faceLibraryVO, ApiVO.class);
if (! faceLibrary1.getCode().equals(200)) {
throw new DkException("算法端新增库失败, " + faceLibrary1.getMessage());
}
int insert = faceLibraryMapper.insert(faceLibrary);
if(insert<0){
throw new DkException("MySQL新增库失败");
}
return faceLibrary;
}catch (Exception e){
throw new DkException("新增库失败"+e.getMessage());
}
return faceLibrary;
}
@Override