Browse Source

Update NuGetService.cs

pull/10363/head
Yunus Emre Kalkan 5 years ago
parent
commit
e1ce1af42b
  1. 30
      framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs

30
framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/NuGet/NuGetService.cs

@ -6,7 +6,6 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Volo.Abp.Cli.Auth;
using Volo.Abp.Cli.Http;
using Volo.Abp.Cli.Licensing;
using Volo.Abp.Cli.ProjectBuilding;
@ -127,35 +126,6 @@ namespace Volo.Abp.Cli.NuGet
return CliUrls.GetNuGetPackageInfoUrl(_apiKeyResult.ApiKey, packageId);
}
private async Task<List<string>> GetProPackageListAsync()
{
var url = $"{CliUrls.WwwAbpIo}api/app/nugetPackage/proPackageNames";
var client = _cliHttpClientFactory.CreateClient(needsAuthentication: true);
using (var responseMessage = await client.GetHttpResponseMessageWithRetryAsync(
url: url,
cancellationToken: CancellationTokenProvider.Token,
logger: Logger
))
{
if (responseMessage.IsSuccessStatusCode)
{
return JsonSerializer.Deserialize<List<string>>(await responseMessage.Content.ReadAsStringAsync());
}
var exceptionMessage = "Remote server returns '" + (int)responseMessage.StatusCode + "-" + responseMessage.ReasonPhrase + "'. ";
var remoteServiceErrorMessage = await RemoteServiceExceptionHandler.GetAbpRemoteServiceErrorAsync(responseMessage);
if (remoteServiceErrorMessage != null)
{
exceptionMessage += remoteServiceErrorMessage;
}
Logger.LogError(exceptionMessage);
return null;
}
}
public class NuGetVersionResultDto
{
[JsonProperty("versions")]

Loading…
Cancel
Save