diff --git a/framework/Volo.Abp.slnx b/framework/Volo.Abp.slnx index 07068df7c6..149838bd33 100644 --- a/framework/Volo.Abp.slnx +++ b/framework/Volo.Abp.slnx @@ -231,6 +231,7 @@ + diff --git a/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs b/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs index 004669eeb2..5d930c9de0 100644 --- a/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs +++ b/framework/src/Volo.Abp.Http.Client.Web/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention.cs @@ -15,6 +15,7 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Http.Client.ClientProxying; using Volo.Abp.Http.Client.StaticProxying; using Volo.Abp.Http.Modeling; +using Volo.Abp.Http.ProxyScripting.Generators; using Volo.Abp.Reflection; namespace Volo.Abp.Http.Client.Web.Conventions; @@ -72,11 +73,39 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention } ConfigureClientProxySelector(controller); + RemoveConventionalSelectors(controller); ConfigureClientProxyApiExplorer(controller); + ConfigureClientProxyParameters(controller); ConfigureParameters(controller); } } + protected virtual void ConfigureClientProxyParameters(ControllerModel controller) + { + foreach (var action in controller.Actions) + { + var actionApiDescriptionModel = FindActionApiDescriptionModel(controller, action); + if (actionApiDescriptionModel == null) + { + continue; + } + + foreach (var prm in action.Parameters) + { + if (prm.BindingInfo != null) + { + continue; + } + + // Clients send the parameter where the remote action reads it, so a primitive [FromBody] parameter has to be read from the body here too. + if (actionApiDescriptionModel.Parameters.Any(x => x.NameOnMethod == prm.ParameterName && x.BindingSourceId == ParameterBindingSources.Body)) + { + prm.BindingInfo = BindingInfo.GetBindingInfo(new[] { new FromBodyAttribute() }); + } + } + } + } + protected override void ConfigureParameters(ControllerModel controller) { foreach (var action in controller.Actions) @@ -201,6 +230,22 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention } } + protected virtual void RemoveConventionalSelectors(ControllerModel controller) + { + if (controller.Selectors.Any(selector => selector.AttributeRouteModel != null)) + { + return; + } + + foreach (var action in controller.Actions) + { + action.Selectors + .Where(selector => selector.AttributeRouteModel == null) + .ToList() + .ForEach(selector => action.Selectors.Remove(selector)); + } + } + protected virtual void ConfigureClientProxyApiExplorer(ControllerModel controller) { if (ControllerWithAttributeRoute.Contains(controller)) @@ -218,10 +263,7 @@ public class AbpHttpClientProxyServiceConvention : AbpServiceConvention foreach (var action in controller.Actions) { - if (ActionWithAttributeRoute.Contains(action)) - { - ConfigureApiExplorer(action); - } + ConfigureApiExplorer(action); } } diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.abppkg b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.abppkg new file mode 100644 index 0000000000..a686451fbc --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.abppkg @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.csproj b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.csproj new file mode 100644 index 0000000000..893bcebc63 --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo.Abp.Http.Client.Web.Tests.csproj @@ -0,0 +1,22 @@ + + + + + + net10.0 + Volo.Abp.Http.Client.Web.Tests + Volo.Abp.Http.Client.Web.Tests + + + + + + + + + + + + + + diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestBase.cs b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestBase.cs new file mode 100644 index 0000000000..7ec8ca7f19 --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestBase.cs @@ -0,0 +1,8 @@ +using Volo.Abp.AspNetCore; + +namespace Volo.Abp.Http.Client.Web; + +public abstract class AbpHttpClientWebTestBase : AbpAspNetCoreTestBase +{ + +} diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestModule.cs b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestModule.cs new file mode 100644 index 0000000000..ca2f404b0c --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/AbpHttpClientWebTestModule.cs @@ -0,0 +1,41 @@ +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.TestBase; +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client.StaticProxying; +using Volo.Abp.Http.Client.Web.Conventions; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace Volo.Abp.Http.Client.Web; + +[DependsOn( + typeof(AbpHttpClientWebModule), + typeof(AbpAspNetCoreTestBaseModule), + typeof(AbpAutofacModule) +)] +public class AbpHttpClientWebTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddStaticHttpClientProxies(typeof(AbpHttpClientWebTestModule).Assembly); + + Configure(options => + { + options.BindingFromQueryTypes.Add(typeof(ClientProxyTestQueryInput)); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + var app = context.GetApplicationBuilder(); + + app.UseRouting(); + app.UseConfiguredEndpoints(); + } +} diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention_Tests.cs b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention_Tests.cs new file mode 100644 index 0000000000..84fba21065 --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/AbpHttpClientProxyServiceConvention_Tests.cs @@ -0,0 +1,577 @@ +using System; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.ActionConstraints; +using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Infrastructure; +using Shouldly; +using Volo.Abp.Application.Services; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Content; +using Volo.Abp.Http.Client.ClientProxying; +using Xunit; + +namespace Volo.Abp.Http.Client.Web.Conventions; + +public class AbpHttpClientProxyServiceConvention_Tests : AbpHttpClientWebTestBase +{ + [Fact] + public async Task Should_Read_Primitive_Body_Parameter_From_Request_Body() + { + var response = await Client.PostAsync( + "/api/client-proxy-test/from-body", + new StringContent("\"Server=localhost;Database=Test\"", Encoding.UTF8, "application/json")); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("Server=localhost;Database=Test"); + } + + [Fact] + public async Task Should_Read_Non_String_Primitive_Body_Parameter_From_Request_Body() + { + var response = await Client.PostAsync( + "/api/client-proxy-test/number-from-body", + new StringContent("42", Encoding.UTF8, "application/json")); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("42"); + } + + [Fact] + public async Task Should_Keep_Reading_Other_Primitive_Parameters_From_Query_String() + { + var response = await Client.PostAsync("/api/client-proxy-test/from-query?value=test", null); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test"); + } + + [Fact] + public async Task Should_Read_Primitive_Parameters_From_Query_String_In_Get_Actions() + { + var guid = Guid.NewGuid(); + + var response = await Client.GetAsync($"/api/client-proxy-test/query-parameters?number=42&flag=true&guid={guid}"); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe($"42:True:{guid}"); + } + + [Fact] + public async Task Should_Keep_Explicit_Binding_Attribute() + { + var response = await Client.PostAsync("/api/client-proxy-test/from-explicit-query?value=test", null); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test"); + } + + [Fact] + public async Task Should_Read_Complex_Parameter_From_Request_Body() + { + var response = await Client.PostAsync( + "/api/client-proxy-test", + new StringContent("{\"name\":\"test\",\"value\":42}", Encoding.UTF8, "application/json")); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test:42"); + } + + [Fact] + public async Task Should_Read_Id_From_Route_And_Complex_Parameter_From_Request_Body() + { + var id = Guid.NewGuid(); + + var response = await Client.PutAsync( + $"/api/client-proxy-test/{id}", + new StringContent("{\"name\":\"test\",\"value\":42}", Encoding.UTF8, "application/json")); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe($"{id}:test:42"); + } + + [Fact] + public async Task Should_Read_Complex_Parameter_From_Query_String_In_Get_Actions() + { + var response = await Client.GetAsync("/api/client-proxy-test?Name=test&Value=42"); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test:42"); + } + + [Fact] + public async Task Should_Read_Binding_From_Query_Types_From_Query_String() + { + var response = await Client.PostAsync("/api/client-proxy-test/by-query-type?Name=test&Value=42", null); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test:42"); + } + + [Fact] + public async Task Should_Read_Remote_Stream_Content_From_Form() + { + using var content = new MultipartFormDataContent(); + content.Add(new StringContent("file content"), "file", "test.txt"); + + var response = await Client.PostAsync("/api/client-proxy-test/upload", content); + + response.StatusCode.ShouldBe(HttpStatusCode.OK); + (await response.Content.ReadAsStringAsync()).ShouldBe("test.txt:file content"); + } + + [Fact] + public async Task Should_Use_Url_And_Http_Method_Of_Remote_Action() + { + var action = GetProxyAction(nameof(IClientProxyTestAppService.GetFromBodyAsync)); + + action.AttributeRouteInfo.ShouldNotBeNull(); + action.AttributeRouteInfo.Template.ShouldBe("api/client-proxy-test/from-body"); + action.ActionConstraints.ShouldNotBeNull(); + action.ActionConstraints.OfType().Single().HttpMethods.ShouldBe(new[] { "POST" }); + + var response = await Client.GetAsync("/api/client-proxy-test/from-body"); + response.StatusCode.ShouldBe(HttpStatusCode.MethodNotAllowed); + } + + [Fact] + public void Should_Use_Controller_Group_Name_As_Controller_Name() + { + var action = GetProxyAction(nameof(IClientProxyTestAppService.GetFromBodyAsync)); + + action.ControllerName.ShouldBe("ClientProxyTest"); + } + + [Fact] + public async Task Should_Remove_ClientProxy_Postfix_From_Controller_Name_Without_Controller_Group_Name() + { + var action = GetProxyAction(nameof(IClientProxyNoGroupNameAppService.GetAsync)); + + action.ControllerName.ShouldBe("ClientProxyNoGroupNameAppService"); + (await Client.GetStringAsync("/api/client-proxy-no-group-name")).ShouldBe("no-group-name"); + } + + [Fact] + public void Should_Use_Root_Path_As_Area() + { + var action = GetProxyAction(nameof(IClientProxyTestAppService.GetFromBodyAsync)); + + action.RouteValues["area"].ShouldBe("clientProxyTest"); + } + + [Theory] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedWithRemoteServiceAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedWithVerbAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedHiddenAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedIgnoredAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetDisabledAsync))] + [InlineData(nameof(IClientProxyTestAppService.GetDisabledWithVerbAsync))] + public async Task Should_Not_Expose_Action_Without_Route(string methodName) + { + FindProxyAction(methodName).ShouldBeNull(); + + var response = await Client.GetAsync($"/clientProxyTest/ClientProxyTest/{methodName.RemovePostFix("Async")}"); + response.StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Should_Not_Expose_Action_Without_Route_When_Controller_Has_No_Other_Route() + { + FindProxyAction(nameof(IClientProxyDisabledActionAppService.GetAsync)).ShouldBeNull(); + + (await Client.GetAsync("/clientProxyTest/ClientProxyDisabledAction/Get")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + (await Client.GetAsync("/api/client-proxy-disabled-action")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Should_Not_Expose_Actions_Of_Disabled_Client_Proxy_Without_Explicit_Route() + { + FindProxyAction(nameof(IClientProxyDisabledAppService.GetAsync)).ShouldBeNull(); + + (await Client.GetAsync("/clientProxyTest/ClientProxyDisabled/Get")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + (await Client.GetAsync("/api/client-proxy-disabled")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + (await Client.GetStringAsync("/api/client-proxy-disabled/with-route")).ShouldBe("disabled-with-route"); + } + + [Theory] + [InlineData(nameof(IClientProxyTestAppService.GetDisabledWithRouteAsync), "api/client-proxy-test/disabled-with-route", false)] + [InlineData(nameof(IClientProxyTestAppService.GetNotDescribedWithRouteAsync), "api/client-proxy-test/not-described-with-route", true)] + public async Task Should_Keep_Explicit_Action_Route(string methodName, string url, bool visibleInApiExplorer) + { + GetProxyAction(methodName).AttributeRouteInfo.Template.ShouldBe(url); + + (await Client.GetAsync($"/{url}")).StatusCode.ShouldBe(HttpStatusCode.OK); + GetApiDescriptions("ClientProxyTest").Any(x => x.RelativePath == url).ShouldBe(visibleInApiExplorer); + } + + [Fact] + public async Task Should_Keep_Only_Explicit_Route_Of_Action_With_Multiple_Selectors() + { + var action = GetProxyAction(nameof(IClientProxyTestAppService.GetDisabledWithVerbAndRouteAsync)); + action.AttributeRouteInfo.Template.ShouldBe("api/client-proxy-test/disabled-with-verb-and-route"); + + (await Client.PostAsync("/api/client-proxy-test/disabled-with-verb-and-route", null)).StatusCode.ShouldBe(HttpStatusCode.OK); + (await Client.GetAsync("/clientProxyTest/ClientProxyTest/GetDisabledWithVerbAndRoute")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Should_Keep_Explicit_Controller_Route() + { + (await Client.GetStringAsync("/api/client-proxy-controller-route")).ShouldBe("controller-route"); + (await Client.GetAsync("/api/client-proxy-controller-route-json")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + [Fact] + public async Task Should_Hide_Client_Proxy_With_Disabled_Metadata_From_Api_Explorer() + { + (await Client.GetStringAsync("/api/client-proxy-metadata-disabled")).ShouldBe("metadata-disabled"); + GetApiDescriptions("ClientProxyMetadataDisabled").ShouldBeEmpty(); + } + + [Fact] + public async Task Should_Remove_Client_Proxy_Controller_If_Another_Controller_Implements_The_Same_Service() + { + GetActions() + .Any(x => x.ControllerTypeInfo.AsType() == typeof(ClientProxyDuplicatedAppServiceClientProxy)) + .ShouldBeFalse(); + + (await Client.GetStringAsync("/api/client-proxy-duplicated")).ShouldBe("controller"); + (await Client.GetAsync("/api/client-proxy-duplicated-proxy")).StatusCode.ShouldBe(HttpStatusCode.NotFound); + } + + [Fact] + public void Should_Add_Client_Proxy_Actions_To_Api_Explorer() + { + var apiDescriptions = GetApiDescriptions("ClientProxyTest"); + + apiDescriptions.ShouldContain(x => x.RelativePath == "api/client-proxy-test/from-body" && x.HttpMethod == "POST"); + apiDescriptions.ShouldContain(x => x.RelativePath == "api/client-proxy-test/{id}" && x.HttpMethod == "PUT"); + } + + [Fact] + public async Task Should_Hide_Action_With_Disabled_Metadata_From_Api_Explorer() + { + GetApiDescriptions("ClientProxyTest").ShouldNotContain(x => x.RelativePath == "api/client-proxy-test/hidden"); + + (await Client.GetStringAsync("/api/client-proxy-test/hidden")).ShouldBe("hidden"); + } + + private ControllerActionDescriptor[] GetActions() + { + return GetRequiredService() + .ActionDescriptors.Items + .OfType() + .ToArray(); + } + + private ControllerActionDescriptor GetProxyAction(string methodName) + { + return GetActions().Single(x => x.ControllerTypeInfo.AsType() == typeof(TClientProxy) && x.MethodInfo.Name == methodName); + } + + private ControllerActionDescriptor FindProxyAction(string methodName) + { + return GetActions().SingleOrDefault(x => x.ControllerTypeInfo.AsType() == typeof(TClientProxy) && x.MethodInfo.Name == methodName); + } + + private ApiDescription[] GetApiDescriptions(string groupName) + { + return GetRequiredService() + .ApiDescriptionGroups.Items + .Where(x => x.GroupName == groupName) + .SelectMany(x => x.Items) + .ToArray(); + } +} + +public interface IClientProxyTestAppService : IApplicationService +{ + Task GetFromBodyAsync(string value); + + Task GetFromQueryAsync(string value); + + Task GetNumberFromBodyAsync(int value); + + Task GetFromExplicitQueryAsync(string value); + + Task GetQueryParametersAsync(int number, bool flag, Guid guid); + + Task CreateAsync(ClientProxyTestInput input); + + Task UpdateAsync(Guid id, ClientProxyTestInput input); + + Task GetListAsync(ClientProxyTestInput input); + + Task GetByQueryTypeAsync(ClientProxyTestQueryInput input); + + Task UploadAsync(IRemoteStreamContent file); + + Task GetHiddenAsync(); + + Task GetNotDescribedAsync(); + + Task GetDisabledAsync(); + + Task GetDisabledWithVerbAsync(); + + Task GetNotDescribedWithRemoteServiceAsync(); + + Task GetNotDescribedWithVerbAsync(); + + Task GetNotDescribedHiddenAsync(); + + Task GetNotDescribedIgnoredAsync(); + + Task GetDisabledWithRouteAsync(); + + Task GetNotDescribedWithRouteAsync(); + + Task GetDisabledWithVerbAndRouteAsync(); +} + +// Returns the received values instead of calling a remote service, so the tests can see what the proxy controller bound. +public class ClientProxyTestAppServiceClientProxy : ClientProxyBase, IClientProxyTestAppService +{ + public virtual Task GetFromBodyAsync(string value) + { + return Task.FromResult(value); + } + + public virtual Task GetFromQueryAsync(string value) + { + return Task.FromResult(value); + } + + public virtual Task GetNumberFromBodyAsync(int value) + { + return Task.FromResult(value); + } + + public virtual Task GetFromExplicitQueryAsync([FromQuery] string value) + { + return Task.FromResult(value); + } + + public virtual Task GetQueryParametersAsync(int number, bool flag, Guid guid) + { + return Task.FromResult($"{number}:{flag}:{guid}"); + } + + public virtual Task CreateAsync(ClientProxyTestInput input) + { + return Task.FromResult($"{input.Name}:{input.Value}"); + } + + public virtual Task UpdateAsync(Guid id, ClientProxyTestInput input) + { + return Task.FromResult($"{id}:{input.Name}:{input.Value}"); + } + + public virtual Task GetListAsync(ClientProxyTestInput input) + { + return Task.FromResult($"{input.Name}:{input.Value}"); + } + + public virtual Task GetByQueryTypeAsync(ClientProxyTestQueryInput input) + { + return Task.FromResult($"{input.Name}:{input.Value}"); + } + + public virtual async Task UploadAsync(IRemoteStreamContent file) + { + using var reader = new StreamReader(file.GetStream()); + return $"{file.FileName}:{await reader.ReadToEndAsync()}"; + } + + [RemoteService(IsMetadataEnabled = false)] + public virtual Task GetHiddenAsync() + { + return Task.FromResult("hidden"); + } + + public virtual Task GetNotDescribedAsync() + { + return Task.FromResult("not-described"); + } + + [RemoteService(false)] + public virtual Task GetDisabledAsync() + { + return Task.FromResult("disabled"); + } + + [RemoteService(false)] + [HttpGet] + public virtual Task GetDisabledWithVerbAsync() + { + return Task.FromResult("disabled-with-verb"); + } + + [RemoteService] + public virtual Task GetNotDescribedWithRemoteServiceAsync() + { + return Task.FromResult("not-described-with-remote-service"); + } + + [HttpGet] + public virtual Task GetNotDescribedWithVerbAsync() + { + return Task.FromResult("not-described-with-verb"); + } + + [RemoteService(IsMetadataEnabled = false)] + public virtual Task GetNotDescribedHiddenAsync() + { + return Task.FromResult("not-described-hidden"); + } + + [ApiExplorerSettings(IgnoreApi = true)] + public virtual Task GetNotDescribedIgnoredAsync() + { + return Task.FromResult("not-described-ignored"); + } + + [RemoteService(false)] + [HttpGet("api/client-proxy-test/disabled-with-route")] + public virtual Task GetDisabledWithRouteAsync() + { + return Task.FromResult("disabled-with-route"); + } + + [HttpGet("api/client-proxy-test/not-described-with-route")] + public virtual Task GetNotDescribedWithRouteAsync() + { + return Task.FromResult("not-described-with-route"); + } + + [RemoteService(false)] + [HttpGet] + [HttpPost("api/client-proxy-test/disabled-with-verb-and-route")] + public virtual Task GetDisabledWithVerbAndRouteAsync() + { + return Task.FromResult("disabled-with-verb-and-route"); + } +} + +public class ClientProxyTestInput +{ + public string Name { get; set; } + + public int Value { get; set; } +} + +public class ClientProxyTestQueryInput +{ + public string Name { get; set; } + + public int Value { get; set; } +} + +public interface IClientProxyNoGroupNameAppService : IApplicationService +{ + Task GetAsync(); +} + +public class ClientProxyNoGroupNameAppServiceClientProxy : ClientProxyBase, IClientProxyNoGroupNameAppService +{ + public virtual Task GetAsync() + { + return Task.FromResult("no-group-name"); + } +} + +public interface IClientProxyDuplicatedAppService : IApplicationService +{ + Task GetAsync(); +} + +public class ClientProxyDuplicatedAppServiceClientProxy : ClientProxyBase, IClientProxyDuplicatedAppService +{ + public virtual Task GetAsync() + { + return Task.FromResult("proxy"); + } +} + +[Route("api/client-proxy-duplicated")] +public class ClientProxyDuplicatedController : AbpControllerBase, IClientProxyDuplicatedAppService +{ + [HttpGet] + public virtual Task GetAsync() + { + return Task.FromResult("controller"); + } +} + +public interface IClientProxyDisabledAppService : IApplicationService +{ + Task GetAsync(); + + Task GetWithRouteAsync(); +} + +[RemoteService(false)] +public class ClientProxyDisabledAppServiceClientProxy : ClientProxyBase, IClientProxyDisabledAppService +{ + public virtual Task GetAsync() + { + return Task.FromResult("disabled"); + } + + [HttpGet("api/client-proxy-disabled/with-route")] + public virtual Task GetWithRouteAsync() + { + return Task.FromResult("disabled-with-route"); + } +} + +public interface IClientProxyDisabledActionAppService : IApplicationService +{ + Task GetAsync(); +} + +public class ClientProxyDisabledActionAppServiceClientProxy : ClientProxyBase, IClientProxyDisabledActionAppService +{ + [RemoteService(false)] + public virtual Task GetAsync() + { + return Task.FromResult("disabled-action"); + } +} + +public interface IClientProxyMetadataDisabledAppService : IApplicationService +{ + Task GetAsync(); +} + +[RemoteService(IsMetadataEnabled = false)] +public class ClientProxyMetadataDisabledAppServiceClientProxy : ClientProxyBase, IClientProxyMetadataDisabledAppService +{ + public virtual Task GetAsync() + { + return Task.FromResult("metadata-disabled"); + } +} + +public interface IClientProxyControllerRouteAppService : IApplicationService +{ + Task GetAsync(); +} + +[Route("api/client-proxy-controller-route")] +public class ClientProxyControllerRouteAppServiceClientProxy : ClientProxyBase, IClientProxyControllerRouteAppService +{ + [RemoteService(false)] + [HttpGet] + public virtual Task GetAsync() + { + return Task.FromResult("controller-route"); + } +} diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/client-proxy-test-generate-proxy.json b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/client-proxy-test-generate-proxy.json new file mode 100644 index 0000000000..ed5057b876 --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Conventions/client-proxy-test-generate-proxy.json @@ -0,0 +1,719 @@ +{ + "modules": { + "clientProxyTest": { + "rootPath": "clientProxyTest", + "remoteServiceName": "Default", + "controllers": { + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestController": { + "controllerName": "ClientProxyTest", + "controllerGroupName": "ClientProxyTest", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService", + "name": "IClientProxyTestAppService", + "methods": [] + } + ], + "actions": { + "GetFromBodyAsyncByValue": { + "uniqueName": "GetFromBodyAsyncByValue", + "name": "GetFromBodyAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/from-body", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "value", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "value", + "name": "value", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetFromQueryAsyncByValue": { + "uniqueName": "GetFromQueryAsyncByValue", + "name": "GetFromQueryAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/from-query", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "value", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "value", + "name": "value", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetNumberFromBodyAsyncByValue": { + "uniqueName": "GetNumberFromBodyAsyncByValue", + "name": "GetNumberFromBodyAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/number-from-body", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "value", + "typeAsString": "System.Int32, System.Private.CoreLib", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "value", + "name": "value", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetFromExplicitQueryAsyncByValue": { + "uniqueName": "GetFromExplicitQueryAsyncByValue", + "name": "GetFromExplicitQueryAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/from-explicit-query", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "value", + "typeAsString": "System.String, System.Private.CoreLib", + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "value", + "name": "value", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetQueryParametersAsyncByNumberAndFlagAndGuid": { + "uniqueName": "GetQueryParametersAsyncByNumberAndFlagAndGuid", + "name": "GetQueryParametersAsync", + "httpMethod": "GET", + "url": "api/client-proxy-test/query-parameters", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "number", + "typeAsString": "System.Int32, System.Private.CoreLib", + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null + }, + { + "name": "flag", + "typeAsString": "System.Boolean, System.Private.CoreLib", + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null + }, + { + "name": "guid", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "number", + "name": "number", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "flag", + "name": "flag", + "jsonName": null, + "type": "System.Boolean", + "typeSimple": "boolean", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + }, + { + "nameOnMethod": "guid", + "name": "guid", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "CreateAsyncByInput": { + "uniqueName": "CreateAsyncByInput", + "name": "CreateAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput, Volo.Abp.Http.Client.Web.Tests", + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "UpdateAsyncByIdAndInput": { + "uniqueName": "UpdateAsyncByIdAndInput", + "name": "UpdateAsync", + "httpMethod": "PUT", + "url": "api/client-proxy-test/{id}", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "id", + "typeAsString": "System.Guid, System.Private.CoreLib", + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null + }, + { + "name": "input", + "typeAsString": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput, Volo.Abp.Http.Client.Web.Tests", + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "id", + "name": "id", + "jsonName": null, + "type": "System.Guid", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Path", + "descriptorName": "" + }, + { + "nameOnMethod": "input", + "name": "input", + "jsonName": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Body", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetListAsyncByInput": { + "uniqueName": "GetListAsyncByInput", + "name": "GetListAsync", + "httpMethod": "GET", + "url": "api/client-proxy-test", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput, Volo.Abp.Http.Client.Web.Tests", + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Value", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "ModelBinding", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetByQueryTypeAsyncByInput": { + "uniqueName": "GetByQueryTypeAsyncByInput", + "name": "GetByQueryTypeAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/by-query-type", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "input", + "typeAsString": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestQueryInput, Volo.Abp.Http.Client.Web.Tests", + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestQueryInput", + "typeSimple": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyTestQueryInput", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "input", + "name": "Name", + "jsonName": null, + "type": "System.String", + "typeSimple": "string", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + }, + { + "nameOnMethod": "input", + "name": "Value", + "jsonName": null, + "type": "System.Int32", + "typeSimple": "number", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "Query", + "descriptorName": "input" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "UploadAsyncByFile": { + "uniqueName": "UploadAsyncByFile", + "name": "UploadAsync", + "httpMethod": "POST", + "url": "api/client-proxy-test/upload", + "supportedVersions": [], + "parametersOnMethod": [ + { + "name": "file", + "typeAsString": "Volo.Abp.Content.IRemoteStreamContent, Volo.Abp.Core", + "type": "Volo.Abp.Content.IRemoteStreamContent", + "typeSimple": "Volo.Abp.Content.IRemoteStreamContent", + "isOptional": false, + "defaultValue": null + } + ], + "parameters": [ + { + "nameOnMethod": "file", + "name": "file", + "jsonName": null, + "type": "Volo.Abp.Content.IRemoteStreamContent", + "typeSimple": "Volo.Abp.Content.IRemoteStreamContent", + "isOptional": false, + "defaultValue": null, + "constraintTypes": null, + "bindingSourceId": "FormFile", + "descriptorName": "" + } + ], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetHiddenAsync": { + "uniqueName": "GetHiddenAsync", + "name": "GetHiddenAsync", + "httpMethod": "GET", + "url": "api/client-proxy-test/hidden", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetDisabledAsync": { + "uniqueName": "GetDisabledAsync", + "name": "GetDisabledAsync", + "httpMethod": "GET", + "url": "api/client-proxy-test/disabled", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + }, + "GetDisabledWithVerbAsync": { + "uniqueName": "GetDisabledWithVerbAsync", + "name": "GetDisabledWithVerbAsync", + "httpMethod": "GET", + "url": "api/client-proxy-test/disabled-with-verb", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyTestAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyNoGroupNameController": { + "controllerName": "ClientProxyNoGroupName", + "controllerGroupName": "", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyNoGroupNameController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyNoGroupNameAppService", + "name": "IClientProxyNoGroupNameAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-no-group-name", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyNoGroupNameAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDuplicatedController": { + "controllerName": "ClientProxyDuplicated", + "controllerGroupName": "ClientProxyDuplicated", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDuplicatedController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDuplicatedAppService", + "name": "IClientProxyDuplicatedAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-duplicated-proxy", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDuplicatedAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDisabledController": { + "controllerName": "ClientProxyDisabled", + "controllerGroupName": "ClientProxyDisabled", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDisabledController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDisabledAppService", + "name": "IClientProxyDisabledAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-disabled", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDisabledAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDisabledActionController": { + "controllerName": "ClientProxyDisabledAction", + "controllerGroupName": "ClientProxyDisabledAction", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyDisabledActionController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDisabledActionAppService", + "name": "IClientProxyDisabledActionAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-disabled-action", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyDisabledActionAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyMetadataDisabledController": { + "controllerName": "ClientProxyMetadataDisabled", + "controllerGroupName": "ClientProxyMetadataDisabled", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyMetadataDisabledController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyMetadataDisabledAppService", + "name": "IClientProxyMetadataDisabledAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-metadata-disabled", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyMetadataDisabledAppService" + } + } + }, + "Volo.Abp.Http.Client.Web.Conventions.ClientProxyControllerRouteController": { + "controllerName": "ClientProxyControllerRoute", + "controllerGroupName": "ClientProxyControllerRoute", + "isRemoteService": true, + "isIntegrationService": false, + "apiVersion": null, + "type": "Volo.Abp.Http.Client.Web.Conventions.ClientProxyControllerRouteController", + "interfaces": [ + { + "type": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyControllerRouteAppService", + "name": "IClientProxyControllerRouteAppService", + "methods": [] + } + ], + "actions": { + "GetAsync": { + "uniqueName": "GetAsync", + "name": "GetAsync", + "httpMethod": "GET", + "url": "api/client-proxy-controller-route-json", + "supportedVersions": [], + "parametersOnMethod": [], + "parameters": [], + "returnValue": { + "type": "System.String", + "typeSimple": "string" + }, + "allowAnonymous": null, + "implementFrom": "Volo.Abp.Http.Client.Web.Conventions.IClientProxyControllerRouteAppService" + } + } + } + } + } + }, + "types": {} +} diff --git a/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Program.cs b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Program.cs new file mode 100644 index 0000000000..a4a2006805 --- /dev/null +++ b/framework/test/Volo.Abp.Http.Client.Web.Tests/Volo/Abp/Http/Client/Web/Program.cs @@ -0,0 +1,10 @@ +using Microsoft.AspNetCore.Builder; +using Volo.Abp.AspNetCore.TestBase; +using Volo.Abp.Http.Client.Web; + +var builder = WebApplication.CreateBuilder(); +await builder.RunAbpModuleAsync(); + +public partial class Program +{ +}