Moved namespaces to globalusing shopping aggregator
This commit is contained in:
		
							parent
							
								
									7b1764261e
								
							
						
					
					
						commit
						a12fbcaf09
					
				| @ -1,7 +1,4 @@ | ||||
| using System.Collections.Generic; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | ||||
| 
 | ||||
| public class UrlsConfig | ||||
| { | ||||
| @ -42,4 +39,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config | ||||
|     public string GrpcOrdering { get; set; } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,14 +1,5 @@ | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| using System; | ||||
| using System.Linq; | ||||
| using System.Net; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
| { | ||||
| [Route("api/v1/[controller]")]
 | ||||
| [Authorize] | ||||
| [ApiController] | ||||
| @ -161,4 +152,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
|         return Ok(); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,5 @@ | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
| { | ||||
| [Route("")] | ||||
| public class HomeController : Controller | ||||
| { | ||||
| @ -11,4 +9,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
|         return new RedirectResult("~/swagger"); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,12 +1,5 @@ | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| using System.Net; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
| { | ||||
| [Route("api/v1/[controller]")]
 | ||||
| [Authorize] | ||||
| [ApiController] | ||||
| @ -41,4 +34,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Controllers | ||||
|         return await _orderingService.GetOrderDraftAsync(basket); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,10 +1,4 @@ | ||||
| using Microsoft.AspNetCore.Authorization; | ||||
| using Microsoft.OpenApi.Models; | ||||
| using Swashbuckle.AspNetCore.SwaggerGen; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters | ||||
| { | ||||
|     namespace Basket.API.Infrastructure.Filters | ||||
|     { | ||||
| @ -36,4 +30,5 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @ -1,10 +1,5 @@ | ||||
| using Grpc.Core; | ||||
| using Grpc.Core.Interceptors; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure | ||||
| { | ||||
| public class GrpcExceptionInterceptor : Interceptor | ||||
| { | ||||
|     private readonly ILogger<GrpcExceptionInterceptor> _logger; | ||||
| @ -38,4 +33,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure | ||||
|         } | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,13 +1,5 @@ | ||||
| using Microsoft.AspNetCore.Authentication; | ||||
| using Microsoft.AspNetCore.Http; | ||||
| using System.Collections.Generic; | ||||
| using System.Net.Http; | ||||
| using System.Net.Http.Headers; | ||||
| using System.Threading; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure | ||||
| { | ||||
| public class HttpClientAuthorizationDelegatingHandler | ||||
|         : DelegatingHandler | ||||
| { | ||||
| @ -46,4 +38,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure | ||||
|             .GetTokenAsync(ACCESS_TOKEN); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class AddBasketItemRequest | ||||
| { | ||||
| @ -15,4 +14,3 @@ | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,4 @@ | ||||
| using System.Collections.Generic; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class BasketData | ||||
| { | ||||
| @ -19,4 +16,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class BasketDataItem | ||||
| { | ||||
| @ -17,5 +16,3 @@ | ||||
| 
 | ||||
|     public string PictureUrl { get; set; } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class CatalogItem | ||||
| { | ||||
| @ -12,4 +11,4 @@ | ||||
|     public string PictureUri { get; set; } | ||||
| } | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
|  | ||||
| @ -1,8 +1,4 @@ | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class OrderData | ||||
| { | ||||
| @ -45,4 +41,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
|     public List<OrderItemData> OrderItems { get; } = new List<OrderItemData>(); | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class OrderItemData | ||||
| { | ||||
| @ -15,5 +14,3 @@ | ||||
| 
 | ||||
|     public string PictureUrl { get; set; } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,4 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class UpdateBasketItemData | ||||
| { | ||||
| @ -12,5 +11,3 @@ | ||||
|         NewQty = 0; | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,4 @@ | ||||
| using System.Collections.Generic; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class UpdateBasketItemsRequest | ||||
| { | ||||
| @ -14,5 +11,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
|         Updates = new List<UpdateBasketItemData>(); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,7 +1,4 @@ | ||||
| using System.Collections.Generic; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class UpdateBasketRequest | ||||
| { | ||||
| @ -9,5 +6,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| 
 | ||||
|     public IEnumerable<UpdateBasketRequestItemData> Items { get; set; } | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models | ||||
| { | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| 
 | ||||
| public class UpdateBasketRequestItemData | ||||
| { | ||||
|     public string Id { get; set; }          // Basket id | ||||
| @ -8,4 +8,3 @@ | ||||
| 
 | ||||
|     public int Quantity { get; set; }       // Quantity | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,9 +1,4 @@ | ||||
| using Microsoft.AspNetCore; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator; | ||||
| using Serilog; | ||||
| 
 | ||||
| BuildWebHost(args).Run(); | ||||
| BuildWebHost(args).Run(); | ||||
| 
 | ||||
| IWebHost BuildWebHost(string[] args) => | ||||
|     WebHost | ||||
|  | ||||
| @ -1,11 +1,5 @@ | ||||
| using GrpcBasket; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public class BasketService : IBasketService | ||||
| { | ||||
|     private readonly Basket.BasketClient _basketClient; | ||||
| @ -100,4 +94,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
|         return map; | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,12 +1,5 @@ | ||||
| using CatalogApi; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using System.Collections.Generic; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public class CatalogService : ICatalogService | ||||
| { | ||||
|     private readonly Catalog.CatalogClient _client; | ||||
| @ -49,4 +42,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
|         }; | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,12 +1,8 @@ | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public interface IBasketService | ||||
| { | ||||
|     Task<BasketData> GetById(string id); | ||||
| 
 | ||||
|     Task UpdateAsync(BasketData currentBasket); | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,13 +1,8 @@ | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using System.Collections.Generic; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public interface ICatalogService | ||||
| { | ||||
|     Task<CatalogItem> GetCatalogItemAsync(int id); | ||||
| 
 | ||||
|     Task<IEnumerable<CatalogItem>> GetCatalogItemsAsync(IEnumerable<int> ids); | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,10 +1,6 @@ | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public interface IOrderApiClient | ||||
| { | ||||
|     Task<OrderData> GetOrderDraftFromBasketAsync(BasketData basket); | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,10 +1,6 @@ | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public interface IOrderingService | ||||
| { | ||||
|     Task<OrderData> GetOrderDraftAsync(BasketData basketData); | ||||
| } | ||||
| } | ||||
| @ -1,13 +1,5 @@ | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Microsoft.Extensions.Options; | ||||
| using System.Net.Http; | ||||
| using System.Threading.Tasks; | ||||
| using System.Text.Json; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public class OrderApiClient : IOrderApiClient | ||||
| { | ||||
|     private readonly HttpClient _apiClient; | ||||
| @ -37,4 +29,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
|         }); | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,11 +1,5 @@ | ||||
| using GrpcOrdering; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Models; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using System.Linq; | ||||
| using System.Threading.Tasks; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
| { | ||||
| public class OrderingService : IOrderingService | ||||
| { | ||||
|     private readonly OrderingGrpc.OrderingGrpcClient _orderingGrpcClient; | ||||
| @ -76,4 +70,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| } | ||||
|  | ||||
| @ -1,30 +1,5 @@ | ||||
| using CatalogApi; | ||||
| using Devspaces.Support; | ||||
| using GrpcBasket; | ||||
| using GrpcOrdering; | ||||
| using HealthChecks.UI.Client; | ||||
| using Microsoft.AspNetCore.Authentication.JwtBearer; | ||||
| using Microsoft.AspNetCore.Builder; | ||||
| using Microsoft.AspNetCore.Diagnostics.HealthChecks; | ||||
| using Microsoft.AspNetCore.Hosting; | ||||
| using Microsoft.AspNetCore.Http; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Config; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Filters.Basket.API.Infrastructure.Filters; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Infrastructure; | ||||
| using Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator.Services; | ||||
| using Microsoft.Extensions.Configuration; | ||||
| using Microsoft.Extensions.DependencyInjection; | ||||
| using Microsoft.Extensions.Diagnostics.HealthChecks; | ||||
| using Microsoft.Extensions.Hosting; | ||||
| using Microsoft.Extensions.Logging; | ||||
| using Microsoft.Extensions.Options; | ||||
| using Microsoft.OpenApi.Models; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IdentityModel.Tokens.Jwt; | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator; | ||||
| 
 | ||||
| namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator | ||||
| { | ||||
| public class Startup | ||||
| { | ||||
|     public Startup(IConfiguration configuration) | ||||
| @ -222,4 +197,3 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator | ||||
|         return services; | ||||
|     } | ||||
| } | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user