Skip to content
Snippets Groups Projects
Commit ed209367 authored by michael.ramusi's avatar michael.ramusi
Browse files

possibility to supply stocks

parent edc951e0
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment