@@ -72,16 +72,6 @@ public class ViolationService {
|
||||
List<Violation> fileViolations = violationsByFileId.getOrDefault(file.getId(),
|
||||
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()
|
||||
.map(Violation::getCreatedDate)
|
||||
.max(LocalDateTime::compareTo)
|
||||
@@ -91,15 +81,12 @@ public class ViolationService {
|
||||
.fileId(file.getId())
|
||||
.supportId(file.getSupportId())
|
||||
.fileName(file.getOriginalFileName())
|
||||
.storedFileName(file.getStoredFileName())
|
||||
.filePath(file.getFilePath())
|
||||
.fileSize(file.getFileSize())
|
||||
.mimeType(file.getMimeType())
|
||||
.status(file.getStatus())
|
||||
.createdAt(file.getCreatedAt())
|
||||
.violationCount(fileViolations.size())
|
||||
.latestViolationDate(latestDate)
|
||||
.violations(violationDtos)
|
||||
.build();
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
|
||||
Reference in New Issue
Block a user