Browse Source

saas service update

enisn/payment-service-with-mock
Başak ERDEM 5 years ago
parent
commit
6852a08b1d
  1. 27
      services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs
  2. 5
      services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json

27
services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/SaasServiceHttpApiHostModule.cs

@ -12,6 +12,7 @@ using Microsoft.Extensions.Hosting;
using EShopOnAbp.SaasService.EntityFrameworkCore; using EShopOnAbp.SaasService.EntityFrameworkCore;
using EShopOnAbp.Shared.Hosting.AspNetCore; using EShopOnAbp.Shared.Hosting.AspNetCore;
using EShopOnAbp.Shared.Hosting.Microservices; using EShopOnAbp.Shared.Hosting.Microservices;
using Microsoft.Extensions.Options;
using StackExchange.Redis; using StackExchange.Redis;
using Microsoft.OpenApi.Models; using Microsoft.OpenApi.Models;
using Volo.Abp; using Volo.Abp;
@ -26,11 +27,11 @@ using Volo.Abp.VirtualFileSystem;
namespace EShopOnAbp.SaasService namespace EShopOnAbp.SaasService
{ {
[DependsOn( [DependsOn(
typeof(EShopOnAbpSharedHostingMicroservicesModule), typeof(EShopOnAbpSharedHostingMicroservicesModule),
typeof(SaasServiceEntityFrameworkCoreModule), typeof(SaasServiceEntityFrameworkCoreModule),
typeof(SaasServiceApplicationModule), typeof(SaasServiceApplicationModule),
typeof(SaasServiceHttpApiModule) typeof(SaasServiceHttpApiModule)
)] )]
public class SaasServiceHttpApiHostModule : AbpModule public class SaasServiceHttpApiHostModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void ConfigureServices(ServiceConfigurationContext context)
@ -40,17 +41,18 @@ namespace EShopOnAbp.SaasService
JwtBearerConfigurationHelper.Configure(context, "SaasService"); JwtBearerConfigurationHelper.Configure(context, "SaasService");
// SwaggerConfigurationHelper.Configure(context, "Saas Service API"); // SwaggerConfigurationHelper.Configure(context, "Saas Service API");
SwaggerWithAuthConfigurationHelper.Configure( SwaggerWithAuthConfigurationHelper.Configure(
context: context, context: context,
authority: configuration["AuthServer:Authority"], authority: configuration["AuthServer:Authority"],
scopes: new Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */ scopes: new
{ Dictionary<string, string> /* Requested scopes for authorization code request and descriptions for swagger UI only */
{"SaasService", "Saas Service API"}, {
}, { "SaasService", "Saas Service API" },
},
apiTitle: "Saas Service API" apiTitle: "Saas Service API"
); );
context.Services.AddCors(options => context.Services.AddCors(options =>
{ {
options.AddDefaultPolicy(builder => options.AddDefaultPolicy(builder =>
@ -96,6 +98,7 @@ namespace EShopOnAbp.SaasService
app.UseAbpSerilogEnrichers(); app.UseAbpSerilogEnrichers();
app.UseAuditing(); app.UseAuditing();
app.UseUnitOfWork(); app.UseUnitOfWork();
app.UseConsul();
app.UseConfiguredEndpoints(endpoints => app.UseConfiguredEndpoints(endpoints =>
{ {
// endpoints.MapMetrics(); // endpoints.MapMetrics();
@ -114,4 +117,10 @@ namespace EShopOnAbp.SaasService
} }
} }
} }
}
public class Test
{
public string ID { get; set; }
public string Name { get; set; }
}
}

5
services/saas/src/EShopOnAbp.SaasService.HttpApi.Host/appsettings.json

@ -40,5 +40,10 @@
}, },
"ElasticSearch": { "ElasticSearch": {
"Url": "http://localhost:9200" "Url": "http://localhost:9200"
},
"Consul": {
"Enabled": true,
"Host": "http://localhost:8500",
"Service": "Saas Service"
} }
} }

Loading…
Cancel
Save