Skip to content

Commit

Permalink
Merge pull request #2 from KBTG-Kampus-ClassNest-SE-Java/story-3
Browse files Browse the repository at this point in the history
update fig @Autowired
  • Loading branch information
jirayus22 authored Mar 23, 2024
2 parents 69ebd17 + ee8122a commit 9ee4b89
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 9ee4b89

Please sign in to comment.