-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
36 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,8 +13,6 @@ create table t_product | |
constraint t_product_pk | ||
primary key (id) | ||
); | ||
|
||
|
||
``` | ||
|
||
## Libraries | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
ProductService/src/main/java/com/redhat/sample/ecommerce/product/helper/StockHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package com.redhat.sample.ecommerce.product.helper; | ||
|
||
import com.redhat.sample.ecommerce.product.domain.Product; | ||
import org.apache.camel.Body; | ||
import org.apache.camel.Header; | ||
import org.springframework.context.annotation.Bean; | ||
|
||
/** | ||
* <pre> | ||
* com.redhat.sample.ecommerce.product.helper.StockHelper | ||
* </pre> | ||
* | ||
* @author Muhammad Edwin < edwin at redhat dot com > | ||
* 07 Jun 2022 15:35 | ||
*/ | ||
public class StockHelper { | ||
@Bean | ||
public Product addStockToProduct(@Body Product product, @Header("stock") String stock) { | ||
product.setStock(Long.parseLong(stock)); | ||
return product; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters