mirror of
https://gitee.com/open-visual/face-search.git
synced 2025-07-10 19:37:01 +08:00
update:2.0.0版本,fix bug,当还没有任何数据的情况下,搜索数据会报错。
This commit is contained in:
parent
516f0a53c9
commit
2754ce7703
@ -115,11 +115,15 @@ public class FaceSearchServiceImpl extends BaseService implements FaceSearchServ
|
||||
}
|
||||
}
|
||||
//查询数据
|
||||
List<Map<String, Object>> faceList = faceDataMapper.getByFaceIds(collection.getFaceTable(), ValueUtil.getAllFaceColumnNames(collection), new ArrayList<>(faceIds));
|
||||
Set<String> sampleIds = faceList.stream().map(item -> MapUtils.getString(item, Constant.ColumnNameSampleId)).collect(Collectors.toSet());
|
||||
List<Map<String, Object>> sampleList = sampleDataMapper.getBySampleIds(collection.getSampleTable(), new ArrayList<>(sampleIds));
|
||||
Map<String, Map<String, Object>> faceMapping = ValueUtil.mapping(faceList, Constant.ColumnNameFaceId);
|
||||
Map<String, Map<String, Object>> sampleMapping = ValueUtil.mapping(sampleList, Constant.ColumnNameSampleId);
|
||||
Map<String, Map<String, Object>> faceMapping = new HashMap<>();
|
||||
Map<String, Map<String, Object>> sampleMapping = new HashMap<>();
|
||||
if(faceIds.size() > 0){
|
||||
List<Map<String, Object>> faceList = faceDataMapper.getByFaceIds(collection.getFaceTable(), ValueUtil.getAllFaceColumnNames(collection), new ArrayList<>(faceIds));
|
||||
Set<String> sampleIds = faceList.stream().map(item -> MapUtils.getString(item, Constant.ColumnNameSampleId)).collect(Collectors.toSet());
|
||||
List<Map<String, Object>> sampleList = sampleDataMapper.getBySampleIds(collection.getSampleTable(), new ArrayList<>(sampleIds));
|
||||
faceMapping = ValueUtil.mapping(faceList, Constant.ColumnNameFaceId);
|
||||
sampleMapping = ValueUtil.mapping(sampleList, Constant.ColumnNameSampleId);
|
||||
}
|
||||
//构造返回结果
|
||||
List<FaceSearchRepVo> vos = new ArrayList<>();
|
||||
for(int i=0; i<faceInfos.size(); i++){
|
||||
|
Loading…
x
Reference in New Issue
Block a user