| Total Complexity | 2 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | package com.osomapps.pt.admin.exercise; |
||
| 8 | @Service |
||
| 9 | class AdminExerciseFileService { |
||
| 10 | private final ExerciseFileRepository exerciseFileRepository; |
||
| 11 | |||
| 12 | AdminExerciseFileService(ExerciseFileRepository exerciseFileRepository) { |
||
| 13 | this.exerciseFileRepository = exerciseFileRepository; |
||
| 14 | } |
||
| 15 | |||
| 16 | List<ExerciseFileResponseDTO> findAll(List<Long> ids) { |
||
| 17 | return exerciseFileRepository.findAllById(ids).stream() |
||
| 18 | .map( |
||
| 19 | file -> |
||
| 20 | ExerciseFileResponseDTO.builder() |
||
| 21 | .id(file.getId()) |
||
| 22 | .file_name(file.getFile_name()) |
||
| 23 | .file_size(file.getFile_size()) |
||
| 24 | .file_type(file.getFile_type()) |
||
| 25 | .data_url(file.getData_url()) |
||
| 26 | .build()) |
||
| 27 | .collect(Collectors.toList()); |
||
| 28 | } |
||
| 30 |