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