Пример #1
0
        public long CreateEditionNoteVersion(long projectId, CreateEditionNoteContract data)
        {
            var userId            = m_authenticationManager.GetCurrentUserId();
            var resourceVersionId = new CreateEditionNoteVersionWork(m_resourceRepository, projectId, data, userId).Execute();

            return(resourceVersionId);
        }
Пример #2
0
 public CreateEditionNoteVersionWork(ResourceRepository resourceRepository, long projectId, CreateEditionNoteContract data,
                                     int userId) : base(resourceRepository)
 {
     m_resourceRepository = resourceRepository;
     m_projectId          = projectId;
     m_data   = data;
     m_userId = userId;
 }
Пример #3
0
        public IActionResult SetEditionNote(CreateEditionNoteRequest request)
        {
            var client = GetProjectClient();
            var data   = new CreateEditionNoteContract
            {
                Text = request.Content,
                OriginalVersionId = request.OriginalVersionId
            };
            var resourceVersionId = client.CreateEditionNote(request.ProjectId, data);

            return(Json(resourceVersionId));
        }
Пример #4
0
        public IActionResult CreateEditionNoteVersion(long projectId, [FromBody] CreateEditionNoteContract data)
        {
            m_authorizationManager.AuthorizeBook(projectId, PermissionFlag.EditProject);

            try
            {
                var resultId = m_editionNoteManager.CreateEditionNoteVersion(projectId, data);
                return(Ok(resultId));
            }
            catch (HttpErrorCodeException exception)
            {
                return(StatusCode((int)exception.StatusCode, exception.Message));
            }
        }
Пример #5
0
        public long CreateEditionNote(long projectId, CreateEditionNoteContract data)
        {
            try
            {
                return(m_client.Post <long>($"project/{projectId}/edition-note", data));
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", m_client.GetCurrentMethod(), e);
                }

                throw;
            }
        }