public async Task <IActionResult> AddCustomerToGroup(int id, [FromBody] AddCustomerToGroupRequest request) { request.customer_group_id = id; AddCustomerToGroupResponse result = await _CustomerGroupAppService.addCustomerToGroup(request); if (result.Success) { return(Ok(result)); } return(NotFound(result)); }
public Task <AddCustomerToGroupResponse> addCustomerToGroup(AddCustomerToGroupRequest request) { ChangeCustomerGroupCommand command = new ChangeCustomerGroupCommand(request.customer_id, request.customer_group_id); Task <object> CustomerGroup = (Task <object>)Bus.SendCommand(command); //RabbitMQBus.Publish(command); AddCustomerToGroupResponse response = new AddCustomerToGroupResponse(); response = Common <AddCustomerToGroupResponse> .checkHasNotification(_notifications, response); if (response.Success) { CustomerGroupModel CustomerGroupModel = (CustomerGroupModel)CustomerGroup.Result; response.Data = (bool)CustomerGroup.Result; } return(Task.FromResult(response)); }