Exemplo n.º 1
0
        public async Task <ActionResult <OutputEpic> > Get(Guid projectId, Guid epicId)
        {
            try
            {
                logger.LogInformation($"Beginning request: /api/projects/{projectId}/epics/{epicId} GET");
                Epic epic = await epicManager.GetEpicAsync(projectId, epicId);

                OutputEpic output = epicMapper.MapOutputEpic(epic);
                logger.LogInformation($"Request complete: /api/projects/{projectId}/epics/{epicId} GET");
                return(Ok(output));
            }
            catch (Exception ex)
            {
                return(exceptionManager.Handle(ex));
            }
        }
Exemplo n.º 2
0
        public async Task <ActionResult <OutputEpic> > Put(Guid projectId, Guid epicId, [FromBody] UpdateEpic updateEpic)
        {
            try
            {
                logger.LogInformation($"Beginning request: /api/projects/{projectId}/epics/{epicId} PUT");
                Epic updatedEpic = await epicManager.UpdateEpicAsync(projectId,
                                                                     epicId,
                                                                     updateEpic.Name,
                                                                     updateEpic.Description);

                OutputEpic output = epicMapper.MapOutputEpic(updatedEpic);
                logger.LogInformation($"Request complete: /api/projects/{projectId}/epics/{epicId} PUT");
                return(Ok(output));
            }
            catch (Exception ex)
            {
                return(exceptionManager.Handle(ex));
            }
        }
Exemplo n.º 3
0
        public async Task <ActionResult <OutputEpic> > Post(Guid projectId, [FromBody] CreateEpic createEpic)
        {
            try
            {
                logger.LogInformation($"Beginning request: /api/projects/{projectId}/epics POST");
                Epic createdEpic = await epicManager.CreateEpicAsync(projectId,
                                                                     createEpic.Name,
                                                                     createEpic.Description);

                string     createdProjectUrl = $"{Utilities.Web.GetBaseUrl(HttpContext)}/api/projects/{projectId}/epics{createdEpic.PublicEpicId}";
                OutputEpic output            = epicMapper.MapOutputEpic(createdEpic);
                logger.LogInformation("Request complete: /api/projects/{projectId}/epics POST");
                return(Created(createdProjectUrl, output));
            }
            catch (Exception ex)
            {
                return(exceptionManager.Handle(ex));
            }
        }