コード例 #1
0
        public async Task <ApiResponseAsync <bool> > CreatePageContent(CreateContentDTO dto)
        {
            await this._body.Create(dto.NotesId, dto.SectionId, dto.PageId, dto.Cotnent);


            return(ApiRes.OK(true));
        }
コード例 #2
0
        public async Task Create(CreateContentViewModel input)
        {
            try
            {
                string mainImageUrl = await _blobManager.UploadImageAsBlob(input.MainImage);

                string slideImageUrl = await _blobManager.UploadImageAsBlob(input.SlideImage);

                string videoUrl = await _blobManager.UploadImageAsBlob(input.Video);

                string audioUrl = await _blobManager.UploadImageAsBlob(input.Audio);

                CreateContentDTO data = new CreateContentDTO()
                {
                    Name          = input.Name,
                    Description   = input.Description,
                    Title         = input.Title,
                    MainImageURL  = mainImageUrl,
                    SlideImageURL = slideImageUrl,
                    VideoURL      = videoUrl,
                    AudioURL      = audioUrl,
                    IsHomePage    = input.IsHomePage,
                    IsCampaign    = input.IsCampaign,
                    Text          = input.Text,
                    LocationId    = input.LocationId
                };
                await _contentService.CrateContent(data);
            }
            catch (Exception e)
            {
                throw e;
            }
        }
コード例 #3
0
        public async Task CrateContent(CreateContentDTO input)
        {
            var content = _mapper.Map <Content>(input);

            content.Location = await _locationRepository.GetById(input.LocationId);

            await _repository.Create(content);
        }
コード例 #4
0
        public async Task <IActionResult> CreateContent(CreateContentDTO input)
        {
            try
            {
                await _contentService.CrateContent(input);

                return(Ok());
            }
            catch (Exception)
            {
                throw;
            }
        }