public async Task <CheckNewResponse> CheckNewMessages(CheckNewRequest request, string SourceId) { return(new CheckNewResponse { NewMessages = await _chatRepository.GetSentMessages(SourceId, request.LastReceivedId), EditedMessages = await _chatRepository.GetEditedMessages(SourceId, request.LastEditedId), DeletedMessages = await _chatRepository.GetDeletedMessages(SourceId, request.LastDeletedId) }); }
public async Task <IActionResult> CheckNewMessages([FromBody] CheckNewRequest request, [FromHeader] string Authorization) { var userId = _authService.Authorize(Authorization); return(Ok(await _chatService.CheckNewMessages(request, userId))); }