Compilation warns
This commit is contained in:
31
src/isnd/Controllers/Packages/ApiIndex.cs
Normal file
31
src/isnd/Controllers/Packages/ApiIndex.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Microsoft.AspNetCore.Authorization;
|
||||
using Microsoft.AspNetCore.DataProtection;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using NuGet.Versioning;
|
||||
using isnd.Data;
|
||||
using isnd.Entities;
|
||||
using Unleash;
|
||||
using isnd.Services;
|
||||
using isnd.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
using isnd.Interfaces;
|
||||
using isn.Abstract;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
public partial class PackagesController : Controller
|
||||
{
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.Base)]
|
||||
public IActionResult ApiIndex()
|
||||
{
|
||||
return Ok(new ApiIndexViewModel{ Version = PackageManager.BASE_API_LEVEL, Resources = _resources });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using isnd.Services;
|
||||
using isnd.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace isnd.Controllers
|
@ -3,7 +3,7 @@ using System.Threading.Tasks;
|
||||
using isnd.Data.Catalog;
|
||||
using isnd.Helpers;
|
||||
using isnd.Services;
|
||||
using isnd.ViewModels;
|
||||
using isnd.Entities;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
@ -49,12 +49,5 @@ namespace isnd.Controllers
|
||||
_unleashĈlient = unleashĈlient;
|
||||
_resources = _packageManager.GetResources(_unleashĈlient).ToArray();
|
||||
}
|
||||
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.Base)]
|
||||
public IActionResult ApiIndex()
|
||||
{
|
||||
return Ok(new ApiIndexViewModel{ Version = PackageManager.BASE_API_LEVEL, Resources = _resources });
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -1,6 +1,7 @@
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using isnd.Helpers;
|
||||
using isnd.Entities;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using isnd.Attributes;
|
||||
namespace isnd.Controllers
|
@ -2,15 +2,13 @@ using System.ComponentModel.DataAnnotations;
|
||||
using System.IO;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using isnd.Attributes;
|
||||
using isnd.Entities;
|
||||
namespace isnd.Controllers
|
||||
{
|
||||
|
||||
public partial class PackagesController
|
||||
{
|
||||
// TODO GET GET {@id}/{LOWER_ID}/{LOWER_VERSION}/{LOWER_ID}.{LOWER_VERSION}.nupkg
|
||||
// LOWER_ID URL string yes The package ID, lowercase
|
||||
// LOWER_VERSION URL string yes The package version, normalized and lowercased
|
||||
// response 200 : the package
|
||||
// Web get nupkg
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.Get + "/{id}/{lower}/{idf}-{lowerf}.nupkg")]
|
||||
public IActionResult GetPackage(
|
||||
[FromRoute][SafeName][Required] string id,
|
||||
@ -30,8 +28,7 @@ namespace isnd.Controllers
|
||||
return File(pkgfi.OpenRead(), "application/zip; charset=binary");
|
||||
}
|
||||
|
||||
// TODO GET {@id}/{LOWER_ID}/{LOWER_VERSION}/{LOWER_ID}.nuspec
|
||||
// response 200 : the nuspec
|
||||
// Web get spec
|
||||
[HttpGet(_pkgRootPrefix + ApiConfig.Get + "/{id}/{lower}/{idf}-{lowerf}.nuspec")]
|
||||
public IActionResult GetNuspec(
|
||||
[FromRoute][SafeName][Required] string id,
|
@ -1,5 +1,6 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using NuGet.Versioning;
|
||||
using isnd.Entities;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
@ -13,6 +13,7 @@ using NuGet.Packaging.Core;
|
||||
using NuGet.Versioning;
|
||||
using isnd.Data;
|
||||
using isnd.Helpers;
|
||||
using isnd.Entities;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using isnd.Data.Catalog;
|
||||
|
@ -2,6 +2,7 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using isnd.Entities;
|
||||
|
||||
namespace isnd.Controllers
|
||||
{
|
@ -10,7 +10,7 @@ namespace isnd.Controllers
|
||||
|
||||
public partial class PackagesController
|
||||
{
|
||||
// GET: PackageVersion
|
||||
// Web search
|
||||
public async Task<IActionResult> Index(PackageIndexViewModel model)
|
||||
{
|
||||
var applicationDbContext = _dbContext.Packages.Include(p => p.Versions).Where(
|
@ -1,4 +1,4 @@
|
||||
namespace isnd
|
||||
namespace isnd.Entities
|
||||
{
|
||||
public static class ApiConfig
|
||||
{
|
||||
@ -15,5 +15,7 @@ namespace isnd
|
||||
|
||||
public const string Delete = "delete";
|
||||
|
||||
public const string Registration = "registration";
|
||||
|
||||
}
|
||||
}
|
@ -71,33 +71,23 @@ namespace isnd.Services
|
||||
Type = "SearchQueryService/" + BASE_API_LEVEL,
|
||||
Comment = "Search Query service"
|
||||
});
|
||||
/*
|
||||
{
|
||||
"@id": "https://api-v2v3search-0.nuget.org/query",
|
||||
"@type": "SearchQueryService/3.0.0-rc",
|
||||
"comment": "Query endpoint of NuGet Search service (primary) used by RC clients"
|
||||
},
|
||||
|
||||
if (unleashClient.IsEnabled("pkg-catalog", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
Id = extUrl + ApiConfig.Catalog,
|
||||
Type = "Catalog/3.0.0",
|
||||
Type = "Catalog/"+ BASE_API_LEVEL,
|
||||
Comment = "Package Catalog Index"
|
||||
});*/
|
||||
|
||||
/* TODO ? {
|
||||
|
||||
"@id": "https://api.nuget.org/v3/registration5-gz-semver2/",
|
||||
"@type": "RegistrationsBaseUrl/Versioned",
|
||||
"clientVersion": "4.3.0-alpha",
|
||||
"comment": "Base URL of Azure storage where NuGet package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
|
||||
|
||||
},
|
||||
*/
|
||||
});
|
||||
if (unleashClient.IsEnabled("pkg-registration", false))
|
||||
res.Add(
|
||||
new Resource
|
||||
{
|
||||
Id = extUrl + ApiConfig.Registration,
|
||||
Type = "Catalog/" + BASE_API_LEVEL,
|
||||
Comment = "Base URL of storage where isn package registration info is stored in GZIP format. This base URL includes SemVer 2.0.0 packages."
|
||||
});
|
||||
return res;
|
||||
|
||||
}
|
||||
|
||||
public PackageIndexViewModel SearchByName(string query,
|
||||
|
@ -6,6 +6,7 @@
|
||||
<PackageVersion>1.0.1</PackageVersion>
|
||||
<IsPackable>true</IsPackable>
|
||||
<PackageLicenseExpression>WTFPL</PackageLicenseExpression>
|
||||
<NoWarn>NETSDK1138</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
Reference in New Issue
Block a user