diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs index 6d7a1e67..ca7531ee 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/OrderingServiceRemoteServiceConsts.cs @@ -2,6 +2,6 @@ { public class OrderingServiceRemoteServiceConsts { - public const string RemoteServiceName = "OrderingService"; + public const string RemoteServiceName = "Ordering"; } } diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs new file mode 100644 index 00000000..41dd6783 --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs @@ -0,0 +1,34 @@ +// This file is automatically generated by ABP framework to use MVC Controllers from CSharp +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Http.Client; +using Volo.Abp.Http.Modeling; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Http.Client.ClientProxying; +using EShopOnAbp.OrderingService.Orders; + +// ReSharper disable once CheckNamespace +namespace EShopOnAbp.OrderingService.Orders.ClientProxies +{ + [Dependency(ReplaceServices = true)] + [ExposeServices(typeof(IOrderAppService), typeof(OrderClientProxy))] + public partial class OrderClientProxy : ClientProxyBase, IOrderAppService + { + public virtual async Task GetAsync(Guid id) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid), id } + }); + } + + public virtual async Task CreateAsync(OrderCreateDto input) + { + return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue + { + { typeof(OrderCreateDto), input } + }); + } + } +} diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.cs new file mode 100644 index 00000000..af3b463e --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.cs @@ -0,0 +1,8 @@ +// This file is part of OrderClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace EShopOnAbp.OrderingService.Orders.ClientProxies +{ + public partial class OrderClientProxy + { + } +} diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/Ordering-generate-proxy.json b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/Ordering-generate-proxy.json new file mode 100644 index 00000000..2d618d12 --- /dev/null +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/Ordering-generate-proxy.json @@ -0,0 +1,106 @@ +{ + "modules": { + "ordering": { + "rootPath": "ordering", + "remoteServiceName": "Ordering", + "controllers": { + "EShopOnAbp.OrderingService.Orders.OrderAppService": { + "controllerName": "Order", + "controllerGroupName": "Order", + "type": "EShopOnAbp.OrderingService.Orders.OrderAppService", + "interfaces": [ + { + "type": "Volo.Abp.Validation.IValidationEnabled" + }, + { + "type": "Volo.Abp.Auditing.IAuditingEnabled" + }, + { + "type": "Volo.Abp.GlobalFeatures.IGlobalFeatureCheckingEnabled" + }, + { + "type": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + } + ], + "actions": { + "GetAsyncById": { + "uniqueName": "GetAsyncById", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/ordering/order/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": [], + "bindingSourceId": "Path", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.OrderingService.Orders.OrderDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/ordering/order", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.OrderCreateDto, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderCreateDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.OrderingService.Orders.OrderDto", + "typeSimple": "EShopOnAbp.OrderingService.Orders.OrderDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + } + } + } + } + } + }, + "types": {} +} \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs index 1b403c26..e52daa5c 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/OrderingServiceHttpApiClientModule.cs @@ -12,7 +12,7 @@ namespace EShopOnAbp.OrderingService { public override void ConfigureServices(ServiceConfigurationContext context) { - context.Services.AddStaticHttpClientProxies( + context.Services.AddHttpClientProxies( typeof(OrderingServiceApplicationContractsModule).Assembly, OrderingServiceRemoteServiceConsts.RemoteServiceName ); @@ -21,7 +21,6 @@ namespace EShopOnAbp.OrderingService { options.FileSets.AddEmbedded(); }); - } } -} +} \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs index 6e89ade8..41d0ba31 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Host/OrderingServiceHttpApiHostModule.cs @@ -10,6 +10,7 @@ using System; using System.Collections.Generic; using System.Linq; using Volo.Abp; +using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Modularity; using Volo.Abp.Threading; @@ -30,7 +31,6 @@ namespace EShopOnAbp.OrderingService var configuration = context.Services.GetConfiguration(); JwtBearerConfigurationHelper.Configure(context, "OrderingService"); - // SwaggerConfigurationHelper.Configure(context, "Catalog Service API"); SwaggerWithAuthConfigurationHelper.Configure( context: context, @@ -60,6 +60,16 @@ namespace EShopOnAbp.OrderingService .AllowCredentials(); }); }); + + // TODO: Crate controller instead of auto-controller configuration + Configure(options => + { + options.ConventionalControllers.Create(typeof(OrderingServiceApplicationModule).Assembly, opts => + { + opts.RootPath = OrderingServiceRemoteServiceConsts.RemoteServiceName.ToLowerInvariant(); + opts.RemoteServiceName = OrderingServiceRemoteServiceConsts.RemoteServiceName; + }); + }); } public override void OnApplicationInitialization(ApplicationInitializationContext context)