diff --git a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs index a635fe06..26e040ee 100644 --- a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs @@ -12,6 +12,7 @@ using Microsoft.Extensions.Hosting; using EShopOnAbp.SaasService.EntityFrameworkCore; using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.Microservices; +using Microsoft.Extensions.Options; using StackExchange.Redis; using Microsoft.OpenApi.Models; using Volo.Abp; @@ -26,11 +27,11 @@ using Volo.Abp.VirtualFileSystem; namespace EShopOnAbp.SaasService { [DependsOn( - typeof(EShopOnAbpSharedHostingMicroservicesModule), + typeof(EShopOnAbpSharedHostingMicroservicesModule), typeof(SaasServiceEntityFrameworkCoreModule), typeof(SaasServiceApplicationModule), typeof(SaasServiceHttpApiModule) - )] + )] public class SaasServiceHttpApiHostModule : AbpModule { public override void ConfigureServices(ServiceConfigurationContext context) @@ -40,17 +41,18 @@ namespace EShopOnAbp.SaasService JwtBearerConfigurationHelper.Configure(context, "SaasService"); // SwaggerConfigurationHelper.Configure(context, "Saas Service API"); - + SwaggerWithAuthConfigurationHelper.Configure( context: context, authority: configuration["AuthServer:Authority"], - scopes: new Dictionary /* Requested scopes for authorization code request and descriptions for swagger UI only */ - { - {"SaasService", "Saas Service API"}, - }, + scopes: new + Dictionary /* Requested scopes for authorization code request and descriptions for swagger UI only */ + { + { "SaasService", "Saas Service API" }, + }, apiTitle: "Saas Service API" ); - + context.Services.AddCors(options => { options.AddDefaultPolicy(builder => @@ -96,6 +98,7 @@ namespace EShopOnAbp.SaasService app.UseAbpSerilogEnrichers(); app.UseAuditing(); app.UseUnitOfWork(); + app.UseConsul(); app.UseConfiguredEndpoints(endpoints => { // endpoints.MapMetrics(); @@ -114,4 +117,10 @@ namespace EShopOnAbp.SaasService } } } -} + + public class Test + { + public string ID { get; set; } + public string Name { get; set; } + } +} \ No newline at end of file diff --git a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json index 869f9537..e0acb96a 100644 --- a/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json +++ b/services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json @@ -40,5 +40,10 @@ }, "ElasticSearch": { "Url": "http://localhost:9200" + }, + "Consul": { + "Enabled": true, + "Host": "http://localhost:8500", + "Service": "Saas Service" } }