예제 #1
0
        /// <summary>
        ///     根据状态查找视频
        /// </summary>
        /// <returns></returns>
        public IPagedList <VideoEx> GetVideoByStatus(VideoStatus status, int pageIndex = 0, int pageSize = int.MaxValue)
        {
            var query = from v in _videoRepository.GetAll()
                        join u in _userRepository.GetAll() on v.PublishUserId equals u.Id
                        join ua in _userAvatarRepository.GetAll() on u.Id equals ua.UserId into uaTemp
                        from uaEmpty in uaTemp.DefaultIfEmpty()
                        where v.Status == status
                        select new VideoEx
            {
                Id                         = v.Id,
                Title                      = v.Title,
                StreamMediaPath            = v.StreamMediaPath,
                EstimatedStartTime         = v.EstimatedStartTime,
                ActualStartTime            = v.ActualStartTime,
                ActualEndTime              = v.ActualEndTime,
                Status                     = v.Status,
                PublishUserId              = v.PublishUserId,
                limelightCount             = v.limelightCount,
                LiveRoomId                 = v.LiveRoomId,
                ChatRoomId                 = v.ChatRoomId,
                LivePreviewImagePath       = v.LivePreviewImagePath,
                PublishUserName            = u.Name,
                PublishUserAvatarImagePath = uaEmpty.ImageFilePath
            };

            query = query.OrderBy(x => x.Id);

            var videos = new PagedList <VideoEx>(query, pageIndex, pageSize);

            return(videos);
        }
예제 #2
0
        public GetUserAvatarOutput GetUserAvatar(GetUserAvatarInput input)
        {
            var userAvatars = _userAvatarRepository.GetAll()
                              .Where(x => x.UserId == AbpSession.GetUserId()).ToList();

            var dtoItems = Mapper.Map <List <UserAvatarDto> >(userAvatars);

            return(new GetUserAvatarOutput
            {
                UserAvatars = dtoItems
            });
        }