Created
April 26, 2018 11:03
-
-
Save Romeh/228a22a83893e22d2c47ef783097e3f4 to your computer and use it in GitHub Desktop.
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
/** | |
* The main order domain REST API | |
* | |
* @author romeh | |
*/ | |
@RestController | |
@RequestMapping("/orders") | |
@Api(value = "Order Manager REST API demo") | |
public class OrderRestController { | |
@Autowired | |
private OrdersBroker ordersBroker; | |
/** | |
* @param orderRequest json order request | |
* @return ASYNC generic JSON response | |
*/ | |
@RequestMapping(method = RequestMethod.POST) | |
public CompletableFuture<Response> createOrder(@RequestBody @Valid OrderRequest orderRequest) { | |
return ordersBroker.createOrder(new OrderCmd.CreateCmd(UUID.randomUUID().toString(), orderRequest.getOrderDetails())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment