Commit 13f7e9dd by Patryk Czarnik

@RestController

parent 6a719bf6
...@@ -2,14 +2,13 @@ package sklep.rest; ...@@ -2,14 +2,13 @@ package sklep.rest;
import java.util.List; import java.util.List;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.RestController;
import sklep.model.Product; import sklep.model.Product;
import sklep.repository.ProductRepository; import sklep.repository.ProductRepository;
@Controller @RestController
public class ProductEndpoint { public class ProductEndpoint {
private ProductRepository productRepository; private ProductRepository productRepository;
...@@ -18,7 +17,6 @@ public class ProductEndpoint { ...@@ -18,7 +17,6 @@ public class ProductEndpoint {
} }
@GetMapping("/products") @GetMapping("/products")
@ResponseBody
public List<Product> getAllProducts() { public List<Product> getAllProducts() {
System.out.println("puk puk"); System.out.println("puk puk");
return productRepository.findAll(); return productRepository.findAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment