settings
This commit is contained in:
parent
18b67bd725
commit
282b0277ae
10 changed files with 51 additions and 34 deletions
|
|
@ -44,13 +44,29 @@ namespace isnd.Controllers
|
|||
return Ok(leaf.First());
|
||||
}
|
||||
|
||||
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.CatalogLeaf + "/{id}/{version}/{lower}/index.json")]
|
||||
public IActionResult CatalogLeaf(string id, string pversion, string lower)
|
||||
/// <summary>
|
||||
/// Catalog Leaf,
|
||||
/// Get info about given package id, and optional lower part .
|
||||
/// </summary>
|
||||
/// <param name="id">Given Package Id</param>
|
||||
/// <param name="lower">lower part, a semantic version for the package,
|
||||
/// and eventually followed by the "package type"</param>
|
||||
/// <returns>Info about concerned packages, in order to be able and download them</returns>
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.CatalogLeaf + "/{id}/{lower?}/index.json")]
|
||||
public IActionResult CatalogLeaf(string id, string lower = null)
|
||||
{
|
||||
|
||||
Data.PackageVersion[] pkgvs = null;
|
||||
if (lower == "{lower}") lower = null;
|
||||
bool askForindex = lower == null;
|
||||
var pkgvs = this.packageManager.GetCatalogLeaf(id, pversion, lower).ToArray();
|
||||
if (lower != null && lower.IndexOf('/') > 0 )
|
||||
{
|
||||
string version = lower.Substring(lower.IndexOf('/'));
|
||||
pkgvs = this.packageManager.GetCatalogLeaf(id, version, lower).ToArray();
|
||||
}
|
||||
else {
|
||||
pkgvs = this.packageManager.GetCatalogLeaf(id, null, lower).ToArray();
|
||||
}
|
||||
|
||||
if (pkgvs.Count() == 0) return NotFound();
|
||||
List<string> types = pkgvs.Select(
|
||||
v => v.Type ?? "Dependency"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue