dev add check limits logic
Test Workflow / test (push) Successful in 3s

This commit is contained in:
vladp
2026-01-28 23:25:16 +07:00
parent 31fac0ab93
commit ec20d68261
12 changed files with 283 additions and 16 deletions
@@ -46,13 +46,7 @@ public class YandexSearchService {
objectMapper.configure(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY, true);
}
public YandexSearchResponse searchByFileEntity(String fileId) throws IOException {
FileEntity fileEntity = fileEntityRepository.findById(fileId)
.orElseThrow(() -> {
throw new NotValidFieldException("File not found", new BaseResponse(20007,
MessageCode.FILE_NOT_FOUND.getCode(), MessageCode.FILE_NOT_FOUND.getDescription(),
Map.of("fileId",fileId)));
});
public YandexSearchResponse searchByFileEntity(FileEntity fileEntity) throws IOException {
byte[] fileBytes;
if (!isImageFile(fileEntity)) {
@@ -67,7 +61,7 @@ public class YandexSearchService {
} catch (IOException e) {
throw new NotValidFieldException("File not found or cannot read file", new BaseResponse(20007,
MessageCode.FILE_NOT_FOUND.getCode(), MessageCode.FILE_NOT_FOUND.getDescription(),
Map.of("fileId", fileId,
Map.of("fileId", fileEntity.getId(),
"filePath", fileEntity.getFilePath())));
}