Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/**
* 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
You can’t perform that action at this time.