From c07bb8c1d8255d0d8f5a7f8fb8d8c1d0bf8638f9 Mon Sep 17 00:00:00 2001 From: Galip Tolga Erdem Date: Wed, 16 Feb 2022 12:09:12 +0300 Subject: [PATCH] generated proxies for public web application --- .../BasketClientProxy.Generated.cs | 41 +++++ .../ClientProxies/BasketClientProxy.cs | 7 + .../ClientProxies/basket-generate-proxy.json | 167 ++++++++++++++++++ .../Components/Toolbar/Cart/Default.cshtml | 4 +- .../EShopOnAbp.PublicWeb.csproj | 9 + .../EShopOnAbpPublicWebModule.cs | 17 +- 6 files changed, 242 insertions(+), 3 deletions(-) create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.Generated.cs create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.cs create mode 100644 apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/basket-generate-proxy.json diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.Generated.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.Generated.cs new file mode 100644 index 00000000..868ef629 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.Generated.cs @@ -0,0 +1,41 @@ +// 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.BasketService.Services; + +// ReSharper disable once CheckNamespace +namespace EShopOnAbp.BasketService.Services.ClientProxies; + +[Dependency(ReplaceServices = true)] +[ExposeServices(typeof(IBasketAppService), typeof(BasketClientProxy))] +public partial class BasketClientProxy : ClientProxyBase, IBasketAppService +{ + public virtual async Task GetAsync(Guid? anonymousUserId) + { + return await RequestAsync(nameof(GetAsync), new ClientProxyRequestTypeValue + { + { typeof(Guid?), anonymousUserId } + }); + } + + public virtual async Task AddProductAsync(AddProductDto input) + { + return await RequestAsync(nameof(AddProductAsync), new ClientProxyRequestTypeValue + { + { typeof(AddProductDto), input } + }); + } + + public virtual async Task RemoveProductAsync(RemoveProductDto input) + { + return await RequestAsync(nameof(RemoveProductAsync), new ClientProxyRequestTypeValue + { + { typeof(RemoveProductDto), input } + }); + } +} diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.cs new file mode 100644 index 00000000..eceec230 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/BasketClientProxy.cs @@ -0,0 +1,7 @@ +// This file is part of BasketClientProxy, you can customize it here +// ReSharper disable once CheckNamespace +namespace EShopOnAbp.BasketService.Services.ClientProxies; + +public partial class BasketClientProxy +{ +} diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/basket-generate-proxy.json b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/basket-generate-proxy.json new file mode 100644 index 00000000..1f8a157d --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/ClientProxies/basket-generate-proxy.json @@ -0,0 +1,167 @@ +{ + "modules": { + "basket": { + "rootPath": "basket", + "remoteServiceName": "Basket", + "controllers": { + "EShopOnAbp.BasketService.Services.BasketAppService": { + "controllerName": "Basket", + "controllerGroupName": "Basket", + "type": "EShopOnAbp.BasketService.Services.BasketAppService", + "interfaces": [ + { + "type": "Volo.Abp.Validation.IValidationEnabled" + }, + { + "type": "Volo.Abp.Auditing.IAuditingEnabled" + }, + { + "type": "Volo.Abp.GlobalFeatures.IGlobalFeatureCheckingEnabled" + }, + { + "type": "EShopOnAbp.BasketService.Services.IBasketAppService" + } + ], + "actions": { + "GetAsyncByAnonymousUserId": { + "uniqueName": "GetAsyncByAnonymousUserId", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/basket/basket", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "anonymousUserId", + "typeAsString": "System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]], System.Private.CoreLib", + "type": "System.Guid?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "anonymousUserId", + "name": "anonymousUserId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.BasketService.Services.BasketDto", + "typeSimple": "EShopOnAbp.BasketService.Services.BasketDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.BasketService.Services.IBasketAppService" + }, + "AddProductAsyncByInput": { + "uniqueName": "AddProductAsyncByInput", + "name": "AddProductAsync", + "httpMethod": "POST", + "url": "api/basket/basket/product", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.BasketService.Services.AddProductDto, EShopOnAbp.BasketService.Contracts", + "type": "EShopOnAbp.BasketService.Services.AddProductDto", + "typeSimple": "EShopOnAbp.BasketService.Services.AddProductDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "EShopOnAbp.BasketService.Services.AddProductDto", + "typeSimple": "EShopOnAbp.BasketService.Services.AddProductDto", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "EShopOnAbp.BasketService.Services.BasketDto", + "typeSimple": "EShopOnAbp.BasketService.Services.BasketDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.BasketService.Services.IBasketAppService" + }, + "RemoveProductAsyncByInput": { + "uniqueName": "RemoveProductAsyncByInput", + "name": "RemoveProductAsync", + "httpMethod": "DELETE", + "url": "api/basket/basket/product", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "EShopOnAbp.BasketService.Services.RemoveProductDto, EShopOnAbp.BasketService.Contracts", + "type": "EShopOnAbp.BasketService.Services.RemoveProductDto", + "typeSimple": "EShopOnAbp.BasketService.Services.RemoveProductDto", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "ProductId", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Count", + "jsonName": null, + "type": "System.Int32?", + "typeSimple": "number?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "AnonymousId", + "jsonName": null, + "type": "System.Guid?", + "typeSimple": "string?", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "EShopOnAbp.BasketService.Services.BasketDto", + "typeSimple": "EShopOnAbp.BasketService.Services.BasketDto" + }, + "allowAnonymous": null, + "implementFrom": "EShopOnAbp.BasketService.Services.IBasketAppService" + } + } + } + } + } + }, + "types": {} +} \ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/Default.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/Default.cshtml index ff139216..5995e593 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/Default.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/Default.cshtml @@ -1,6 +1,6 @@ -@using EShopOnAbp.BasketService.Localization +@using EShopOnAbp.Localization @using Microsoft.AspNetCore.Mvc.Localization -@inject IHtmlLocalizer L +@inject IHtmlLocalizer L @model EShopOnAbp.BasketService.Services.BasketDto