findAll
Atualizado
public List<ProductDTO> findAll() {
List<Product> products = repository.findAll();
return products.stream().map(ProductDTO::new).toList();
}
@GetMapping
public ResponseEntity<List<ProductDTO>> findAll() {
List<ProductDTO> dto = productService.findAll();
return ResponseEntity.ok().body(dto);
}
Atualizado