last ...
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
using xApi.Models;
|
||||
using xApi.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xApi.Models;
|
||||
|
||||
namespace xApi.Controllers
|
||||
{
|
||||
@@ -110,10 +110,12 @@ namespace xApi.Controllers
|
||||
/// <summary>
|
||||
/// Get WorkItem Types from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetWorkItemTypes")]
|
||||
public async Task<ActionResult<string>> GetWorkItemTypes(
|
||||
[HttpGet("WorkItem/{id}")]
|
||||
public async Task<ActionResult<AzureWorkItemDto>> GetWorkItem(
|
||||
[FromRoute] long id,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
@@ -122,7 +124,10 @@ namespace xApi.Controllers
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetWorkItemTypesAsync(cancellationToken);
|
||||
.GetWorkItemAsync(
|
||||
workItemId: id,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return Ok(response);
|
||||
@@ -134,5 +139,101 @@ namespace xApi.Controllers
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get WorkItem Types from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("WorkItem/{id}/Revisions")]
|
||||
public async Task<ActionResult<AzureWorkItemDto>> GetWorkItemRevisions(
|
||||
[FromRoute] long id,
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetWorkItemRevisionsAsync(
|
||||
workItemId: id,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return Ok(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
logger.LogError(ex, "Error occurred ...");
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Retrieve Work Item Fields ...
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("WorkItems/Fields")]
|
||||
public async Task<ActionResult<AzureListDto<AzureWorkItemFieldDto>>> GetWorkItemFields(
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetWorkItemFieldsAsync(
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return Ok(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
logger.LogError(ex, "Error occurred ...");
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Specified Project's WorkItem Types ...
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("projects/{id}/WorkItemTypes")]
|
||||
public async Task<ActionResult<AzureListDto<AzureWorkItemTypeDto>>> GetProjectWorkItemTypes(
|
||||
[FromRoute] Guid id,
|
||||
CancellationToken cancellationToken
|
||||
)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetProjectWorkItemTypesAsync(
|
||||
id: id,
|
||||
cancellationToken: cancellationToken
|
||||
);
|
||||
|
||||
//
|
||||
return Ok(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
logger.LogError(ex, "Error occurred ...");
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user