Exemplo n.º 1
0
 public virtual async Task <PagedResultDto <ChatMessage> > GetGroupMessageAsync(GroupMessageGetByPagedDto groupMessageGetByPaged)
 {
     return(await _chatAppService.GetGroupMessageAsync(groupMessageGetByPaged));
 }
        public virtual async Task <PagedResultDto <ChatMessage> > GetMyGroupMessageAsync(GroupMessageGetByPagedDto input)
        {
            if (!await _userGroupStore.MemberHasInGroupAsync(CurrentTenant.Id, input.GroupId, CurrentUser.GetId()))
            {
                throw new BusinessException(MessageServiceErrorCodes.YouHaveNotJoinedGroup);
            }

            var groupMessageCount = await _messageStore
                                    .GetGroupMessageCountAsync(CurrentTenant.Id, input.GroupId,
                                                               input.Filter, input.MessageType);

            var groupMessages = await _messageStore
                                .GetGroupMessageAsync(CurrentTenant.Id, input.GroupId,
                                                      input.Filter, input.Sorting, input.Reverse,
                                                      input.MessageType, input.SkipCount, input.MaxResultCount);

            return(new PagedResultDto <ChatMessage>(groupMessageCount, groupMessages));
        }
        public virtual async Task <PagedResultDto <ChatMessage> > GetGroupMessageAsync(GroupMessageGetByPagedDto groupMessageGetByPaged)
        {
            var groupMessageCount = await _messageStore
                                    .GetGroupMessageCountAsync(CurrentTenant.Id, groupMessageGetByPaged.GroupId,
                                                               groupMessageGetByPaged.Filter, groupMessageGetByPaged.MessageType);

            var groupMessages = await _messageStore
                                .GetGroupMessageAsync(CurrentTenant.Id, groupMessageGetByPaged.GroupId,
                                                      groupMessageGetByPaged.Filter, groupMessageGetByPaged.Sorting, groupMessageGetByPaged.MessageType,
                                                      groupMessageGetByPaged.SkipCount, groupMessageGetByPaged.MaxResultCount);

            return(new PagedResultDto <ChatMessage>(groupMessageCount, groupMessages));
        }