uhnit testing from vscode
This commit is contained in:
@ -24,7 +24,7 @@ namespace isnd.Controllers
|
||||
const int maxTake = 100;
|
||||
|
||||
const string defaultSemVer = "2.0.0";
|
||||
private readonly Resource[] _ressources;
|
||||
private readonly Resource[] _resources;
|
||||
private readonly ILogger<PackagesController> _logger;
|
||||
private readonly IDataProtector _protector;
|
||||
|
||||
@ -48,13 +48,13 @@ namespace isnd.Controllers
|
||||
_dbContext = dbContext;
|
||||
_packageManager = pm;
|
||||
_unleashĈlient = unleashĈlient;
|
||||
_ressources = _packageManager.GetResources(_unleashĈlient).ToArray();
|
||||
_resources = _packageManager.GetResources(_unleashĈlient).ToArray();
|
||||
}
|
||||
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.Base)]
|
||||
public IActionResult ApiIndex()
|
||||
{
|
||||
return Ok(_ressources);
|
||||
return Ok(new { version = "3.0.0", resources = _resources });
|
||||
}
|
||||
|
||||
// GET /autocomplete?id=isn.protocol&prerelease=true
|
||||
|
@ -1,10 +1,17 @@
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
public class Resource
|
||||
{
|
||||
public string id {get; set; }
|
||||
public string type {get; set; }
|
||||
public string comment {get; set; }
|
||||
[JsonProperty("@id")]
|
||||
public string Id {get; set; }
|
||||
|
||||
[JsonProperty("@type")]
|
||||
public string Type {get; set; }
|
||||
|
||||
[JsonProperty("comment")]
|
||||
public string Comment {get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -40,43 +40,43 @@ namespace isnd.Services
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
id = extUrl + ApiConfig.Publish,
|
||||
type = "PackagePublish/2.0.0",
|
||||
comment = "Package Publish service"
|
||||
Id = extUrl + ApiConfig.Publish,
|
||||
Type = "PackagePublish/2.0.0",
|
||||
Comment = "Package Publish service"
|
||||
});
|
||||
// under dev, only leash in release mode
|
||||
if (unleashClient.IsEnabled("pkg-get", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
id = extUrl + ApiConfig.Base,
|
||||
type = "PackageBaseAddress/3.0.0",
|
||||
comment = "Package Base Address service"
|
||||
Id = extUrl + ApiConfig.Base,
|
||||
Type = "PackageBaseAddress/3.0.0",
|
||||
Comment = "Package Base Address service"
|
||||
});
|
||||
if (unleashClient.IsEnabled("pkg-autocomplete", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
id = extUrl + ApiConfig.AutoComplete,
|
||||
type = "SearchAutocompleteService/3.5.0",
|
||||
comment = "Auto complete service"
|
||||
Id = extUrl + ApiConfig.AutoComplete,
|
||||
Type = "SearchAutocompleteService/3.5.0",
|
||||
Comment = "Auto complete service"
|
||||
});
|
||||
if (unleashClient.IsEnabled("pkg-search", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
id = extUrl + ApiConfig.Search,
|
||||
type = "SearchQueryService/3.5.0",
|
||||
comment = "Search Query service"
|
||||
Id = extUrl + ApiConfig.Search,
|
||||
Type = "SearchQueryService/3.5.0",
|
||||
Comment = "Search Query service"
|
||||
});
|
||||
|
||||
if (unleashClient.IsEnabled("pkg-catalog", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
id = extUrl + ApiConfig.Catalog,
|
||||
type = "Catalog/3.0.0",
|
||||
comment = "Package Catalog Index"
|
||||
Id = extUrl + ApiConfig.Catalog,
|
||||
Type = "Catalog/3.0.0",
|
||||
Comment = "Package Catalog Index"
|
||||
});
|
||||
return res;
|
||||
|
||||
|
Reference in New Issue
Block a user