예제 #1
0
        public async Task <string> ShareVideoLink(int userId, CreateVideoLinkVm model)
        {
            if (!await _videoRepository.IsUserVideoOwner(userId, model.VideoId))
            {
                throw new AccessDeniedException();
            }

            return(await _linkRepository.GetLink(userId, model.VideoId, model.LinkPassword, model.ExpiryDate) ??
                   await _linkRepository.CreateVideoLink(userId, _mapper.Map <CreateVideoLinkDto>(model)));
        }
예제 #2
0
 public async Task <IActionResult> ShareVideoLink([FromBody] CreateVideoLinkVm model)
 {
     return(this.Ok(await _videoService.ShareVideoLink(this.CurrentUserId.Value, model)));
 }