endpoint implementation ...
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
using xApi.Interfaces;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using xApi.Models;
|
||||
|
||||
namespace xApi.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("1.0")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
[Route("api/v{version:apiVersion}/[controller]")]
|
||||
public class AzureController : ControllerBase
|
||||
{
|
||||
//
|
||||
@@ -23,12 +24,12 @@ namespace xApi.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get connection data from Azure Services ...
|
||||
/// Get Connection data from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("ConnectionData")]
|
||||
public async Task<ActionResult<string>> GetConnectionData(
|
||||
public async Task<ActionResult<AzureConnectionDataDto>> GetConnectionData(
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
@@ -51,12 +52,12 @@ namespace xApi.Controllers
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get projects from Azure Services ...
|
||||
/// Get Projects from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetProjects")]
|
||||
public async Task<ActionResult<string>> GetProjects(
|
||||
public async Task<ActionResult<AzureListDto<AzureProjectDto>>> GetProjects(
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
@@ -77,5 +78,61 @@ namespace xApi.Controllers
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get Repositories from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetRepositories")]
|
||||
public async Task<ActionResult<AzureListDto<AzureRepositoryDto>>> GetRepositories(
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetRepositoriesAsync(cancellationToken);
|
||||
|
||||
//
|
||||
return Ok(response);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//
|
||||
logger.LogError(ex, "Error occurred ...");
|
||||
return StatusCode(500, "Internal server error");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get WorkItem Types from Azure Services ...
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("GetWorkItemTypes")]
|
||||
public async Task<ActionResult<string>> GetWorkItemTypes(
|
||||
CancellationToken cancellationToken = default
|
||||
)
|
||||
{
|
||||
//
|
||||
try
|
||||
{
|
||||
//
|
||||
var response = await azureServices
|
||||
.GetWorkItemTypesAsync(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