diff --git a/services/src/main/java/ch/hepia/order/http.java b/services/src/main/java/ch/hepia/order/http.java index 844e1186f535f21af735df2107128c7049bc1ce9..8f630b32c529200fedb1e486359f29f468cec061 100644 --- a/services/src/main/java/ch/hepia/order/http.java +++ b/services/src/main/java/ch/hepia/order/http.java @@ -70,11 +70,20 @@ public class http { @RequestMapping("/createProduct") - public Product createProduct(@RequestParam(value = "name", defaultValue = "poire") String name, - @RequestParam(value = "price", defaultValue = "1") double price) { + public Product createProduct( + @RequestParam(value = "name", defaultValue = "poire") String name, + @RequestParam(value = "price", defaultValue = "1") double price) { stockService.send(new EventCreateProduct(1, "Creating the product", name, price)); + return null; + } + + @RequestMapping("/supplyStock") + public Product supplyStock( + @RequestParam(value = "idProduct", defaultValue = "1") int idProduct, + @RequestParam(value = "quantity", defaultValue = "10") int quantity) { + stockService.send(new EventAddProductQuantity(1, "Supplying ", idProduct, quantity)); return null; }