public PageListResult <PullInfoDto> GetPullInfoPageList(PullInfoSearchDto pullInfoSearchDto)
        {
            if (!pullInfoSearchDto.ChannelId.HasValue)
            {
                return(new PageListResult <PullInfoDto>());
            }
            var result = _pullInfoService.GetPullInfoPageList(pullInfoSearchDto);

            return(result);
        }
Пример #2
0
        public async Task <string> Command(ExecuteCommandRequest request)
        {
            var chandnel = await _channelService.Get(request.Id);

            if (chandnel == null)
            {
                return("命令发送失败");
            }
            List <CommandDto> data = new List <CommandDto>();

            if (request.CommandType == CommandTypeEnum.Stop)
            {
                data.Add(new CommandDto {
                    ChanneId = request.Id, CommandType = request.CommandType, FactoryCode = chandnel.FactoryCode
                });
            }
            else
            {
                data = _pullInfoService.GetPullInfoPageList(new PullInfoSearchDto {
                    ChannelId = request.Id, ResultCount = 999
                })
                       .Items.Select(s => new CommandDto
                {
                    ChanneId    = request.Id,
                    CommandType = request.CommandType,
                    FactoryCode = chandnel.FactoryCode,
                    PullAddress = s.Url,
                    PushAddress = chandnel.PushUrl
                }).ToList();
            }
            if (data.Count > 0)
            {
                var model = LiveChannelManager.Data.FirstOrDefault(m => m.Id == request.Id);
                if (model != null)
                {
                    _commandService.ExecuteCommand(data[model.PullIndex]);
                }
                else
                {
                    _commandService.ExecuteCommand(data.FirstOrDefault());
                }
                return("命令已发送");
            }
            else
            {
                return("命令发送失败,为查询到对应的数据");
            }
        }
Пример #3
0
        public PageListResult <PullInfoDto> GetPullInfoPageList(PullInfoSearchDto pullInfoSearchDto)
        {
            var result = _pullInfoService.GetPullInfoPageList(pullInfoSearchDto);

            return(result);
        }