Search in sources :

Example 1 with OrderCreatedEvent

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);
}
Also used : OrderCreatedEvent(com.kloia.sample.dto.event.OrderCreatedEvent) Command(com.kloia.eventapis.api.Command) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

Command (com.kloia.eventapis.api.Command)1 OrderCreatedEvent (com.kloia.sample.dto.event.OrderCreatedEvent)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1