Swamy/01jan2021-small-refactoring (#1570)
* Update Startup.cs * Removed commented code * Update UrlsConfig.cs * Small Refactoring * Removed Commented Code * Small Refactoring
This commit is contained in:
parent
600d0aa456
commit
6f8f247fe9
@ -42,7 +42,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
|
||||
|
||||
public string Buyer { get; set; }
|
||||
|
||||
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
|
||||
public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
|
||||
|
||||
public class UpdateBasketItemsRequest
|
||||
{
|
||||
|
||||
|
||||
public string BasketId { get; set; }
|
||||
|
||||
public ICollection<UpdateBasketItemData> Updates { get; set; }
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Models
|
||||
{
|
||||
|
||||
|
||||
public class UpdateBasketRequest
|
||||
{
|
||||
public string BuyerId { get; set; }
|
||||
|
@ -27,7 +27,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
|
||||
{
|
||||
return await GrpcCallerService.CallService(_urls.GrpcBasket, async channel =>
|
||||
{
|
||||
|
||||
|
||||
var client = new Basket.BasketClient(channel);
|
||||
_logger.LogDebug("grpc client created, request = {@id}", id);
|
||||
var response = await client.GetBasketByIdAsync(new BasketRequest { Id = id });
|
||||
|
@ -36,7 +36,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
|
||||
public async Task<IEnumerable<CatalogItem>> GetCatalogItemsAsync(IEnumerable<int> ids)
|
||||
{
|
||||
|
||||
return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel=>
|
||||
return await GrpcCallerService.CallService(_urls.GrpcCatalog, async channel =>
|
||||
{
|
||||
var client = new CatalogClient(channel);
|
||||
var request = new CatalogItemsRequest { Ids = string.Join(",", ids), PageIndex = 1, PageSize = 10 };
|
||||
|
@ -15,15 +15,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
|
||||
|
||||
var channel = GrpcChannel.ForAddress(urlGrpc);
|
||||
|
||||
/*
|
||||
using var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target);
|
||||
|
||||
try
|
||||
@ -47,13 +38,6 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator.Services
|
||||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
||||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true);
|
||||
|
||||
/*
|
||||
using var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
|
||||
};
|
||||
*/
|
||||
|
||||
var channel = GrpcChannel.ForAddress(urlGrpc);
|
||||
|
||||
Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target);
|
||||
|
@ -20,7 +20,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config
|
||||
public class BasketOperations
|
||||
{
|
||||
public static string GetItemById(string id) => $"/api/v1/basket/{id}";
|
||||
|
||||
|
||||
public static string UpdateBasket() => "/api/v1/basket";
|
||||
}
|
||||
|
||||
|
@ -15,15 +15,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
||||
|
||||
var channel = GrpcChannel.ForAddress(urlGrpc);
|
||||
|
||||
/*
|
||||
using var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
|
||||
Log.Information("Creating grpc client base address urlGrpc ={@urlGrpc}, BaseAddress={@BaseAddress} ", urlGrpc, channel.Target);
|
||||
|
||||
try
|
||||
@ -49,13 +40,6 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services
|
||||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
||||
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2Support", true);
|
||||
|
||||
/*
|
||||
using var httpClientHandler = new HttpClientHandler
|
||||
{
|
||||
ServerCertificateCustomValidationCallback = (message, cert, chain, errors) => { return true; }
|
||||
};
|
||||
*/
|
||||
|
||||
var channel = GrpcChannel.ForAddress(urlGrpc);
|
||||
|
||||
Log.Debug("Creating grpc client base address {@httpClient.BaseAddress} ", channel.Target);
|
||||
|
@ -63,7 +63,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
|
||||
{
|
||||
app.UseDeveloperExceptionPage();
|
||||
}
|
||||
|
||||
|
||||
app.UseHttpsRedirection();
|
||||
|
||||
app.UseSwagger().UseSwaggerUI(c =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user