RED-3842 filesize
This commit is contained in:
parent
e6e0dd27dd
commit
5171b039d8
@ -1,8 +1,8 @@
|
||||
package com.iqser.red.service.peristence.v1.server.migration.migrations;
|
||||
|
||||
import com.iqser.red.service.pdftron.redaction.v1.api.model.ProcessUntouchedDocumentRequest;
|
||||
import com.iqser.red.service.peristence.v1.server.migration.Migration;
|
||||
import com.iqser.red.service.peristence.v1.server.service.FileManagementStorageService;
|
||||
import com.iqser.red.service.peristence.v1.server.service.FileStatusService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.client.PDFTronRedactionClient;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.DossierPersistenceService;
|
||||
import com.iqser.red.service.persistence.management.v1.processor.service.persistence.FileStatusPersistenceService;
|
||||
@ -27,10 +27,10 @@ public class MigrateHighlights3 extends Migration {
|
||||
private FileStatusPersistenceService fileStatusPersistenceService;
|
||||
|
||||
@Autowired
|
||||
private PDFTronRedactionClient pdfTronRedactionClient;
|
||||
private FileManagementStorageService fileManagementStorageService;
|
||||
|
||||
@Autowired
|
||||
private FileManagementStorageService fileManagementStorageService;
|
||||
private FileStatusService fileStatusService;
|
||||
|
||||
public MigrateHighlights3() {
|
||||
|
||||
@ -63,10 +63,9 @@ public class MigrateHighlights3 extends Migration {
|
||||
fileManagementStorageService.getStoredObjectBytes(dossier.getId(), file.getId(), FileType.ORIGIN));
|
||||
|
||||
}
|
||||
var response = pdfTronRedactionClient.processUntouchedDocument(ProcessUntouchedDocumentRequest.builder()
|
||||
.fileName(file.getFilename()).fileId(file.getId()).dossierId(file.getDossierId()).build());
|
||||
|
||||
fileStatusPersistenceService.updateHasHighlights(file.getId(), response.isHasHighlights());
|
||||
fileStatusService.addToPreprocessingQueue(file.getId(), file.getDossierId(), file.getFilename());
|
||||
|
||||
} else {
|
||||
log.warn("Invalid file: {} in dossier: {}. File Data ( PDF ) does not exist", file.getId(), file.getDossierId());
|
||||
}
|
||||
|
||||
@ -71,3 +71,5 @@ databaseChangeLog:
|
||||
file: db/changelog/28-add-update-dictionary-to-manual-resize-redactions.yaml
|
||||
- include:
|
||||
file: db/changelog/sql/30-change-bigint-to-serial.sql
|
||||
- include:
|
||||
file: db/changelog/31-add-file-size-column.changelog.yaml
|
||||
|
||||
@ -148,20 +148,6 @@ public abstract class AbstractPersistenceServerServiceTest {
|
||||
|
||||
when(amqpAdmin.getQueueInfo(Mockito.any())).thenReturn(null);
|
||||
|
||||
doAnswer(answer -> {
|
||||
|
||||
Object[] args = answer.getArguments();
|
||||
DocumentRequest d = (DocumentRequest) args[0];
|
||||
|
||||
var untouchedObjectId = StorageIdUtils.getStorageId(d.getDossierId(), d.getFileId(), FileType.UNTOUCHED);
|
||||
|
||||
var untouched = storageService.getObject(untouchedObjectId);
|
||||
storageService.storeObject(StorageIdUtils.getStorageId(d.getDossierId(), d.getFileId(), FileType.ORIGIN), IOUtils.toByteArray(untouched.getInputStream()));
|
||||
return UntouchedDocumentResponse.builder().build();
|
||||
|
||||
}).when(pdfTronRedactionClient).processUntouchedDocument(any());
|
||||
|
||||
|
||||
when(pdfTronRedactionClient.redact(Mockito.any())).thenAnswer((answer) -> {
|
||||
Object[] args = answer.getArguments();
|
||||
DocumentRequest d = (DocumentRequest) args[0];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user