이벤트 order 이벤트 핸들링

This commit is contained in:
kimscott
2019-11-12 16:17:32 +09:00
parent d56fe4a32c
commit c3c147b097
4 changed files with 22 additions and 17 deletions

View File

@@ -19,21 +19,21 @@ public class ProductChanged extends AbstractEvent{
private String productName; private String productName;
private int productPrice; private int productPrice;
// private int productStock; private int productStock;
// public int getProductStock() { public int getProductStock() {
// return productStock; return productStock;
// } }
// public void setProductStock(int productStock) { public void setProductStock(int productStock) {
// this.productStock = productStock; this.productStock = productStock;
// } }
private int stock; // private int stock;
public int getStock() { // public int getStock() {
return stock; // return stock;
} // }
public void setStock(int stock) { // public void setStock(int stock) {
this.stock = stock; // this.stock = stock;
} // }
private String imageUrl; private String imageUrl;
@@ -48,8 +48,8 @@ public class ProductChanged extends AbstractEvent{
this.setProductId(product.getId()); this.setProductId(product.getId());
this.setProductName(product.getName()); this.setProductName(product.getName());
this.setProductPrice(product.getPrice()); this.setProductPrice(product.getPrice());
// this.setProductStock(product.getStock()); this.setProductStock(product.getStock());
this.setStock(product.getStock()); // this.setStock(product.getStock());
this.setImageUrl(product.getImageUrl()); this.setImageUrl(product.getImageUrl());
} }

View File

@@ -11,8 +11,13 @@ public class ProductController {
@Autowired @Autowired
ProductService productService; ProductService productService;
// @GetMapping("/item/{productId}")
// Product productStockCheck(@PathVariable(value = "productId") Long productId) {
// return this.productService.getProductById(productId);
// }
@GetMapping("/product/{productId}") @GetMapping("/product/{productId}")
Product productStockCheck(@PathVariable(value = "productId") Long productId) { Product productStockCheck1(@PathVariable(value = "productId") Long productId) {
return this.productService.getProductById(productId); return this.productService.getProductById(productId);
} }
} }