示例#1
0
        public async Task <ActionResult <ConversationDto> > GetAsync(int id)
        {
            var conversation = await _conversationQueryService.GetConversationByIdAsync(id, User.GetUserId(), User.GetWorkspaceId());

            if (conversation == null)
            {
                return(NotFound());
            }

            return(conversation);
        }
示例#2
0
        private async Task AddMessageChannelDescriptionForConversation(MessageLoadDto messageLoad, int conversationId, int userId, int workspaceId)
        {
            var conversation = await _conversationQueryService.GetConversationByIdAsync(conversationId, userId, workspaceId);

            var createdByUser = await _userQueryService.GetUserByIdAsync(conversation.CreatedByUserId);

            messageLoad.MessageChannelDescriptionDto = new MessageChannelDescriptionDto {
                CreatedByUser      = createdByUser,
                CreatedDateString  = conversation.CreatedDateString,
                MessageChannelName = conversation.Name,
                IsSelfConversation = conversation.IsSelfConversation
            };
        }