From 2e21c438d4ca73d5114b93a4cde4b95c49238b17 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Thu, 6 Jan 2022 16:08:26 +0300 Subject: [PATCH] Updated order appservice static proxy generation Static proxy generation fails when application service method doesn't end with "Async". --- .../Orders/IOrderAppService.cs | 2 +- .../Orders/OrderAppService.cs | 2 +- .../OrderClientProxy.Generated.cs | 9 +++++ ...roxy.json => ordering-generate-proxy.json} | 37 +++++++++++++++++++ ...nAbp.OrderingService.HttpApi.Client.csproj | 4 ++ 5 files changed, 52 insertions(+), 2 deletions(-) rename services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/{Ordering-generate-proxy.json => ordering-generate-proxy.json} (70%) diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs index a14f75b8..0bba7286 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs @@ -9,5 +9,5 @@ public interface IOrderAppService : IApplicationService { Task CreateAsync(OrderCreateDto input); Task GetAsync(Guid id); - Task> GetMyOrders(GetMyOrdersInput input); + Task> GetMyOrdersAsync(GetMyOrdersInput input); } \ No newline at end of file diff --git a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs index d669f6cc..9d73a302 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs @@ -30,7 +30,7 @@ public class OrderAppService : ApplicationService, IOrderAppService return CreateOrderDtoMapping(order); } - public async Task> GetMyOrders(GetMyOrdersInput input) + public async Task> GetMyOrdersAsync(GetMyOrdersInput input) { ISpecification specification = null; if (!input.Filter.IsNullOrEmpty()) 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 index 41dd6783..daa66900 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs @@ -7,6 +7,7 @@ using Volo.Abp.Http.Modeling; using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; using EShopOnAbp.OrderingService.Orders; +using System.Collections.Generic; // ReSharper disable once CheckNamespace namespace EShopOnAbp.OrderingService.Orders.ClientProxies @@ -23,6 +24,14 @@ namespace EShopOnAbp.OrderingService.Orders.ClientProxies }); } + public virtual async Task> GetMyOrdersAsync(GetMyOrdersInput input) + { + return await RequestAsync>(nameof(GetMyOrdersAsync), new ClientProxyRequestTypeValue + { + { typeof(GetMyOrdersInput), input } + }); + } + public virtual async Task CreateAsync(OrderCreateDto input) { return await RequestAsync(nameof(CreateAsync), new ClientProxyRequestTypeValue 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 similarity index 70% rename from services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/Ordering-generate-proxy.json rename to services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json index 2d618d12..99f70346 100644 --- 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 @@ -60,6 +60,43 @@ "allowAnonymous": null, "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" }, + "GetMyOrdersAsyncByInput": { + "uniqueName": "GetMyOrdersAsyncByInput", + "name": "GetMyOrdersAsync", + "httpMethod": "GET", + "url": "api/ordering/order/my-orders", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput, EShopOnAbp.OrderingService.Application.Contracts", + "type": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput", + "typeSimple": "EShopOnAbp.OrderingService.Orders.GetMyOrdersInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Filter", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.Collections.Generic.List", + "typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderDto]" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService" + }, "CreateAsyncByInput": { "uniqueName": "CreateAsyncByInput", "name": "CreateAsync", diff --git a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj index 2732b332..e376a960 100644 --- a/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj +++ b/services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj @@ -17,4 +17,8 @@ + + + +