Skip to content

Commit

Permalink
update fig @Autowired
Browse files Browse the repository at this point in the history
  • Loading branch information
Jirayus Thaiutai committed Mar 23, 2024
1 parent 3096559 commit ee8122a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
@Validated
public class ProductController {

@Autowired
private final ProductService productService;

public ProductController(ProductService productService) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
@Service
public class ProductService {

@Autowired
private ProductRepository productRepository;

public ProductService(ProductRepository productRepository) {
this.productRepository = productRepository;
}

public List<ProductResponse> getAll() {
return productRepository.findAll().stream().map(Product::toResponse).toList();
}
Expand Down

0 comments on commit ee8122a

Please sign in to comment.