Browse Source

Updated order appservice static proxy generation

Static proxy generation fails when application service method doesn't end with "Async".
pull/56/head
Galip Tolga Erdem 5 years ago
parent
commit
2e21c438d4
  1. 2
      services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs
  2. 2
      services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs
  3. 9
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/OrderClientProxy.Generated.cs
  4. 37
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/ordering-generate-proxy.json
  5. 4
      services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj

2
services/ordering/src/EShopOnAbp.OrderingService.Application.Contracts/Orders/IOrderAppService.cs

@ -9,5 +9,5 @@ public interface IOrderAppService : IApplicationService
{
Task<OrderDto> CreateAsync(OrderCreateDto input);
Task<OrderDto> GetAsync(Guid id);
Task<List<OrderDto>> GetMyOrders(GetMyOrdersInput input);
Task<List<OrderDto>> GetMyOrdersAsync(GetMyOrdersInput input);
}

2
services/ordering/src/EShopOnAbp.OrderingService.Application/Orders/OrderAppService.cs

@ -30,7 +30,7 @@ public class OrderAppService : ApplicationService, IOrderAppService
return CreateOrderDtoMapping(order);
}
public async Task<List<OrderDto>> GetMyOrders(GetMyOrdersInput input)
public async Task<List<OrderDto>> GetMyOrdersAsync(GetMyOrdersInput input)
{
ISpecification<Order> specification = null;
if (!input.Filter.IsNullOrEmpty())

9
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<List<OrderDto>> GetMyOrdersAsync(GetMyOrdersInput input)
{
return await RequestAsync<List<OrderDto>>(nameof(GetMyOrdersAsync), new ClientProxyRequestTypeValue
{
{ typeof(GetMyOrdersInput), input }
});
}
public virtual async Task<OrderDto> CreateAsync(OrderCreateDto input)
{
return await RequestAsync<OrderDto>(nameof(CreateAsync), new ClientProxyRequestTypeValue

37
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/ClientProxies/Ordering-generate-proxy.json → 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<EShopOnAbp.OrderingService.Orders.OrderDto>",
"typeSimple": "[EShopOnAbp.OrderingService.Orders.OrderDto]"
},
"allowAnonymous": null,
"implementFrom": "EShopOnAbp.OrderingService.Orders.IOrderAppService"
},
"CreateAsyncByInput": {
"uniqueName": "CreateAsyncByInput",
"name": "CreateAsync",

4
services/ordering/src/EShopOnAbp.OrderingService.HttpApi.Client/EShopOnAbp.OrderingService.HttpApi.Client.csproj

@ -17,4 +17,8 @@
<Content Remove="**\*generate-proxy.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="ClientProxies" />
</ItemGroup>
</Project>

Loading…
Cancel
Save