dev conver files
Test Workflow / test (push) Successful in 4s

This commit is contained in:
vladp
2026-02-25 19:29:19 +07:00
parent 694681fccc
commit 3bb6667c2f
15 changed files with 33 additions and 139 deletions
@@ -13,17 +13,17 @@ public class FileUtil {
public ImageLocalSearch.Result convertToResult(SimilarFileDTO response) {
FileProtector.FileInfo fileInfo =
new FileProtector.FileInfo(FileProtector.Type.IMAGE, response.getFileId(),
String.valueOf(response.getOwnerId()));
String.valueOf(response.getOwnerId()), null);
ImageScore imageScore = new ImageScore(ImageScore.Rate.valueOf(response.getSimilarityLevel()),
response.getHammingDistance());
return new ImageLocalSearch.Result(fileInfo, imageScore);
}
public FileProtector.FileInfo createFileInfo(FileEntity fileEntity) {
public FileProtector.FileInfo createFileInfo(FileEntity fileEntity, String convertTo) {
FileProtector.Type type = determineFileType(fileEntity.getMimeType());
return new FileProtector.FileInfo(type, fileEntity.getId(), String.valueOf(fileEntity.getUserId()));
return new FileProtector.FileInfo(type, fileEntity.getId(), String.valueOf(fileEntity.getUserId()), convertTo);
}
public int hamming64(long aHi, long aLo, long bHi, long bLo) {