Exemplo n.º 1
0
        public async Task <IActionResult> AddMessageAsync(Guid channelId, [FromBody] AddMessageRequest request)
        {
            var createMessageRequest = new CreateMessageRequest(GetCurrentSaasUserId(), channelId, request.Type, request.Body)
            {
                ForwardedMessageId = request.ForwardedMessageId,
                ImageUrl           = request.ImageUrl
            };
            var result = await _messageSocketService.AddMessageAsync(createMessageRequest, request.ClientConnectionId);

            return(Ok(result));
        }
Exemplo n.º 2
0
 public async Task <MessageResponse> AddMessageAsync(AddMessageRequest request)
 {
     return(await ValidateAndExecuteAsync(request, new AddMessageRequestValidator(), new TaskReference <MessageResponse>(async() =>
     {
         var createMessageRequest = new CreateMessageRequest(Context.GetSaasUserId(), request.ChannelId, request.Type, request.Body)
         {
             ImageUrl = request.ImageUrl,
             ForwardedMessageId = request.ForwardedMessageId
         };
         return await _messageSocketService.AddMessageAsync(createMessageRequest, Context.ConnectionId);
     }),
                                          request.RequestId));
 }