public object Any(CreateCommentByAlbumOrImageRequest request)
        {
            var repo = new PostRepository().CreateCommentForAlbumOrImage(request.MemberId, request.PostId, request.CommentContent, request.ApiKey);
            
            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
        public object Any(AddViewCountForAlbumOrImageRequest request)
        {
            var repo = new PostRepository().AddTotalViewForImage(request.PostId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
Example #3
0
        public object Any(DeleteAlbumRequest request)
        {
            var repo = new PostRepository().DeleteAlbum(request.AlbumId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
        public object Any(ChangeAlbumStatusRequest request)
        {
            var repo = new PostRepository().ChangeStatusAlbum(request.AlbumId, request.Status, request.ApiKey);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
Example #5
0
        public object Any(CheckPizRequest request)
        {
            var repo = new PostRepository().CheckPizAlbumOrImage(request.MemberId,request.PostId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();

            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
Example #6
0
        public object Any(GetAllCategoryRequest request)
        {
            var repo = new PostRepository().GetCategories(request.ApiKey);

            AutoMapper.Mapper.CreateMap<CategoryResponeModel, CategoryRespone>();
            AutoMapper.Mapper.CreateMap<ListCategoryResponseModel, ListCategoryResponse>()
                .ForMember(x => x.Categories, m => m.MapFrom(p => p.Categories));

            return AutoMapper.Mapper.Map<ListCategoryResponse>(repo);
        }
Example #7
0
        public object Any(UpdateAlbumRequest request)
        {
            var data = AutoMapper.Mapper.Map<UpdateAlbumRequestModel>(request);

            var repo = new PostRepository().UpdateAlbum(data);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(repo);

        }
        public object Any(GetSingleImageRequest request)
        {
            var repo = new PostRepository().GetSingleImage(request.ImageId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<ImageModel,  Image>();
            AutoMapper.Mapper.CreateMap<ImageResponseModel, ImageResponse>()
                      .ForMember(x => x.Image, a => a.MapFrom(y => y.Image));

            return AutoMapper.Mapper.Map<ImageResponse>(repo);

        }
Example #9
0
        public object Any(GetVotePostByPostRequest request)
        {
            var repo = new PostRepository().GetPizByAlbumOrImage(request.PostId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<PizListResponseModel.PizModel, PizPostListResponse.PizModel>();
            AutoMapper.Mapper.CreateMap<PizListResponseModel, PizPostListResponse>()
                      .ForMember(x => x.Votes, a => a.MapFrom(y => y.Votes));

            return AutoMapper.Mapper.Map<PizPostListResponse>(repo);

        }
        public object Any(GetCommentByPostRequest request)
        {
            var repo = new PostRepository().GetCommentByPost(request.PostId, request.ApiKey);

            AutoMapper.Mapper.CreateMap<CommentListResponseModel.CommentModel, CommentListResponse.CommentModel>()
                      .ForMember(a => a.CommentsChild, x => x.MapFrom(m => m.CommentsChild));
            AutoMapper.Mapper.CreateMap<CommentListResponseModel, CommentListResponse>()
                      .ForMember(a => a.Comments, x => x.MapFrom(m => m.Comments));

            return AutoMapper.Mapper.Map<CommentListResponse>(repo);
        }
Example #11
0
        public object Any(CreateImageRequest request)
        {
            AutoMapper.Mapper.CreateMap<CreateImageRequest, CreateImageRequestModel>();

            var data = AutoMapper.Mapper.Map<CreateImageRequestModel>(request);

            var response = new PostRepository().CreateImage(data);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(response);

        }
Example #12
0
        public object Any(GetAlbumByUserRequest request)
        {
            var repo = new PostRepository().GetAlbumByUser(request.MemberId, request.PageNumber, request.PageSize, request.Status, request.IsGetAll,request.ApiKey);

            AutoMapper.Mapper.CreateMap<ImageModel, Image>();
            AutoMapper.Mapper.CreateMap<AlbumModel, Album>().ForMember(x => x.Images, m => m.MapFrom(p => p.Images));
            AutoMapper.Mapper.CreateMap<AlbumList, AlbumListResponse>()
                      .ForMember(x => x.Albums, a => a.MapFrom(m => m.Albums));

            return AutoMapper.Mapper.Map<AlbumListResponse>(repo);

        }
Example #13
0
        public object Any(CreateAlbumRequest request)
        {
            AutoMapper.Mapper.CreateMap<CreateAlbumRequest.ImageRequest, CreateAlbumRequestModel.ImageRequest>();
            AutoMapper.Mapper.CreateMap<CreateAlbumRequest, CreateAlbumRequestModel>()
                .ForMember(m=>m.ListImage, p=>p.MapFrom(x=>x.ListImage));

            var data = AutoMapper.Mapper.Map<CreateAlbumRequestModel>(request);
            
            var response = new PostRepository().CreateAlbum(data);

            AutoMapper.Mapper.CreateMap<PostEditResponseModel, PostEditResponse>();
            return AutoMapper.Mapper.Map<PostEditResponse>(response);

        }