diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json index 0fe4fbb35..6858f5041 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.DbMigrator/appsettings.PostgreSql.json @@ -48,9 +48,9 @@ "Features": { "DefaultPersistence": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { - "MySql": { + "PostgreSql": { "Enabled": true } } @@ -71,18 +71,18 @@ "PublishWebhook": true, "Webhooks": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { - "MySql": { + "PostgreSql": { "Enabled": true } } }, "WorkflowSettings": { "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { - "MySql": { + "PostgreSql": { "Enabled": true } } diff --git a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd index 757ba7b39..3f3946e28 100644 --- a/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd +++ b/aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore.MySql/FodyWeavers.xsd @@ -1,6 +1,6 @@ - + - + @@ -12,14 +12,19 @@ - Use to enforce assembly verification. + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - A comma-separated list of error codes that can be safely ignored. + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. - + \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index 54993b2eb..fd6af1cd5 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -316,14 +316,18 @@ namespace LY.MicroService.Applications.Single; typeof(AbpAccountTemplatesModule), typeof(AbpAspNetCoreAuthenticationJwtBearerModule), typeof(AbpCachingStackExchangeRedisModule), - + +#if POSTGRESQL + // typeof(AbpElsaModule), + // typeof(AbpElsaServerModule), + // typeof(AbpElsaActivitiesModule), + // typeof(AbpElsaEntityFrameworkCoreModule), + // typeof(AbpElsaEntityFrameworkCorePostgreSqlModule), +#else typeof(AbpElsaModule), typeof(AbpElsaServerModule), typeof(AbpElsaActivitiesModule), typeof(AbpElsaEntityFrameworkCoreModule), -#if POSTGRESQL - typeof(AbpElsaEntityFrameworkCorePostgreSqlModule), -#else typeof(AbpElsaEntityFrameworkCoreMySqlModule), #endif diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs index ccd4f3c0e..c21af85db 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Program.cs @@ -1,86 +1,82 @@ -using LINGYUN.Abp.Identity.Session.AspNetCore; -using LY.MicroService.Applications.Single; -using Microsoft.AspNetCore.Cors; -using Serilog; -using Volo.Abp.IO; -using Volo.Abp.Modularity.PlugIns; - -var builder = WebApplication.CreateBuilder(args); -builder.Services.AddCors(options => -{ - options.AddDefaultPolicy(policy => - { - policy - .WithOrigins( - builder.Configuration["App:CorsOrigins"] - .Split(",", StringSplitOptions.RemoveEmptyEntries) - .Select(o => o.RemovePostFix("/")) - .ToArray() - ) - .WithAbpExposedHeaders() - .WithAbpWrapExposedHeaders() - .SetIsOriginAllowedToAllowWildcardSubdomains() - .AllowAnyHeader() - .AllowAnyMethod() - .AllowCredentials(); - }); -}); -builder.Host.AddAppSettingsSecretsJson() - .UseAutofac() - .UseSerilog((context, provider, config) => - { - config.ReadFrom.Configuration(context.Configuration); - }); - -await builder.AddApplicationAsync(options => -{ - MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME") - ?? MicroServiceApplicationsSingleModule.ApplicationName; - options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName; - // ´Ó»·¾³±äÁ¿È¡Óû§»úÃÜÅäÖÃ, ÊÊÓÃÓÚÈÝÆ÷²âÊÔ - options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); - // Èç¹ûÈÝÆ÷ûÓÐÖ¸¶¨Óû§»úÃÜ, ´ÓÏîÄ¿¶ÁÈ¡ - options.Configuration.UserSecretsAssembly = typeof(MicroServiceApplicationsSingleModule).Assembly; - // ËÑË÷ Modules Ŀ¼ÏÂËùÓÐÎļþ×÷Ϊ²å¼þ - // È¡ÏûÏÔʾÒýÓÃËùÓÐÆäËûÏîÄ¿µÄÄ£¿é£¬¸ÄΪͨ¹ý²å¼þµÄÐÎʽÒýÓà - var pluginFolder = Path.Combine( - Directory.GetCurrentDirectory(), "Modules"); - DirectoryHelper.CreateIfNotExists(pluginFolder); - options.PlugInSources.AddFolder( - pluginFolder, - SearchOption.AllDirectories); -}); - -var app = builder.Build(); - -await app.InitializeApplicationAsync(); - -app.UseForwardedHeaders(); -if (app.Environment.IsDevelopment()) -{ - app.UseDeveloperExceptionPage(); -} -// app.UseAbpExceptionHandling(); -app.UseCookiePolicy(); -app.UseMapRequestLocalization(); -app.UseCorrelationId(); -app.UseStaticFiles(); -app.UseRouting(); -app.UseCors(); -app.UseAuthentication(); -app.UseMultiTenancy(); -app.UseUnitOfWork(); -app.UseAbpOpenIddictValidation(); -app.UseAbpSession(); -app.UseDynamicClaims(); -app.UseAuthorization(); -app.UseSwagger(); -app.UseSwaggerUI(options => -{ - options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support App API"); -}); -app.UseAuditing(); -app.UseAbpSerilogEnrichers(); -app.UseConfiguredEndpoints(); - -await app.RunAsync(); +using LINGYUN.Abp.Identity.Session.AspNetCore; +using LY.MicroService.Applications.Single; +using Microsoft.AspNetCore.Cors; +using Serilog; +using Volo.Abp.IO; +using Volo.Abp.Modularity.PlugIns; + +var builder = WebApplication.CreateBuilder(args); +builder.Services.AddCors(options => +{ + options.AddDefaultPolicy(policy => + { + policy + .WithOrigins( + builder.Configuration["App:CorsOrigins"] + .Split(",", StringSplitOptions.RemoveEmptyEntries) + .Select(o => o.RemovePostFix("/")) + .ToArray() + ) + .WithAbpExposedHeaders() + .WithAbpWrapExposedHeaders() + .SetIsOriginAllowedToAllowWildcardSubdomains() + .AllowAnyHeader() + .AllowAnyMethod() + .AllowCredentials(); + }); +}); +builder.Host.AddAppSettingsSecretsJson() + .UseAutofac() + .UseSerilog((context, provider, config) => + { + config.ReadFrom.Configuration(context.Configuration); + }); + +await builder.AddApplicationAsync(options => +{ + MicroServiceApplicationsSingleModule.ApplicationName = Environment.GetEnvironmentVariable("APPLICATION_NAME") + ?? MicroServiceApplicationsSingleModule.ApplicationName; + options.ApplicationName = MicroServiceApplicationsSingleModule.ApplicationName; + options.Configuration.UserSecretsId = Environment.GetEnvironmentVariable("APPLICATION_USER_SECRETS_ID"); + options.Configuration.UserSecretsAssembly = typeof(MicroServiceApplicationsSingleModule).Assembly; + var pluginFolder = Path.Combine( + Directory.GetCurrentDirectory(), "Modules"); + DirectoryHelper.CreateIfNotExists(pluginFolder); + options.PlugInSources.AddFolder( + pluginFolder, + SearchOption.AllDirectories); +}); + +var app = builder.Build(); + +await app.InitializeApplicationAsync(); + +app.UseForwardedHeaders(); +if (app.Environment.IsDevelopment()) +{ + app.UseDeveloperExceptionPage(); +} +// app.UseAbpExceptionHandling(); +app.UseCookiePolicy(); +app.UseMapRequestLocalization(); +app.UseCorrelationId(); +app.UseStaticFiles(); +app.UseRouting(); +app.UseCors(); +app.UseAuthentication(); +app.UseMultiTenancy(); +app.UseUnitOfWork(); +app.UseAbpOpenIddictValidation(); +app.UseAbpSession(); +app.UseDynamicClaims(); +app.UseAuthorization(); +app.UseSwagger(); +app.UseSwaggerUI(options => +{ + options.SwaggerEndpoint("/swagger/v1/swagger.json", "Support App API"); +}); +app.UseAuditing(); +app.UseAbpSerilogEnrichers(); +app.UseConfiguredEndpoints(); + +await app.RunAsync(); diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json index c233578a3..fe37aaa31 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/launchSettings.json @@ -17,11 +17,20 @@ "ASPNETCORE_ENVIRONMENT": "Production" } }, + "LY.MicroService.Applications.Single.Development": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "http://0.0.0.0:30000", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, "LY.MicroService.Applications.Single.PostgreSQL": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": false, - "applicationUrl": "http://0.0.0.0:30001", + "applicationUrl": "http://0.0.0.0:30000", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "PostgreSQL" } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json index 34b225a33..cf15e11f7 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json +++ b/aspnet-core/services/LY.MicroService.Applications.Single/appsettings.PostgreSql.json @@ -47,8 +47,8 @@ "Elsa": { "Features": { "DefaultPersistence": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "Enabled": false, + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "PostgreSql": { "Enabled": true @@ -70,8 +70,8 @@ "IM": true, "PublishWebhook": true, "Webhooks": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "Enabled": false, + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "PostgreSql": { "Enabled": true @@ -79,8 +79,8 @@ } }, "WorkflowSettings": { - "Enabled": true, - "ConnectionStringIdentifier": "Workflow", + "Enabled": false, + "ConnectionStringIdentifier": "Default", "EntityFrameworkCore": { "PostgreSql": { "Enabled": true @@ -93,16 +93,17 @@ } }, "Quartz": { - "UsePersistentStore": true, + "UsePersistentStore": false, "Properties": { "quartz.jobStore.dataSource": "tkm", - "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX, Quartz", - "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate, Quartz", + "quartz.jobStore.useProperties": "true", + "quartz.jobStore.type": "Quartz.Impl.AdoJobStore.JobStoreTX,Quartz", + "quartz.jobStore.driverDelegateType": "Quartz.Impl.AdoJobStore.PostgreSQLDelegate,Quartz", "quartz.dataSource.tkm.connectionString": "Host=127.0.0.1;Database=Platform-V70;Username=postgres;Password=123456;SslMode=Prefer", "quartz.dataSource.tkm.provider": "Npgsql", + "quartz.dataSource.tkm.connectionStringName": "Default", "quartz.jobStore.clustered": "true", - "quartz.serializer.type": "json", - "quartz.dataSource.tkm.connectionStringName": "TaskManagement" + "quartz.serializer.type": "json" } }, "Redis": {