@@ -72,16 +72,6 @@ public class ViolationService {
|
|||||||
List<Violation> fileViolations = violationsByFileId.getOrDefault(file.getId(),
|
List<Violation> fileViolations = violationsByFileId.getOrDefault(file.getId(),
|
||||||
Collections.emptyList());
|
Collections.emptyList());
|
||||||
|
|
||||||
List<ViolationInfoDTO> violationDtos = fileViolations.stream()
|
|
||||||
.map(v -> ViolationInfoDTO.builder()
|
|
||||||
.violationId(v.getId())
|
|
||||||
.url(v.getUrl())
|
|
||||||
.pageUrl(v.getPageUrl())
|
|
||||||
.host(v.getHost())
|
|
||||||
.createdDate(v.getCreatedDate())
|
|
||||||
.build())
|
|
||||||
.collect(Collectors.toList());
|
|
||||||
|
|
||||||
LocalDateTime latestDate = fileViolations.stream()
|
LocalDateTime latestDate = fileViolations.stream()
|
||||||
.map(Violation::getCreatedDate)
|
.map(Violation::getCreatedDate)
|
||||||
.max(LocalDateTime::compareTo)
|
.max(LocalDateTime::compareTo)
|
||||||
@@ -91,15 +81,12 @@ public class ViolationService {
|
|||||||
.fileId(file.getId())
|
.fileId(file.getId())
|
||||||
.supportId(file.getSupportId())
|
.supportId(file.getSupportId())
|
||||||
.fileName(file.getOriginalFileName())
|
.fileName(file.getOriginalFileName())
|
||||||
.storedFileName(file.getStoredFileName())
|
|
||||||
.filePath(file.getFilePath())
|
|
||||||
.fileSize(file.getFileSize())
|
.fileSize(file.getFileSize())
|
||||||
.mimeType(file.getMimeType())
|
.mimeType(file.getMimeType())
|
||||||
.status(file.getStatus())
|
.status(file.getStatus())
|
||||||
.createdAt(file.getCreatedAt())
|
.createdAt(file.getCreatedAt())
|
||||||
.violationCount(fileViolations.size())
|
.violationCount(fileViolations.size())
|
||||||
.latestViolationDate(latestDate)
|
.latestViolationDate(latestDate)
|
||||||
.violations(violationDtos)
|
|
||||||
.build();
|
.build();
|
||||||
})
|
})
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|||||||
Reference in New Issue
Block a user