Commit dacdd0c2 by Patryk Czarnik

jakaś zmiana

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