findAll
Atualizado
public List<DepartmentDTO> findAll() {
List<Department> departments = departmentRepository.findAll();
return departments.stream().map(DepartmentDTO::new).toList();
}
@GetMapping
public ResponseEntity<List<DepartmentDTO>> findAll() {
List<DepartmentDTO> dto = departmentService.findAll();
return ResponseEntity.ok().body(dto);
}
Atualizado