use of com.kloia.sample.dto.event.OrderCreatedEvent in project eventapis by kloiasoft.
the class CreateOrderCommand method execute.
@RequestMapping(value = "/order/create", method = RequestMethod.POST)
@Command
public EventKey execute(@RequestBody @Valid CreateOrderCommandDto dto) throws Exception {
OrderCreatedEvent orderCreatedEvent = new OrderCreatedEvent();
BeanUtils.copyProperties(dto, orderCreatedEvent);
return eventRepository.recordAndPublish(orderCreatedEvent);
}
Aggregations