Commit dacdd0c2 by Patryk Czarnik

jakaś zmiana

parent 3d273d69
...@@ -4,6 +4,7 @@ import java.math.BigDecimal; ...@@ -4,6 +4,7 @@ import java.math.BigDecimal;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Sort;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
...@@ -26,7 +27,7 @@ public class ProductEndpoint { ...@@ -26,7 +27,7 @@ public class ProductEndpoint {
@GetMapping @GetMapping
public List<Product> readAll() { public List<Product> readAll() {
return productRepository.findAll(); return productRepository.findAll(Sort.by("productId"));
} }
@GetMapping("/{id}") @GetMapping("/{id}")
...@@ -41,7 +42,6 @@ public class ProductEndpoint { ...@@ -41,7 +42,6 @@ public class ProductEndpoint {
return readOne(id).getPrice(); return readOne(id).getPrice();
} }
@GetMapping(path="/{id}/photo", produces="image/jpeg") @GetMapping(path="/{id}/photo", produces="image/jpeg")
public byte[] getPhoto(@PathVariable Integer id) { public byte[] getPhoto(@PathVariable Integer id) {
return photoUtil.readBytes(id); return photoUtil.readBytes(id);
......
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