From 786e38f9de0a85bfd60d4fba7a5ace310b240819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=86=E9=91=AB?= Date: Sun, 21 Sep 2025 13:41:37 +0800 Subject: [PATCH 1/3] fix errors --- .../KonSoft.AuthServer.csproj | 9 +++++ .../KonSoftAuthServerModule.cs | 35 ++++--------------- .../Controllers/WeatherForecastController.cs | 6 ++-- .../Controllers/WeatherForecastController.cs | 6 ++-- .../Controllers/WeatherForecastController.cs | 6 ++-- .../Controllers/WeatherForecastController.cs | 6 ++-- .../AdminHttpApiHostModule.cs | 2 +- .../KonSoft.Admin.HttpApi.Host.csproj | 6 ++++ .../DispatchHttpApiHostModule.cs | 2 +- .../KonSoft.Dispatch.HttpApi.Host.csproj | 6 ++++ .../KonSoft.Payment.HttpApi.Host.csproj | 6 ++++ .../PaymentHttpApiHostModule.cs | 2 +- .../KonSoft.Report.HttpApi.Host.csproj | 6 ++++ .../ReportHttpApiHostModule.cs | 2 +- ...nSoft.TenantManagement.HttpApi.Host.csproj | 6 ++++ .../TenantManagementHttpApiHostModule.cs | 2 +- .../OpenIddictDataSeedContributor.cs | 2 +- .../KonSoft.Admin.Application.Tests.csproj | 5 +++ .../KonSoft.Admin.Domain.Tests.csproj | 5 +++ ...oft.Admin.EntityFrameworkCore.Tests.csproj | 5 +++ ...Admin.HttpApi.Client.ConsoleTestApp.csproj | 4 +++ .../OpenIddictDataSeedContributor.cs | 2 +- .../KonSoft.Dispatch.Application.Tests.csproj | 7 +++- .../KonSoft.Dispatch.Domain.Tests.csproj | 5 +++ ....Dispatch.EntityFrameworkCore.Tests.csproj | 5 +++ ...patch.HttpApi.Client.ConsoleTestApp.csproj | 4 +++ .../OpenIddictDataSeedContributor.cs | 2 +- .../KonSoft.Payment.Application.Tests.csproj | 5 +++ .../KonSoft.Payment.Domain.Tests.csproj | 7 +++- ...t.Payment.EntityFrameworkCore.Tests.csproj | 5 +++ ...yment.HttpApi.Client.ConsoleTestApp.csproj | 4 +++ ...onSoft.Report.Application.Contracts.csproj | 4 +++ .../KonSoft.Report.Application.csproj | 5 +++ .../KonSoft.Report.Domain.csproj | 4 +++ .../OpenIddictDataSeedContributor.cs | 2 +- .../KonSoft.Report.EntityFrameworkCore.csproj | 4 +++ .../KonSoft.Report.HttpApi.Client.csproj | 4 +++ .../KonSoft.Report.HttpApi.csproj | 4 +++ .../KonSoft.Report.Application.Tests.csproj | 5 +++ .../KonSoft.Report.Domain.Tests.csproj | 7 +++- ...ft.Report.EntityFrameworkCore.Tests.csproj | 5 +++ ...eport.HttpApi.Client.ConsoleTestApp.csproj | 4 +++ ...antManagement.Application.Contracts.csproj | 4 +++ ...onSoft.TenantManagement.Application.csproj | 5 +++ .../KonSoft.TenantManagement.Domain.csproj | 4 +++ .../OpenIddictDataSeedContributor.cs | 2 +- ...enantManagement.EntityFrameworkCore.csproj | 4 +++ ...oft.TenantManagement.HttpApi.Client.csproj | 4 +++ .../KonSoft.TenantManagement.HttpApi.csproj | 4 +++ ....TenantManagement.Application.Tests.csproj | 5 +++ ...nSoft.TenantManagement.Domain.Tests.csproj | 5 +++ ...anagement.EntityFrameworkCore.Tests.csproj | 5 +++ ...ement.HttpApi.Client.ConsoleTestApp.csproj | 4 +++ 53 files changed, 216 insertions(+), 53 deletions(-) diff --git a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj index 6d147fd..f91a8e1 100644 --- a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj +++ b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj @@ -55,6 +55,15 @@ + + + + + + + + + diff --git a/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs index e22f244..dc540ea 100644 --- a/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs +++ b/applications/KonSoft.AuthServer/KonSoftAuthServerModule.cs @@ -1,8 +1,3 @@ -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; -using System; -using System.IO; -using System.Linq; using Localization.Resources.AbpUi; using Medallion.Threading; using Medallion.Threading.Redis; @@ -11,15 +6,14 @@ using Microsoft.AspNetCore.Cors; using Microsoft.AspNetCore.DataProtection; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using KonSoft.EntityFrameworkCore; -using KonSoft.Localization; -using KonSoft.MultiTenancy; using StackExchange.Redis; +using System; +using System.IO; +using System.Linq; using Volo.Abp; using Volo.Abp.Account; +using Volo.Abp.Account.Localization; using Volo.Abp.Account.Web; -using Volo.Abp.AspNetCore.Mvc.UI; -using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap; using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; @@ -36,9 +30,7 @@ using Volo.Abp.Modularity; using Volo.Abp.OpenIddict; using Volo.Abp.Security.Claims; using Volo.Abp.UI.Navigation.Urls; -using Volo.Abp.UI; using Volo.Abp.VirtualFileSystem; -using Volo.Abp.Account.Localization; namespace KonSoft; @@ -50,7 +42,6 @@ namespace KonSoft; typeof(AbpAccountApplicationModule), typeof(AbpAccountHttpApiModule), typeof(AbpAspNetCoreMvcUiBasicThemeModule), - typeof(KonSoftEntityFrameworkCoreModule), typeof(AbpAspNetCoreSerilogModule) )] public class KonSoftAuthServerModule : AbpModule @@ -112,26 +103,14 @@ public class KonSoftAuthServerModule : AbpModule Configure(options => { - //options.IsEnabledForGetRequests = true; + options.IsEnabledForGetRequests = true; options.ApplicationName = "AuthServer"; }); - if (hostingEnvironment.IsDevelopment()) - { - Configure(options => - { - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}KonSoft.Domain.Shared")); - options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}KonSoft.Domain")); - }); - } - Configure(options => { options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; - options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? Array.Empty()); - - options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; - options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; + options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? []); }); Configure(options => @@ -166,7 +145,7 @@ public class KonSoftAuthServerModule : AbpModule configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty() + .ToArray() ?? [] ) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() diff --git a/applications/KonSoft.BackgroundJobs/Controllers/WeatherForecastController.cs b/applications/KonSoft.BackgroundJobs/Controllers/WeatherForecastController.cs index 66a55f4..c3d2a1d 100644 --- a/applications/KonSoft.BackgroundJobs/Controllers/WeatherForecastController.cs +++ b/applications/KonSoft.BackgroundJobs/Controllers/WeatherForecastController.cs @@ -6,10 +6,10 @@ namespace KonSoft.BackgroundJobs.Controllers [Route("[controller]")] public class WeatherForecastController : ControllerBase { - private static readonly string[] Summaries = new[] - { + private static readonly string[] Summaries = + [ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + ]; private readonly ILogger _logger; diff --git a/applications/KonSoft.BackgroundWorker/Controllers/WeatherForecastController.cs b/applications/KonSoft.BackgroundWorker/Controllers/WeatherForecastController.cs index ae0b710..b2fde33 100644 --- a/applications/KonSoft.BackgroundWorker/Controllers/WeatherForecastController.cs +++ b/applications/KonSoft.BackgroundWorker/Controllers/WeatherForecastController.cs @@ -6,10 +6,10 @@ namespace KonSoft.BackgroundWorker.Controllers [Route("[controller]")] public class WeatherForecastController : ControllerBase { - private static readonly string[] Summaries = new[] - { + private static readonly string[] Summaries = + [ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + ]; private readonly ILogger _logger; diff --git a/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs b/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs index 2fcaf5e..525870b 100644 --- a/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs +++ b/gateways/KonSoft.InternalGateway/Controllers/WeatherForecastController.cs @@ -6,10 +6,10 @@ namespace KonSoft.InternalGateway.Controllers [Route("[controller]")] public class WeatherForecastController : ControllerBase { - private static readonly string[] Summaries = new[] - { + private static readonly string[] Summaries = + [ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + ]; private readonly ILogger _logger; diff --git a/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs b/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs index 7d2536e..1af2048 100644 --- a/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs +++ b/gateways/KonSoft.PublicGateway/Controllers/WeatherForecastController.cs @@ -6,10 +6,10 @@ namespace KonSoft.PublicGateway.Controllers [Route("[controller]")] public class WeatherForecastController : ControllerBase { - private static readonly string[] Summaries = new[] - { + private static readonly string[] Summaries = + [ "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + ]; private readonly ILogger _logger; diff --git a/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs b/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs index 687e112..905d59a 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs +++ b/microservices/KonSoft.Admin.HttpApi.Host/AdminHttpApiHostModule.cs @@ -166,7 +166,7 @@ public class AdminHttpApiHostModule : AbpModule .WithOrigins(configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty()) + .ToArray() ?? []) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() diff --git a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj index 47c0620..810219e 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj +++ b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj @@ -30,4 +30,10 @@ + + + + + + diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs index 40f87cd..6f14937 100644 --- a/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/DispatchHttpApiHostModule.cs @@ -166,7 +166,7 @@ public class DispatchHttpApiHostModule : AbpModule .WithOrigins(configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty()) + .ToArray() ?? []) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() diff --git a/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj b/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj index 7789c2d..b857725 100644 --- a/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj +++ b/microservices/KonSoft.Dispatch.HttpApi.Host/KonSoft.Dispatch.HttpApi.Host.csproj @@ -30,4 +30,10 @@ + + + + + + diff --git a/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj b/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj index 3e1c497..66a2a5e 100644 --- a/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj +++ b/microservices/KonSoft.Payment.HttpApi.Host/KonSoft.Payment.HttpApi.Host.csproj @@ -30,4 +30,10 @@ + + + + + + diff --git a/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs b/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs index 5173ad7..69f4001 100644 --- a/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs +++ b/microservices/KonSoft.Payment.HttpApi.Host/PaymentHttpApiHostModule.cs @@ -166,7 +166,7 @@ public class PaymentHttpApiHostModule : AbpModule .WithOrigins(configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty()) + .ToArray() ?? []) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() diff --git a/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj b/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj index 045a4b1..e936c86 100644 --- a/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj +++ b/microservices/KonSoft.Report.HttpApi.Host/KonSoft.Report.HttpApi.Host.csproj @@ -30,4 +30,10 @@ + + + + + + diff --git a/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs b/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs index 6cca2bd..600f6eb 100644 --- a/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs +++ b/microservices/KonSoft.Report.HttpApi.Host/ReportHttpApiHostModule.cs @@ -166,7 +166,7 @@ public class ReportHttpApiHostModule : AbpModule .WithOrigins(configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty()) + .ToArray() ?? []) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj b/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj index a70d61d..3f1ccc6 100644 --- a/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/KonSoft.TenantManagement.HttpApi.Host.csproj @@ -30,4 +30,10 @@ + + + + + + diff --git a/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs index 4b37479..669560c 100644 --- a/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs +++ b/microservices/KonSoft.TenantManagement.HttpApi.Host/TenantManagementHttpApiHostModule.cs @@ -166,7 +166,7 @@ public class TenantManagementHttpApiHostModule : AbpModule .WithOrigins(configuration["App:CorsOrigins"]? .Split(",", StringSplitOptions.RemoveEmptyEntries) .Select(o => o.RemovePostFix("/")) - .ToArray() ?? Array.Empty()) + .ToArray() ?? []) .WithAbpExposedHeaders() .SetIsOriginAllowedToAllowWildcardSubdomains() .AllowAnyHeader() diff --git a/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index 1e4c9a1..986d4a8 100644 --- a/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/modules/admin/src/KonSoft.Admin.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -96,7 +96,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "Swagger Application", secret: null, - grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + grantTypes: [OpenIddictConstants.GrantTypes.AuthorizationCode], scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl diff --git a/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj b/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj index 531ac7b..83471fc 100644 --- a/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj +++ b/modules/admin/test/KonSoft.Admin.Application.Tests/KonSoft.Admin.Application.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj b/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj index 531ac7b..03eff35 100644 --- a/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj +++ b/modules/admin/test/KonSoft.Admin.Domain.Tests/KonSoft.Admin.Domain.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj index 927159e..c5346a1 100644 --- a/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj +++ b/modules/admin/test/KonSoft.Admin.EntityFrameworkCore.Tests/KonSoft.Admin.EntityFrameworkCore.Tests.csproj @@ -14,4 +14,9 @@ + + + + + diff --git a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj index f864072..f22d838 100644 --- a/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/admin/test/KonSoft.Admin.HttpApi.Client.ConsoleTestApp/KonSoft.Admin.HttpApi.Client.ConsoleTestApp.csproj @@ -29,4 +29,8 @@ + + + + diff --git a/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index 6e766f2..883ebef 100644 --- a/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/modules/dispatch/src/KonSoft.Dispatch.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -96,7 +96,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "Swagger Application", secret: null, - grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + grantTypes: [OpenIddictConstants.GrantTypes.AuthorizationCode], scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl diff --git a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj index b1cfec9..6f36e05 100644 --- a/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj +++ b/modules/dispatch/test/KonSoft.Dispatch.Application.Tests/KonSoft.Dispatch.Application.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj index b1cfec9..1fb82d7 100644 --- a/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj +++ b/modules/dispatch/test/KonSoft.Dispatch.Domain.Tests/KonSoft.Dispatch.Domain.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj index 82e25a7..d14f4af 100644 --- a/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj +++ b/modules/dispatch/test/KonSoft.Dispatch.EntityFrameworkCore.Tests/KonSoft.Dispatch.EntityFrameworkCore.Tests.csproj @@ -14,4 +14,9 @@ + + + + + diff --git a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj index f864072..dd8725e 100644 --- a/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/dispatch/test/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp/KonSoft.Dispatch.HttpApi.Client.ConsoleTestApp.csproj @@ -29,4 +29,8 @@ + + + + diff --git a/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index 2487dd9..0d512c4 100644 --- a/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/modules/payment/src/KonSoft.Payment.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -96,7 +96,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "Swagger Application", secret: null, - grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + grantTypes: [OpenIddictConstants.GrantTypes.AuthorizationCode], scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl diff --git a/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj b/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj index 98fd8bb..e5123a4 100644 --- a/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj +++ b/modules/payment/test/KonSoft.Payment.Application.Tests/KonSoft.Payment.Application.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj b/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj index 98fd8bb..18ae7f8 100644 --- a/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj +++ b/modules/payment/test/KonSoft.Payment.Domain.Tests/KonSoft.Payment.Domain.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj index 283fe3e..b4fbf07 100644 --- a/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj +++ b/modules/payment/test/KonSoft.Payment.EntityFrameworkCore.Tests/KonSoft.Payment.EntityFrameworkCore.Tests.csproj @@ -14,4 +14,9 @@ + + + + + diff --git a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj index f864072..3887c3e 100644 --- a/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/payment/test/KonSoft.Payment.HttpApi.Client.ConsoleTestApp/KonSoft.Payment.HttpApi.Client.ConsoleTestApp.csproj @@ -29,4 +29,8 @@ + + + + diff --git a/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj b/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj index 46d0292..5eb80a1 100644 --- a/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj +++ b/modules/report/src/KonSoft.Report.Application.Contracts/KonSoft.Report.Application.Contracts.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj b/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj index 2ac716d..8385d56 100644 --- a/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj +++ b/modules/report/src/KonSoft.Report.Application/KonSoft.Report.Application.csproj @@ -15,4 +15,9 @@ + + + + + diff --git a/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj b/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj index 57b6cdc..0ef70c7 100644 --- a/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj +++ b/modules/report/src/KonSoft.Report.Domain/KonSoft.Report.Domain.csproj @@ -19,4 +19,8 @@ + + + + diff --git a/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index e2b734f..7a1a960 100644 --- a/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/modules/report/src/KonSoft.Report.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -96,7 +96,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "Swagger Application", secret: null, - grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + grantTypes: [OpenIddictConstants.GrantTypes.AuthorizationCode], scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl diff --git a/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj b/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj index cdaa6a2..bd5eac4 100644 --- a/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj +++ b/modules/report/src/KonSoft.Report.EntityFrameworkCore/KonSoft.Report.EntityFrameworkCore.csproj @@ -25,4 +25,8 @@ + + + + diff --git a/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj b/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj index 0bf7907..5149116 100644 --- a/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj +++ b/modules/report/src/KonSoft.Report.HttpApi.Client/KonSoft.Report.HttpApi.Client.csproj @@ -20,4 +20,8 @@ + + + + diff --git a/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj b/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj index 7d3da14..5ea5fa4 100644 --- a/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj +++ b/modules/report/src/KonSoft.Report.HttpApi/KonSoft.Report.HttpApi.csproj @@ -15,4 +15,8 @@ + + + + diff --git a/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj b/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj index bddcba4..9d07c33 100644 --- a/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj +++ b/modules/report/test/KonSoft.Report.Application.Tests/KonSoft.Report.Application.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj b/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj index bddcba4..6311f82 100644 --- a/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj +++ b/modules/report/test/KonSoft.Report.Domain.Tests/KonSoft.Report.Domain.Tests.csproj @@ -1,4 +1,4 @@ - + net8.0 @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj index ed0dfd3..5735abe 100644 --- a/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj +++ b/modules/report/test/KonSoft.Report.EntityFrameworkCore.Tests/KonSoft.Report.EntityFrameworkCore.Tests.csproj @@ -14,4 +14,9 @@ + + + + + diff --git a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj index f864072..06910fa 100644 --- a/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/report/test/KonSoft.Report.HttpApi.Client.ConsoleTestApp/KonSoft.Report.HttpApi.Client.ConsoleTestApp.csproj @@ -29,4 +29,8 @@ + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj index 19fa328..51f3101 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application.Contracts/KonSoft.TenantManagement.Application.Contracts.csproj @@ -16,4 +16,8 @@ + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj index cffa339..76b8fa9 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Application/KonSoft.TenantManagement.Application.csproj @@ -15,4 +15,9 @@ + + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj index 902488f..fe6ddbc 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/KonSoft.TenantManagement.Domain.csproj @@ -19,4 +19,8 @@ + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs index 595dc86..b085f69 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs +++ b/modules/tenant-management/src/KonSoft.TenantManagement.Domain/OpenIddict/OpenIddictDataSeedContributor.cs @@ -96,7 +96,7 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep consentType: OpenIddictConstants.ConsentTypes.Implicit, displayName: "Swagger Application", secret: null, - grantTypes: new List { OpenIddictConstants.GrantTypes.AuthorizationCode, }, + grantTypes: [OpenIddictConstants.GrantTypes.AuthorizationCode], scopes: commonScopes, redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", clientUri: swaggerRootUrl diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj index 2f144cf..e5217c1 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.EntityFrameworkCore/KonSoft.TenantManagement.EntityFrameworkCore.csproj @@ -25,4 +25,8 @@ + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj index 82f550a..14507cf 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi.Client/KonSoft.TenantManagement.HttpApi.Client.csproj @@ -20,4 +20,8 @@ + + + + diff --git a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj index 5d0312a..038551c 100644 --- a/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj +++ b/modules/tenant-management/src/KonSoft.TenantManagement.HttpApi/KonSoft.TenantManagement.HttpApi.csproj @@ -15,4 +15,8 @@ + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj index 27353a3..e173281 100644 --- a/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Application.Tests/KonSoft.TenantManagement.Application.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj index 27353a3..c6636ec 100644 --- a/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj +++ b/modules/tenant-management/test/KonSoft.TenantManagement.Domain.Tests/KonSoft.TenantManagement.Domain.Tests.csproj @@ -10,4 +10,9 @@ + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj index dcb976d..9491af0 100644 --- a/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj +++ b/modules/tenant-management/test/KonSoft.TenantManagement.EntityFrameworkCore.Tests/KonSoft.TenantManagement.EntityFrameworkCore.Tests.csproj @@ -14,4 +14,9 @@ + + + + + diff --git a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj index f864072..acedc19 100644 --- a/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/tenant-management/test/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp/KonSoft.TenantManagement.HttpApi.Client.ConsoleTestApp.csproj @@ -29,4 +29,8 @@ + + + + From 88066a2547678c74b6ab2524c3bd43d2df9884bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=86=E9=91=AB?= Date: Tue, 23 Sep 2025 18:29:10 +0800 Subject: [PATCH 2/3] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9Edocker=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 30 +++++++++++++++++ applications/KonSoft.AuthServer/Dockerfile | 24 ++++++++++++++ .../KonSoft.AuthServer.csproj | 3 ++ .../Properties/launchSettings.json | 31 ++++++++++++------ .../KonSoft.Admin.HttpApi.Host/Dockerfile | 32 +++++++++++++++++++ .../KonSoft.Admin.HttpApi.Host.csproj | 3 ++ .../Properties/launchSettings.json | 31 ++++++++++++------ 7 files changed, 134 insertions(+), 20 deletions(-) create mode 100644 .dockerignore create mode 100644 applications/KonSoft.AuthServer/Dockerfile create mode 100644 microservices/KonSoft.Admin.HttpApi.Host/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/Dockerfile b/applications/KonSoft.AuthServer/Dockerfile new file mode 100644 index 0000000..260756b --- /dev/null +++ b/applications/KonSoft.AuthServer/Dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["NuGet.Config", "."] +COPY ["applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj", "applications/KonSoft.AuthServer/"] +RUN dotnet restore "./applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj" +COPY . . +WORKDIR "/src/applications/KonSoft.AuthServer" +RUN dotnet build "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "KonSoft.AuthServer.dll"] \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj index f91a8e1..8481f66 100644 --- a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj +++ b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj @@ -11,6 +11,8 @@ false true KonSoft-4681b4fd-151f-4221-84a4-929d86723e4c + Linux + ..\.. @@ -37,6 +39,7 @@ + diff --git a/applications/KonSoft.AuthServer/Properties/launchSettings.json b/applications/KonSoft.AuthServer/Properties/launchSettings.json index 67f6051..ba47da3 100644 --- a/applications/KonSoft.AuthServer/Properties/launchSettings.json +++ b/applications/KonSoft.AuthServer/Properties/launchSettings.json @@ -1,12 +1,4 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "https://localhost:44322", - "sslPort": 44322 - } - }, "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -18,10 +10,29 @@ "KonSoft.AuthServer": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:44322", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:44322" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44322", + "sslPort": 44322 } } } \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile b/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile new file mode 100644 index 0000000..98750c8 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile @@ -0,0 +1,32 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + + +# 此阶段用于生成服务项目 +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["NuGet.Config", "."] +COPY ["microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj", "microservices/KonSoft.Admin.HttpApi.Host/"] +COPY ["modules/admin/src/KonSoft.Admin.Application/KonSoft.Admin.Application.csproj", "modules/admin/src/KonSoft.Admin.Application/"] +COPY ["modules/admin/src/KonSoft.Admin.Domain/KonSoft.Admin.Domain.csproj", "modules/admin/src/KonSoft.Admin.Domain/"] +COPY ["modules/admin/src/KonSoft.Admin.Domain.Shared/KonSoft.Admin.Domain.Shared.csproj", "modules/admin/src/KonSoft.Admin.Domain.Shared/"] +COPY ["modules/admin/src/KonSoft.Admin.Application.Contracts/KonSoft.Admin.Application.Contracts.csproj", "modules/admin/src/KonSoft.Admin.Application.Contracts/"] +COPY ["modules/admin/src/KonSoft.Admin.EntityFrameworkCore/KonSoft.Admin.EntityFrameworkCore.csproj", "modules/admin/src/KonSoft.Admin.EntityFrameworkCore/"] +COPY ["modules/admin/src/KonSoft.Admin.HttpApi/KonSoft.Admin.HttpApi.csproj", "modules/admin/src/KonSoft.Admin.HttpApi/"] +RUN dotnet restore "./microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj" +COPY . . +WORKDIR "/src/microservices/KonSoft.Admin.HttpApi.Host" +RUN dotnet build "./KonSoft.Admin.HttpApi.Host.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./KonSoft.Admin.HttpApi.Host.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "KonSoft.Admin.HttpApi.Host.dll"] \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj index 810219e..3bac00b 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj +++ b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj @@ -6,9 +6,12 @@ KonSoft.Admin true KonSoft.Admin-4681b4fd-151f-4221-84a4-929d86723e4c + Linux + ..\.. + diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json index 6beb1ca..67003eb 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json +++ b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json @@ -1,12 +1,4 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "https://localhost:44354", - "sslPort": 44354 - } - }, "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -18,10 +10,29 @@ "KonSoft.Admin.HttpApi.Host": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:44354", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:44354" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44354", + "sslPort": 44354 } } } \ No newline at end of file From 1ba897422205ea763178c343dc886075aaedc5da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E5=85=86=E9=91=AB?= Date: Tue, 23 Sep 2025 18:29:10 +0800 Subject: [PATCH 3/3] =?UTF-8?q?feat=20=E6=96=B0=E5=A2=9Edocker=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 30 ++++++++++++++++++ applications/KonSoft.AuthServer/Dockerfile | 24 ++++++++++++++ .../KonSoft.AuthServer.csproj | 3 ++ .../Properties/launchSettings.json | 31 +++++++++++++------ .../KonSoft.Admin.HttpApi.Host/Dockerfile | 30 ++++++++++++++++++ .../KonSoft.Admin.HttpApi.Host.csproj | 3 ++ .../Properties/launchSettings.json | 31 +++++++++++++------ 7 files changed, 132 insertions(+), 20 deletions(-) create mode 100644 .dockerignore create mode 100644 applications/KonSoft.AuthServer/Dockerfile create mode 100644 microservices/KonSoft.Admin.HttpApi.Host/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..fe1152b --- /dev/null +++ b/.dockerignore @@ -0,0 +1,30 @@ +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/azds.yaml +**/bin +**/charts +**/docker-compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +LICENSE +README.md +!**/.gitignore +!.git/HEAD +!.git/config +!.git/packed-refs +!.git/refs/heads/** \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/Dockerfile b/applications/KonSoft.AuthServer/Dockerfile new file mode 100644 index 0000000..260756b --- /dev/null +++ b/applications/KonSoft.AuthServer/Dockerfile @@ -0,0 +1,24 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["NuGet.Config", "."] +COPY ["applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj", "applications/KonSoft.AuthServer/"] +RUN dotnet restore "./applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj" +COPY . . +WORKDIR "/src/applications/KonSoft.AuthServer" +RUN dotnet build "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "KonSoft.AuthServer.dll"] \ No newline at end of file diff --git a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj index f91a8e1..8481f66 100644 --- a/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj +++ b/applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj @@ -11,6 +11,8 @@ false true KonSoft-4681b4fd-151f-4221-84a4-929d86723e4c + Linux + ..\.. @@ -37,6 +39,7 @@ + diff --git a/applications/KonSoft.AuthServer/Properties/launchSettings.json b/applications/KonSoft.AuthServer/Properties/launchSettings.json index 67f6051..ba47da3 100644 --- a/applications/KonSoft.AuthServer/Properties/launchSettings.json +++ b/applications/KonSoft.AuthServer/Properties/launchSettings.json @@ -1,12 +1,4 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "https://localhost:44322", - "sslPort": 44322 - } - }, "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -18,10 +10,29 @@ "KonSoft.AuthServer": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:44322", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:44322" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44322", + "sslPort": 44322 } } } \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile b/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile new file mode 100644 index 0000000..9284b90 --- /dev/null +++ b/microservices/KonSoft.Admin.HttpApi.Host/Dockerfile @@ -0,0 +1,30 @@ +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base +USER $APP_UID +WORKDIR /app +EXPOSE 8080 +EXPOSE 8081 + +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build +ARG BUILD_CONFIGURATION=Release +WORKDIR /src +COPY ["NuGet.Config", "."] +COPY ["microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj", "microservices/KonSoft.Admin.HttpApi.Host/"] +COPY ["modules/admin/src/KonSoft.Admin.Application/KonSoft.Admin.Application.csproj", "modules/admin/src/KonSoft.Admin.Application/"] +COPY ["modules/admin/src/KonSoft.Admin.Domain/KonSoft.Admin.Domain.csproj", "modules/admin/src/KonSoft.Admin.Domain/"] +COPY ["modules/admin/src/KonSoft.Admin.Domain.Shared/KonSoft.Admin.Domain.Shared.csproj", "modules/admin/src/KonSoft.Admin.Domain.Shared/"] +COPY ["modules/admin/src/KonSoft.Admin.Application.Contracts/KonSoft.Admin.Application.Contracts.csproj", "modules/admin/src/KonSoft.Admin.Application.Contracts/"] +COPY ["modules/admin/src/KonSoft.Admin.EntityFrameworkCore/KonSoft.Admin.EntityFrameworkCore.csproj", "modules/admin/src/KonSoft.Admin.EntityFrameworkCore/"] +COPY ["modules/admin/src/KonSoft.Admin.HttpApi/KonSoft.Admin.HttpApi.csproj", "modules/admin/src/KonSoft.Admin.HttpApi/"] +RUN dotnet restore "./microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj" +COPY . . +WORKDIR "/src/microservices/KonSoft.Admin.HttpApi.Host" +RUN dotnet build "./KonSoft.Admin.HttpApi.Host.csproj" -c $BUILD_CONFIGURATION -o /app/build + +FROM build AS publish +ARG BUILD_CONFIGURATION=Release +RUN dotnet publish "./KonSoft.Admin.HttpApi.Host.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false + +FROM base AS final +WORKDIR /app +COPY --from=publish /app/publish . +ENTRYPOINT ["dotnet", "KonSoft.Admin.HttpApi.Host.dll"] \ No newline at end of file diff --git a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj index 810219e..3bac00b 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj +++ b/microservices/KonSoft.Admin.HttpApi.Host/KonSoft.Admin.HttpApi.Host.csproj @@ -6,9 +6,12 @@ KonSoft.Admin true KonSoft.Admin-4681b4fd-151f-4221-84a4-929d86723e4c + Linux + ..\.. + diff --git a/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json index 6beb1ca..67003eb 100644 --- a/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json +++ b/microservices/KonSoft.Admin.HttpApi.Host/Properties/launchSettings.json @@ -1,12 +1,4 @@ { - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "https://localhost:44354", - "sslPort": 44354 - } - }, "profiles": { "IIS Express": { "commandName": "IISExpress", @@ -18,10 +10,29 @@ "KonSoft.Admin.HttpApi.Host": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "https://localhost:44354", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "applicationUrl": "https://localhost:44354" + }, + "Container (Dockerfile)": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}", + "environmentVariables": { + "ASPNETCORE_HTTPS_PORTS": "8081", + "ASPNETCORE_HTTP_PORTS": "8080" + }, + "publishAllPorts": true, + "useSSL": true + } + }, + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:44354", + "sslPort": 44354 } } } \ No newline at end of file