diff --git a/Galaxy.Api/Galaxy.Api.csproj b/Galaxy.Api/Galaxy.Api.csproj index 11f6fe6..7820779 100644 --- a/Galaxy.Api/Galaxy.Api.csproj +++ b/Galaxy.Api/Galaxy.Api.csproj @@ -1,4 +1,4 @@ - + netcoreapp3.1 @@ -9,6 +9,7 @@ + diff --git a/Galaxy.Api/GalaxyWebModule.cs b/Galaxy.Api/GalaxyWebModule.cs index 155c1ae..61e0cbe 100644 --- a/Galaxy.Api/GalaxyWebModule.cs +++ b/Galaxy.Api/GalaxyWebModule.cs @@ -1,22 +1,30 @@ using Galaxy.Order; using Galaxy.Product; +using Galaxy.Product.Contracts; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.OpenApi.Models; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; using Volo.Abp.Modularity; namespace Galaxy.Api { [DependsOn(typeof(AbpAspNetCoreMvcModule))] [DependsOn(typeof(AbpAutofacModule))] - [DependsOn(typeof(GalaxyOrderModule), typeof(GalaxyProductModule))] + [DependsOn(typeof(GalaxyOrderModule), typeof(GalaxyProductModule))] + [DependsOn(typeof(AbpHttpClientModule))] public class GalaxyWebModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { + ////创建动态客户端代理 + //context.Services.AddHttpClientProxies( + // typeof(GalaxyProductContractModule).Assembly, remoteServiceConfigurationName: "ProductStore" + //); + Configure(options => { options.ConventionalControllers.Create(typeof(GalaxyOrderModule).Assembly); diff --git a/Galaxy.Order.Api/GalaxyOrderWebModule.cs b/Galaxy.Order.Api/GalaxyOrderWebModule.cs index c1b4f54..85d913b 100644 --- a/Galaxy.Order.Api/GalaxyOrderWebModule.cs +++ b/Galaxy.Order.Api/GalaxyOrderWebModule.cs @@ -1,21 +1,24 @@ -using Galaxy.Product.Contracts; +using Galaxy.Order.Contracts; +using Galaxy.Product.Contracts; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Microsoft.OpenApi.Models; using Volo.Abp; using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.Autofac; +using Volo.Abp.Http.Client; using Volo.Abp.Modularity; namespace Galaxy.Order.Api { [DependsOn(typeof(AbpAspNetCoreMvcModule))] [DependsOn(typeof(AbpAutofacModule), typeof(GalaxyOrderModule))] + [DependsOn(typeof(AbpHttpClientModule))] public class GalaxyOrderWebModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) { - //创建动态客户端代理 + ////创建动态客户端代理 context.Services.AddHttpClientProxies( typeof(GalaxyProductContractModule).Assembly, remoteServiceConfigurationName: "ProductStore" ); diff --git a/Galaxy.Order.Api/appsettings.Development.json b/Galaxy.Order.Api/appsettings.Development.json index bee1abf..e56500b 100644 --- a/Galaxy.Order.Api/appsettings.Development.json +++ b/Galaxy.Order.Api/appsettings.Development.json @@ -4,14 +4,14 @@ "Default": "Information", "Microsoft": "Warning", "Microsoft.Hosting.Lifetime": "Information" + } + }, + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44348/" }, - "RemoteServices": { - "Default": { - "BaseUrl": "https://localhost:44348/" - }, - "ProductStore": { - "BaseUrl": "https://localhost:4434/" - } + "ProductStore": { + "BaseUrl": "https://localhost:44349/" } } } \ No newline at end of file