Compare commits
	
		
			73 Commits
		
	
	
		
			151384da99
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| ea3a825825 | |||
| 90f0040f63 | |||
| d4e54f5709 | |||
| 8d9e7658d7 | |||
| d340be4e2c | |||
| 4afd7924b7 | |||
| 30e5e6a4dc | |||
| df78f842f3 | |||
| 5138daebea | |||
| bbead3a651 | |||
| 802624e7ea | |||
| b2bccc34f5 | |||
| f060641e97 | |||
| e7aaacc410 | |||
| 75cd096b60 | |||
| e4629b1771 | |||
| b699762c1b | |||
| 931ecbd4bc | |||
| 79171b51b2 | |||
| 29201fa84e | |||
| 7171ac44ac | |||
| 1b82fc3545 | |||
| e3b058a4e8 | |||
| 42a4f1e2c4 | |||
| 60c4958adf | |||
| 2e61ed8f92 | |||
| b0b95d54fe | |||
| efce7162c4 | |||
| 4eac47edfa | |||
| eb8e9c3a8a | |||
| 6dd678ec31 | |||
| ab1ffad658 | |||
| b8a25b3b52 | |||
| fdfabd725b | |||
| 8d479feaee | |||
| c5e9ab2e5a | |||
| f0d1e719ac | |||
| f832949999 | |||
| b2af429f25 | |||
| de6c5f044a | |||
| 578967e3e8 | |||
| 5a8ecd01d6 | |||
| 00aef89ed7 | |||
| e783b23baa | |||
| a8413057e4 | |||
| a234d3255e | |||
| 08b37ba79f | |||
| 04e324e900 | |||
| 283c30310a | |||
| ab8f120366 | |||
| a695a21bcb | |||
| 0f55e2e108 | |||
| 3776a011ed | |||
| 2360504491 | |||
| e79925f402 | |||
| 6573602530 | |||
| 9028667b7a | |||
| d0d09fc875 | |||
| e15afa8e3d | |||
| b05264153c | |||
| 136ad489b4 | |||
| 15cef7a060 | |||
| edc75c67fb | |||
| 423900e092 | |||
| d70bb9f596 | |||
| 365acca3ab | |||
| 1aa2f5f0cf | |||
| 46c0c446fd | |||
| b948719917 | |||
| 89590b1088 | |||
| 7b3499d692 | |||
| 0eb4e5ca77 | |||
| bb59bbb7cf | 
							
								
								
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										3
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| @ -263,3 +263,6 @@ src/KonSoft.Admin.Blazor.Server.Tiered/Logs/* | |||||||
|  |  | ||||||
| # Use abp install-libs to restore. | # Use abp install-libs to restore. | ||||||
| **/wwwroot/libs/* | **/wwwroot/libs/* | ||||||
|  |  | ||||||
|  | **/Logs/* | ||||||
|  | **/logs.txt | ||||||
							
								
								
									
										16
									
								
								KonSoft.sln
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								KonSoft.sln
									
									
									
									
									
								
							| @ -193,6 +193,17 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.Gate | |||||||
| EndProject | EndProject | ||||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.Microservices", "shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj", "{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}" | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.Hosting.Microservices", "shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj", "{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}" | ||||||
| EndProject | EndProject | ||||||
|  | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KonSoft.Shared.DbMigrator", "shared\KonSoft.Shared.DbMigrator\KonSoft.Shared.DbMigrator.csproj", "{AFCC65BC-8477-819B-2575-674AC9D2FDDD}" | ||||||
|  | EndProject | ||||||
|  | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution items", "Solution items", "{72B7AEA8-8968-469E-AFFC-170E572D640F}" | ||||||
|  | 	ProjectSection(SolutionItems) = preProject | ||||||
|  | 		.gitignore = .gitignore | ||||||
|  | 		adminservice.Jenkinsfile = adminservice.Jenkinsfile | ||||||
|  | 		authserver.Jenkinsfile = authserver.Jenkinsfile | ||||||
|  | 		docker-compose.yml = docker-compose.yml | ||||||
|  | 		internalgateway.Jenkinsfile = internalgateway.Jenkinsfile | ||||||
|  | 	EndProjectSection | ||||||
|  | EndProject | ||||||
| Global | Global | ||||||
| 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | 	GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||||
| 		Debug|Any CPU = Debug|Any CPU | 		Debug|Any CPU = Debug|Any CPU | ||||||
| @ -499,6 +510,10 @@ Global | |||||||
| 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Debug|Any CPU.Build.0 = Debug|Any CPU | 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
| 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.ActiveCfg = Release|Any CPU | 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
| 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.Build.0 = Release|Any CPU | 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
|  | 		{AFCC65BC-8477-819B-2575-674AC9D2FDDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||||||
|  | 		{AFCC65BC-8477-819B-2575-674AC9D2FDDD}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||||||
|  | 		{AFCC65BC-8477-819B-2575-674AC9D2FDDD}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||||||
|  | 		{AFCC65BC-8477-819B-2575-674AC9D2FDDD}.Release|Any CPU.Build.0 = Release|Any CPU | ||||||
| 	EndGlobalSection | 	EndGlobalSection | ||||||
| 	GlobalSection(SolutionProperties) = preSolution | 	GlobalSection(SolutionProperties) = preSolution | ||||||
| 		HideSolutionNode = FALSE | 		HideSolutionNode = FALSE | ||||||
| @ -594,6 +609,7 @@ Global | |||||||
| 		{8CA6B487-3AAF-4E77-ACE0-01D878DE4836} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | 		{8CA6B487-3AAF-4E77-ACE0-01D878DE4836} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | ||||||
| 		{BBB1A129-9ED7-4F08-B710-B6C287197BFB} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | 		{BBB1A129-9ED7-4F08-B710-B6C287197BFB} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | ||||||
| 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | 		{ADF28580-F8A0-4495-96D6-736C6C7CF3FF} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | ||||||
|  | 		{AFCC65BC-8477-819B-2575-674AC9D2FDDD} = {7EFFD2C6-2041-4967-A715-0F817D70C433} | ||||||
| 	EndGlobalSection | 	EndGlobalSection | ||||||
| 	GlobalSection(ExtensibilityGlobals) = postSolution | 	GlobalSection(ExtensibilityGlobals) = postSolution | ||||||
| 		SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} | 		SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} | ||||||
|  | |||||||
| @ -21,4 +21,5 @@ | |||||||
| 	<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String> | 	<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String> | ||||||
| 	<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String> | 	<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String> | ||||||
| 	<s:Boolean x:Key="/Default/UserDictionary/Words/=Consts/@EntryIndexedValue">True</s:Boolean> | 	<s:Boolean x:Key="/Default/UserDictionary/Words/=Consts/@EntryIndexedValue">True</s:Boolean> | ||||||
|  | 	<s:Boolean x:Key="/Default/UserDictionary/Words/=Iddict/@EntryIndexedValue">True</s:Boolean> | ||||||
| </wpf:ResourceDictionary> | </wpf:ResourceDictionary> | ||||||
| @ -2,17 +2,12 @@ pipeline { | |||||||
|     agent any |     agent any | ||||||
|      |      | ||||||
|     stages { |     stages { | ||||||
|         stage('Clone') { |  | ||||||
|             steps { |  | ||||||
|                 checkout scm |  | ||||||
|             } |  | ||||||
|         } |  | ||||||
|          |  | ||||||
|         stage('Deploy') { |         stage('Deploy') { | ||||||
|             steps { |             steps { | ||||||
|                 script { |                 script { | ||||||
|                     try { |                     try { | ||||||
|                         sh 'docker compose up -d adminservice -- build' |                         sh '/usr/libexec/docker/cli-plugins/docker-compose -f ./docker-compose.yml up --build -d adminservice' | ||||||
|                     } catch (Exception e) { |                     } catch (Exception e) { | ||||||
|                         error "部署失败: ${e.message}" |                         error "部署失败: ${e.message}" | ||||||
|                     } |                     } | ||||||
|  | |||||||
| @ -1,23 +1,32 @@ | |||||||
| FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | ||||||
| USER $APP_UID | USER $APP_UID | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 8081 | EXPOSE 8080 | ||||||
|  |  | ||||||
| FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||||||
| ARG BUILD_CONFIGURATION=Release | ARG BUILD_CONFIGURATION=Release | ||||||
| ARG NODE_VERSION=16.13.0 | ARG NODE_VERSION=16.13.0 | ||||||
| ARG YARN_VERSION=1.22.15 | ARG YARN_VERSION=1.22.15 | ||||||
| RUN apt-get update -yq \ | RUN echo "deb https://mirrors.huaweicloud.com/debian/ bookworm main contrib non-free non-free-firmware" > /etc/apt/sources.list && \ | ||||||
|     && apt-get install -yq curl gnupg \ |     echo "deb https://mirrors.huaweicloud.com/debian/ bookworm-updates main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ | ||||||
|     && curl -sL https://deb.nodesource.com/setup_16.x | bash - \ |     echo "deb https://mirrors.huaweicloud.com/debian/ bookworm-backports main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ | ||||||
|     && apt-get install -yq nodejs \ |     echo "deb https://mirrors.huaweicloud.com/debian-security bookworm-security main contrib non-free non-free-firmware" >> /etc/apt/sources.list && \ | ||||||
|     && npm install -g yarn@${YARN_VERSION} \ |     apt-get update -yq && \ | ||||||
|     && apt-get clean \ |     apt-get install -yq curl gnupg && \ | ||||||
|     && rm -rf /var/lib/apt/lists/* |     curl -sL https://deb.nodesource.com/setup_16.x | bash - && \ | ||||||
|  |     apt-get install -yq nodejs && \ | ||||||
|  |     npm install -g yarn@${YARN_VERSION} && \ | ||||||
|  |     apt-get clean && \ | ||||||
|  |     rm -rf /var/lib/apt/lists/* | ||||||
| ARG BUILD_CONFIGURATION=Release | ARG BUILD_CONFIGURATION=Release | ||||||
| WORKDIR /src | WORKDIR /src | ||||||
| COPY ["NuGet.Config", "."] | COPY ["NuGet.Config", "."] | ||||||
| COPY ["applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj", "applications/KonSoft.AuthServer/"] | COPY ["applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj", "applications/KonSoft.AuthServer/"] | ||||||
|  | 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 ["shared/KonSoft.Shared.Hosting.Microservices/KonSoft.Shared.Hosting.Microservices.csproj", "shared/KonSoft.Shared.Hosting.Microservices/"] | COPY ["shared/KonSoft.Shared.Hosting.Microservices/KonSoft.Shared.Hosting.Microservices.csproj", "shared/KonSoft.Shared.Hosting.Microservices/"] | ||||||
| COPY ["shared/KonSoft.Shared.Hosting.AspNetCore/KonSoft.Shared.Hosting.AspNetCore.csproj", "shared/KonSoft.Shared.Hosting.AspNetCore/"] | COPY ["shared/KonSoft.Shared.Hosting.AspNetCore/KonSoft.Shared.Hosting.AspNetCore.csproj", "shared/KonSoft.Shared.Hosting.AspNetCore/"] | ||||||
| COPY ["shared/KonSoft.Shared.Hosting/KonSoft.Shared.Hosting.csproj", "shared/KonSoft.Shared.Hosting/"] | COPY ["shared/KonSoft.Shared.Hosting/KonSoft.Shared.Hosting.csproj", "shared/KonSoft.Shared.Hosting/"] | ||||||
| @ -25,9 +34,13 @@ COPY ["shared/KonSoft.Shared.Localization/KonSoft.Shared.Localization.csproj", " | |||||||
| RUN dotnet restore "./applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj" | RUN dotnet restore "./applications/KonSoft.AuthServer/KonSoft.AuthServer.csproj" | ||||||
| COPY . . | COPY . . | ||||||
| WORKDIR "/src/applications/KonSoft.AuthServer" | WORKDIR "/src/applications/KonSoft.AuthServer" | ||||||
| RUN dotnet tool install -g Volo.Abp.Cli \ | RUN dotnet nuget locals all --clear | ||||||
|     && export PATH="$PATH:/root/.dotnet/tools" \ | RUN dotnet nuget add source https://mirrors.huaweicloud.com/repository/nuget/v3/index.json -n HuaweiCloud | ||||||
|     && abp install-libs | RUN dotnet tool install -g Volo.Abp.Cli --version 8.3.4 | ||||||
|  | ENV PATH="$PATH:/root/.dotnet/tools" | ||||||
|  | RUN yarn config set registry https://registry.npmmirror.com | ||||||
|  | RUN yarn cache clean | ||||||
|  | RUN abp install-libs | ||||||
| RUN dotnet build "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/build | RUN dotnet build "./KonSoft.AuthServer.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||||||
|  |  | ||||||
| # 此阶段用于发布要复制到最终阶段的服务项目 | # 此阶段用于发布要复制到最终阶段的服务项目 | ||||||
|  | |||||||
| @ -59,6 +59,8 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|  |     <ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.Application\KonSoft.Admin.Application.csproj" /> | ||||||
|  |     <ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.EntityFrameworkCore\KonSoft.Admin.EntityFrameworkCore.csproj" /> | ||||||
|     <ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj" /> |     <ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Microservices\KonSoft.Shared.Hosting.Microservices.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,15 +1,23 @@ | |||||||
|  | using KonSoft.Admin; | ||||||
|  | using KonSoft.Admin.EntityFrameworkCore; | ||||||
| using KonSoft.Shared.Hosting.AspNetCore; | using KonSoft.Shared.Hosting.AspNetCore; | ||||||
| using KonSoft.Shared.Hosting.Microservices; | using KonSoft.Shared.Hosting.Microservices; | ||||||
| using KonSoft.Shared.Localization.Localization; | using KonSoft.Shared.Localization.Localization; | ||||||
| using Localization.Resources.AbpUi; | using Localization.Resources.AbpUi; | ||||||
| using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||||
|  | using Microsoft.AspNetCore.Cors; | ||||||
|  | using Microsoft.AspNetCore.HttpOverrides; | ||||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Microsoft.Extensions.Hosting; | using Microsoft.Extensions.Hosting; | ||||||
|  | using System; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Net; | ||||||
| using Volo.Abp; | using Volo.Abp; | ||||||
| using Volo.Abp.Account; | using Volo.Abp.Account; | ||||||
| using Volo.Abp.Account.Localization; | using Volo.Abp.Account.Localization; | ||||||
| using Volo.Abp.Account.Web; | using Volo.Abp.Account.Web; | ||||||
| using Volo.Abp.AspNetCore.Mvc.UI.Bundling; | using Volo.Abp.AspNetCore.Mvc.UI.Bundling; | ||||||
|  | using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic; | ||||||
| using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; | using Volo.Abp.AspNetCore.Mvc.UI.Theme.Basic.Bundling; | ||||||
| using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; | using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; | ||||||
| using Volo.Abp.Auditing; | using Volo.Abp.Auditing; | ||||||
| @ -18,13 +26,18 @@ using Volo.Abp.Localization; | |||||||
| using Volo.Abp.Modularity; | using Volo.Abp.Modularity; | ||||||
| using Volo.Abp.OpenIddict; | using Volo.Abp.OpenIddict; | ||||||
| using Volo.Abp.Security.Claims; | using Volo.Abp.Security.Claims; | ||||||
|  | using Volo.Abp.UI.Navigation.Urls; | ||||||
|  | using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork; | ||||||
|  |  | ||||||
| namespace KonSoft; | namespace KonSoft; | ||||||
|  |  | ||||||
| [DependsOn( | [DependsOn( | ||||||
|     typeof(AbpAccountWebOpenIddictModule), |     typeof(AbpAccountWebOpenIddictModule), | ||||||
|     typeof(AbpAccountApplicationModule), |     typeof(AbpAccountApplicationModule), | ||||||
|     typeof(AbpAccountHttpApiModule), |     typeof(AbpAccountHttpApiModule),  | ||||||
|  |     typeof(AdminApplicationModule), | ||||||
|  |     typeof(AdminEntityFrameworkCoreModule), | ||||||
|  |     typeof(AbpAspNetCoreMvcUiBasicThemeModule), | ||||||
|     typeof(KonSoftSharedHostingMicroservicesModule) |     typeof(KonSoftSharedHostingMicroservicesModule) | ||||||
| )] | )] | ||||||
| public class KonSoftAuthServerModule : AbpModule | public class KonSoftAuthServerModule : AbpModule | ||||||
| @ -38,12 +51,22 @@ public class KonSoftAuthServerModule : AbpModule | |||||||
|         { |         { | ||||||
|             builder.AddValidation(options => |             builder.AddValidation(options => | ||||||
|             { |             { | ||||||
|                 options.AddAudiences("KonSoft"); |                 options.AddAudiences(KonSoftConsts.AuthServerAudience); | ||||||
|                 options.UseLocalServer(); |                 options.UseLocalServer(); | ||||||
|                 options.UseAspNetCore(); |                 options.UseAspNetCore(); | ||||||
|             }); |             }); | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         PreConfigure<ForwardedHeadersOptions>(options => | ||||||
|  |         { | ||||||
|  |             options.ForwardedHeaders = ForwardedHeaders.XForwardedFor | | ||||||
|  |                                        ForwardedHeaders.XForwardedProto | | ||||||
|  |                                        ForwardedHeaders.XForwardedHost; | ||||||
|  |  | ||||||
|  |             options.KnownNetworks.Add(new IPNetwork(IPAddress.Parse("::ffff:127.0.0.1"), 104)); | ||||||
|  |             options.KnownProxies.Add(IPAddress.Parse("::ffff:127.0.0.1")); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|         if (!hostingEnvironment.IsDevelopment()) |         if (!hostingEnvironment.IsDevelopment()) | ||||||
|         { |         { | ||||||
|             PreConfigure<AbpOpenIddictAspNetCoreOptions>(options => |             PreConfigure<AbpOpenIddictAspNetCoreOptions>(options => | ||||||
| @ -88,12 +111,41 @@ public class KonSoftAuthServerModule : AbpModule | |||||||
|             options.ApplicationName = "AuthServer"; |             options.ApplicationName = "AuthServer"; | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         Configure<AppUrlOptions>(options => | ||||||
|  |         { | ||||||
|  |             options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"]; | ||||||
|  |             options.RedirectAllowedUrls.AddRange(configuration["App:RedirectAllowedUrls"]?.Split(',') ?? | ||||||
|  |                                                  Array.Empty<string>()); | ||||||
|  |  | ||||||
|  |             options.Applications["Angular"].RootUrl = configuration["App:ClientUrl"]; | ||||||
|  |             options.Applications["Angular"].Urls[AccountUrlNames.PasswordReset] = "account/reset-password"; | ||||||
|  |         }); | ||||||
|  |  | ||||||
|         Configure<AbpBackgroundJobOptions>(options => { options.IsJobExecutionEnabled = false; }); |         Configure<AbpBackgroundJobOptions>(options => { options.IsJobExecutionEnabled = false; }); | ||||||
|  |  | ||||||
|         context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options => |         context.Services.Configure<AbpClaimsPrincipalFactoryOptions>(options => | ||||||
|         { |         { | ||||||
|             options.IsDynamicClaimsEnabled = true; |             options.IsDynamicClaimsEnabled = true; | ||||||
|         }); |         }); | ||||||
|  |  | ||||||
|  |         context.Services.AddCors(options => | ||||||
|  |         { | ||||||
|  |             options.AddDefaultPolicy(builder => | ||||||
|  |             { | ||||||
|  |                 builder | ||||||
|  |                     .WithOrigins( | ||||||
|  |                         configuration["App:CorsOrigins"]? | ||||||
|  |                             .Split(",", StringSplitOptions.RemoveEmptyEntries) | ||||||
|  |                             .Select(o => o.RemovePostFix("/")) | ||||||
|  |                             .ToArray() ?? Array.Empty<string>() | ||||||
|  |                     ) | ||||||
|  |                     .WithAbpExposedHeaders() | ||||||
|  |                     .SetIsOriginAllowedToAllowWildcardSubdomains() | ||||||
|  |                     .AllowAnyHeader() | ||||||
|  |                     .AllowAnyMethod() | ||||||
|  |                     .AllowCredentials(); | ||||||
|  |             }); | ||||||
|  |         }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public override void OnApplicationInitialization(ApplicationInitializationContext context) |     public override void OnApplicationInitialization(ApplicationInitializationContext context) | ||||||
| @ -101,18 +153,19 @@ public class KonSoftAuthServerModule : AbpModule | |||||||
|         var app = context.GetApplicationBuilder(); |         var app = context.GetApplicationBuilder(); | ||||||
|         var env = context.GetEnvironment(); |         var env = context.GetEnvironment(); | ||||||
|  |  | ||||||
|         if (env.IsDevelopment()) |         app.UseForwardedHeaders(); | ||||||
|  |         app.Use(async (ctx, next) => | ||||||
|         { |         { | ||||||
|             app.UseDeveloperExceptionPage(); |             ctx.Request.Scheme = "https"; | ||||||
|         } |             await next(); | ||||||
|  |         }); | ||||||
|  |  | ||||||
|  |         app.UseDeveloperExceptionPage(); | ||||||
|  |         app.UseAbpRequestLocalization(); | ||||||
|  |         app.UseErrorPage(); | ||||||
|  |  | ||||||
|         app.UseAbpRequestLocalization(); |         app.UseAbpRequestLocalization(); | ||||||
|  |  | ||||||
|         if (!env.IsDevelopment()) |  | ||||||
|         { |  | ||||||
|             app.UseErrorPage(); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|         app.UseCorrelationId(); |         app.UseCorrelationId(); | ||||||
|         app.UseStaticFiles(); |         app.UseStaticFiles(); | ||||||
|         app.UseRouting(); |         app.UseRouting(); | ||||||
|  | |||||||
| @ -1,10 +1,8 @@ | |||||||
| using System; | using KonSoft.Shared.Hosting.AspNetCore; | ||||||
| using System.Threading.Tasks; |  | ||||||
| using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||||
| using Microsoft.Extensions.DependencyInjection; |  | ||||||
| using Microsoft.Extensions.Hosting; |  | ||||||
| using Serilog; | using Serilog; | ||||||
| using Serilog.Events; | using System; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  |  | ||||||
| namespace KonSoft; | namespace KonSoft; | ||||||
|  |  | ||||||
| @ -12,45 +10,28 @@ public class Program | |||||||
| { | { | ||||||
|     public static async Task<int> Main(string[] args) |     public static async Task<int> Main(string[] args) | ||||||
|     { |     { | ||||||
|         Log.Logger = new LoggerConfiguration() |         var assemblyName = typeof(Program).Assembly.GetName().Name!; | ||||||
| #if DEBUG |  | ||||||
|             .MinimumLevel.Debug() |  | ||||||
| #else |  | ||||||
|             .MinimumLevel.Information() |  | ||||||
| #endif |  | ||||||
|             .MinimumLevel.Override("Microsoft", LogEventLevel.Information) |  | ||||||
|             .MinimumLevel.Override("Microsoft.EntityFrameworkCore", LogEventLevel.Warning) |  | ||||||
|             .Enrich.FromLogContext() |  | ||||||
|             .WriteTo.Async(c => c.File("Logs/logs.txt")) |  | ||||||
|             .WriteTo.Async(c => c.Console()) |  | ||||||
|             .CreateLogger(); |  | ||||||
|  |  | ||||||
|  |         SerilogConfigurationHelper.Configure(assemblyName); | ||||||
|         try |         try | ||||||
|         { |         { | ||||||
|             Log.Information("Starting KonSoft.AuthServer."); |             Log.Information($"Starting {assemblyName}."); | ||||||
|             var builder = WebApplication.CreateBuilder(args); |             var app = await ApplicationBuilderHelper | ||||||
|             builder.Host.AddAppSettingsSecretsJson() |                 .BuildApplicationAsync<KonSoftAuthServerModule>(args); | ||||||
|                 .UseAutofac() |  | ||||||
|                 .UseSerilog(); |  | ||||||
|             await builder.AddApplicationAsync<KonSoftAuthServerModule>(); |  | ||||||
|             var app = builder.Build(); |  | ||||||
|             await app.InitializeApplicationAsync(); |             await app.InitializeApplicationAsync(); | ||||||
|  |             app.MapGet("/heath", () => "Online"); | ||||||
|             await app.RunAsync(); |             await app.RunAsync(); | ||||||
|  |  | ||||||
|             return 0; |             return 0; | ||||||
|         } |         } | ||||||
|         catch (Exception ex) |         catch (Exception ex) | ||||||
|         { |         { | ||||||
|             if (ex is HostAbortedException) |             Log.Fatal(ex, $"{assemblyName} terminated unexpectedly!"); | ||||||
|             { |  | ||||||
|                 throw; |  | ||||||
|             } |  | ||||||
|  |  | ||||||
|             Log.Fatal(ex, "KonSoft.AuthServer terminated unexpectedly!"); |  | ||||||
|             return 1; |             return 1; | ||||||
|         } |         } | ||||||
|         finally |         finally | ||||||
|         { |         { | ||||||
|             Log.CloseAndFlush(); |             await Log.CloseAndFlushAsync(); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -1,5 +1,4 @@ | |||||||
| { | { | ||||||
|   "$schema": "http://json.schemastore.org/launchsettings.json", |  | ||||||
|   "profiles": { |   "profiles": { | ||||||
|     "http": { |     "http": { | ||||||
|       "commandName": "Project", |       "commandName": "Project", | ||||||
| @ -8,6 +7,18 @@ | |||||||
|         "ASPNETCORE_ENVIRONMENT": "Development" |         "ASPNETCORE_ENVIRONMENT": "Development" | ||||||
|       }, |       }, | ||||||
|       "applicationUrl": "https://localhost:44322" |       "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 | ||||||
|     } |     } | ||||||
|   } |   }, | ||||||
|  |   "$schema": "http://json.schemastore.org/launchsettings.json" | ||||||
| } | } | ||||||
| @ -1,17 +1,8 @@ | |||||||
| { | { | ||||||
|   "App": { |   "AgileConfig": { | ||||||
|     "SelfUrl": "https://localhost:44322", |     "appId": "KonSoft.Admin.HttpApi.Host", | ||||||
|     "ClientUrl": "http://localhost:4200", |     "name": "KonSoft.Admin.HttpApi.Host", | ||||||
|     "CorsOrigins": "https://*.KonSoft.com,http://localhost:4200,https://localhost:44316,https://localhost:44370", |     "nodes": "https://config.konsoft.top/", | ||||||
|     "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44319,https://localhost:44316,https://localhost:44347" |     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" | ||||||
|   }, |  | ||||||
|   "ConnectionStrings": { |  | ||||||
|     "Default": "Host=localhost;Port=5432;Database=KonSoft;User ID=root;Password=myPassword;" |  | ||||||
|   }, |  | ||||||
|   "Redis": { |  | ||||||
|     "Configuration": "127.0.0.1" |  | ||||||
|   }, |  | ||||||
|   "StringEncryption": { |  | ||||||
|     "DefaultPassPhrase": "kxtywyrXW4i7vijT" |  | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,322 +0,0 @@ | |||||||
| # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |  | ||||||
| # yarn lockfile v1 |  | ||||||
|  |  | ||||||
|  |  | ||||||
| "@abp/aspnetcore.mvc.ui.theme.basic@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.basic/-/aspnetcore.mvc.ui.theme.basic-8.3.4.tgz#75708276b2d9162d4f208ebf566fb0a7343636a7" |  | ||||||
|   integrity sha512-m5NBySj8tPbXwMKI1hUfYDzGVxvcU4JGJsSDegetuiulZYm59tPnfdwBeM0zSqx72UPowu/2oDwJsgjODVrDlg== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/aspnetcore.mvc.ui.theme.shared" "~8.3.4" |  | ||||||
|  |  | ||||||
| "@abp/aspnetcore.mvc.ui.theme.shared@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui.theme.shared/-/aspnetcore.mvc.ui.theme.shared-8.3.4.tgz#169ae0893302ced9256f94174d9bb870e49f446c" |  | ||||||
|   integrity sha512-bZy8iAIN0QfNJXCRg+RR1NxqTzNDSXRPBx+ksFtDxY6FzMJvwwSOmHF0wqsMLj1xpwXjijWaVWQ2RM/7scDWmw== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/aspnetcore.mvc.ui" "~8.3.4" |  | ||||||
|     "@abp/bootstrap" "~8.3.4" |  | ||||||
|     "@abp/bootstrap-datepicker" "~8.3.4" |  | ||||||
|     "@abp/bootstrap-daterangepicker" "~8.3.4" |  | ||||||
|     "@abp/datatables.net-bs5" "~8.3.4" |  | ||||||
|     "@abp/font-awesome" "~8.3.4" |  | ||||||
|     "@abp/jquery-form" "~8.3.4" |  | ||||||
|     "@abp/jquery-validation-unobtrusive" "~8.3.4" |  | ||||||
|     "@abp/lodash" "~8.3.4" |  | ||||||
|     "@abp/luxon" "~8.3.4" |  | ||||||
|     "@abp/malihu-custom-scrollbar-plugin" "~8.3.4" |  | ||||||
|     "@abp/moment" "~8.3.4" |  | ||||||
|     "@abp/select2" "~8.3.4" |  | ||||||
|     "@abp/sweetalert2" "~8.3.4" |  | ||||||
|     "@abp/timeago" "~8.3.4" |  | ||||||
|     "@abp/toastr" "~8.3.4" |  | ||||||
|  |  | ||||||
| "@abp/aspnetcore.mvc.ui@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/aspnetcore.mvc.ui/-/aspnetcore.mvc.ui-8.3.4.tgz#041d83f34541081d9e0f37c36c302cbe871a4897" |  | ||||||
|   integrity sha512-sjGE/EoNM98mXNYPze2C7GPP+TNpv4TLIt416ojaqtxru60oddr4VWrOGuhaqUCO2jJes3OwFZi5PY3hVOBbYw== |  | ||||||
|   dependencies: |  | ||||||
|     ansi-colors "^4.1.3" |  | ||||||
|  |  | ||||||
| "@abp/bootstrap-datepicker@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/bootstrap-datepicker/-/bootstrap-datepicker-8.3.4.tgz#072f4a3cea93e3a1bb1de13b355201648929f84c" |  | ||||||
|   integrity sha512-txilFovf9zT1w+fTkyI3eZdiISjaxc/+wRRFKwrkVH+0xEgaiR41svKm6sjWBORxgTddlGas87SZJvYY3IKBjA== |  | ||||||
|   dependencies: |  | ||||||
|     bootstrap-datepicker "^1.10.0" |  | ||||||
|  |  | ||||||
| "@abp/bootstrap-daterangepicker@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/bootstrap-daterangepicker/-/bootstrap-daterangepicker-8.3.4.tgz#b0f65611ca4fafdf2b551f9f139868eae6e22e9a" |  | ||||||
|   integrity sha512-bYkYjk1zTdWcM4DGwnDoU+4pDvs1S8hkNWhrnpP0o8oRoJiesO8Aeda+82rtydtWnxHg+HkDC0iYFFqaNuHvbg== |  | ||||||
|   dependencies: |  | ||||||
|     bootstrap-daterangepicker "^3.1.0" |  | ||||||
|  |  | ||||||
| "@abp/bootstrap@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/bootstrap/-/bootstrap-8.3.4.tgz#744bb4d30d4c269ce8e6a7d16c6777dd3cd9fe1e" |  | ||||||
|   integrity sha512-GXCLFFmPNaR3DjQYSaqACL5sH/M9FPia2OKAAMOd796+NmcoFpT+S7l4C6ihqeQc4bjFm0voB8QklueGWx6r8A== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     bootstrap "^5.3.3" |  | ||||||
|  |  | ||||||
| "@abp/core@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/core/-/core-8.3.4.tgz#12635bc2ac325a426334150502a32fefa4ec3767" |  | ||||||
|   integrity sha512-wImAdZABahaQe6mmZAZlPfYZ3PEhL7eEq+18c1WFO0xeD98oxqi8H1X7+3ABjyFscIh9LIxJVaD3RJ9OHCc5bw== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/utils" "~8.3.4" |  | ||||||
|  |  | ||||||
| "@abp/datatables.net-bs5@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/datatables.net-bs5/-/datatables.net-bs5-8.3.4.tgz#efc28fa57144c7b495a4aeea38df962807ca20df" |  | ||||||
|   integrity sha512-u85aXjqYIJJfOsMq6oNqfxNgxQqV6vOEnJ32vrH294ceW8RzUxHA+G/ZkGRLLRGWVuxuARD/UXzEotH5sd1Ssw== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/datatables.net" "~8.3.4" |  | ||||||
|     datatables.net-bs5 "^2.0.8" |  | ||||||
|  |  | ||||||
| "@abp/datatables.net@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/datatables.net/-/datatables.net-8.3.4.tgz#23a3155a2d84247a29a6b80ff98d1d5f6422a245" |  | ||||||
|   integrity sha512-cwE9TFoRoszmI3zNVaYJtqjSPtwkL9dhCfE02zsmJo8GBdFAlbzAmQenfQiWb3BZhvUvKKN20e+og9S8qoCbXA== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery" "~8.3.4" |  | ||||||
|     datatables.net "^2.0.8" |  | ||||||
|  |  | ||||||
| "@abp/font-awesome@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/font-awesome/-/font-awesome-8.3.4.tgz#f79f7b439f9ffadfc03be3a415a977eab21fa5a1" |  | ||||||
|   integrity sha512-5+D5XKnrZROtg9PJ2zex52gbphXGK/7ZIUsszEg8rOIc/niXggaZLmuDcYJwOEzIkwpGO9OvYy7lc0tHv/Pr4g== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     "@fortawesome/fontawesome-free" "^6.5.2" |  | ||||||
|  |  | ||||||
| "@abp/jquery-form@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/jquery-form/-/jquery-form-8.3.4.tgz#c1705bd5213ab5c2b895dd5bd9f3e54f3d94cf54" |  | ||||||
|   integrity sha512-vFjWbTbHQyIsk5SS7Cc+5YrJ15ORjJU+YWVPchI0qoug26for06a7lDGpazWMadxx3iPL7cKLqneOqaVtHkgJA== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery" "~8.3.4" |  | ||||||
|     jquery-form "^4.3.0" |  | ||||||
|  |  | ||||||
| "@abp/jquery-validation-unobtrusive@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-8.3.4.tgz#e89eafed89787bcb5221c0ba89832b79a7396d19" |  | ||||||
|   integrity sha512-+kJA5vfvxkrj/iW4Q84BrMTrAGOhC2Hb5czAKr6c60Prmayk5hcakZdXc3wDBHREBLVAq1Muk4AtEJZmaKIeaA== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery-validation" "~8.3.4" |  | ||||||
|     jquery-validation-unobtrusive "^4.0.0" |  | ||||||
|  |  | ||||||
| "@abp/jquery-validation@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/jquery-validation/-/jquery-validation-8.3.4.tgz#a445592d80edc6b6b1334ece2007b3084c329cc6" |  | ||||||
|   integrity sha512-XvL0H3IRuSHwpPKUyJmW6PH8KwPDt9NllMqPGreRANF8l5IU10hOLEeP2BnGFfGMqFwqUMh+eJRar5yZcegkmg== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery" "~8.3.4" |  | ||||||
|     jquery-validation "^1.20.1" |  | ||||||
|  |  | ||||||
| "@abp/jquery@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/jquery/-/jquery-8.3.4.tgz#2dc3f5f124ac65b5f45d29749ebb5d6cf17db23b" |  | ||||||
|   integrity sha512-Zx2rErtgc0gxjX5PURjp6sjDQfzxBChUE9YWN37Xh+Ysm3tTGcXlF0Emwl94MZ640NfmYRpG4AWdik6kbaU5Wg== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     jquery "~3.7.1" |  | ||||||
|  |  | ||||||
| "@abp/lodash@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/lodash/-/lodash-8.3.4.tgz#b0ef4e82a788ae7389a31793c3bad6702efdbe33" |  | ||||||
|   integrity sha512-yGd/oLds0jpTgTpmkFYOEomS4K15DGcffMP3N1t0qKLgTaBYTQzeugHVgQ0baufC+OvLjumDNuu3eHjBJewwKg== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     lodash "^4.17.21" |  | ||||||
|  |  | ||||||
| "@abp/luxon@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/luxon/-/luxon-8.3.4.tgz#f152b2d7b62bd27f3d27aa3a1794b868bf06a1a4" |  | ||||||
|   integrity sha512-l1nvfqdhHBgHBPK+bLClAEprRK3K5zx5Jar93o5++6r3zXUhYi5OUHUxl+LuGn8MXLvHJVGL41irHl6sYjFSww== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     luxon "^3.4.4" |  | ||||||
|  |  | ||||||
| "@abp/malihu-custom-scrollbar-plugin@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-8.3.4.tgz#0868214884e3e0b94dade0e8e78c01741d71106a" |  | ||||||
|   integrity sha512-uKRk8+HCvXtpmvof5W09908AkivlweErTE62b0JhkrJVIlYt/0LC1MmB/qHHBfPj6OK05HYGBi3inr7fNAPXEQ== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     malihu-custom-scrollbar-plugin "^3.1.5" |  | ||||||
|  |  | ||||||
| "@abp/moment@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/moment/-/moment-8.3.4.tgz#a5809520dc50b50402ade4ac630c6ec985fd4518" |  | ||||||
|   integrity sha512-61J8drO3OqkaaAn66xBg6jCws1iV6zutjYQvpEXLdGBA9Kvw2J87GSomxJ4mcIo/5+jzrVro6JYaCfKWY8b1dw== |  | ||||||
|   dependencies: |  | ||||||
|     moment "^2.30.1" |  | ||||||
|  |  | ||||||
| "@abp/select2@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/select2/-/select2-8.3.4.tgz#1731b465760e0515d0d4280f38189c9366fecda5" |  | ||||||
|   integrity sha512-sPtYstFVvMTT8fdXRIfHeODIgSN2ufWm6zCMGH7C0cST3FF59M4m/MtdKGBlA/itzHPxeDv7A6dy4Aw4l7Gk4Q== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     select2 "^4.0.13" |  | ||||||
|  |  | ||||||
| "@abp/sweetalert2@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/sweetalert2/-/sweetalert2-8.3.4.tgz#c0768ca4fe0a9926b8f33d8bf5251d3e4202cd2f" |  | ||||||
|   integrity sha512-6HqxISh+FodwUsCrR3nX49RQDhzHtDlz8ul42TecUMsGa96qX2lvwnoWkXAHLG3mdLRy62Z0dhJ1JKMfrPeJeg== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/core" "~8.3.4" |  | ||||||
|     sweetalert2 "^11.3.6" |  | ||||||
|  |  | ||||||
| "@abp/timeago@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/timeago/-/timeago-8.3.4.tgz#26ca0bec90d861f9f4af714061b370950551c839" |  | ||||||
|   integrity sha512-cDARYysPn5Rr/9rqVn7S4sBWbeEpaIXr8NKwGZqNOzMF2g283SkLKrkQJBWIC6Pn2lVeIB7AV1+GtVn81V/nnw== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery" "~8.3.4" |  | ||||||
|     timeago "^1.6.7" |  | ||||||
|  |  | ||||||
| "@abp/toastr@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/toastr/-/toastr-8.3.4.tgz#cb433bc4ed2e302f2704ad0456c99d6f12fd0529" |  | ||||||
|   integrity sha512-29C9GgwlumrHgt1iZ4lArDnlXfSvmCHDehxkbDutrkC1m257UxQaOID11us2UeCs3JobueQcLlQKD/LqnDB4xA== |  | ||||||
|   dependencies: |  | ||||||
|     "@abp/jquery" "~8.3.4" |  | ||||||
|     toastr "^2.1.4" |  | ||||||
|  |  | ||||||
| "@abp/utils@~8.3.4": |  | ||||||
|   version "8.3.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@abp/utils/-/utils-8.3.4.tgz#4b06575a110e85e2a360294f678b782818e1ab10" |  | ||||||
|   integrity sha512-7Lq3wdk/07vKgQnR56DTmdSuYRABMe0XTGPJRS5F91DVbggeJyDUaqifVvOeurF/3CZJOS7fJpoIHQXeUveFtQ== |  | ||||||
|   dependencies: |  | ||||||
|     just-compare "^2.3.0" |  | ||||||
|  |  | ||||||
| "@fortawesome/fontawesome-free@^6.5.2": |  | ||||||
|   version "6.7.2" |  | ||||||
|   resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.2.tgz#8249de9b7e22fcb3ceb5e66090c30a1d5492b81a" |  | ||||||
|   integrity sha512-JUOtgFW6k9u4Y+xeIaEiLr3+cjoUPiAuLXoyKOJSia6Duzb7pq+A76P9ZdPDoAoxHdHzq6gE9/jKBGXlZT8FbA== |  | ||||||
|  |  | ||||||
| ansi-colors@^4.1.3: |  | ||||||
|   version "4.1.3" |  | ||||||
|   resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.3.tgz#37611340eb2243e70cc604cad35d63270d48781b" |  | ||||||
|   integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== |  | ||||||
|  |  | ||||||
| bootstrap-datepicker@^1.10.0: |  | ||||||
|   version "1.10.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/bootstrap-datepicker/-/bootstrap-datepicker-1.10.0.tgz#61612bbe8bf0a69a5bce32bbcdda93ebb6ccf24a" |  | ||||||
|   integrity sha512-lWxtSYddAQOpbAO8UhYhHLcK6425eWoSjb5JDvZU3ePHEPF6A3eUr51WKaFy4PccU19JRxUG6wEU3KdhtKfvpg== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=3.4.0 <4.0.0" |  | ||||||
|  |  | ||||||
| bootstrap-daterangepicker@^3.1.0: |  | ||||||
|   version "3.1.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/bootstrap-daterangepicker/-/bootstrap-daterangepicker-3.1.0.tgz#632e6fb2de4b6360c5c0a9d5f6adb9aace051fe8" |  | ||||||
|   integrity sha512-oaQZx6ZBDo/dZNyXGVi2rx5GmFXThyQLAxdtIqjtLlYVaQUfQALl5JZMJJZzyDIX7blfy4ppZPAJ10g8Ma4d/g== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.10" |  | ||||||
|     moment "^2.9.0" |  | ||||||
|  |  | ||||||
| bootstrap@^5.3.3: |  | ||||||
|   version "5.3.8" |  | ||||||
|   resolved "https://registry.yarnpkg.com/bootstrap/-/bootstrap-5.3.8.tgz#6401a10057a22752d21f4e19055508980656aeed" |  | ||||||
|   integrity sha512-HP1SZDqaLDPwsNiqRqi5NcP0SSXciX2s9E+RyqJIIqGo+vJeN5AJVM98CXmW/Wux0nQ5L7jeWUdplCEf0Ee+tg== |  | ||||||
|  |  | ||||||
| datatables.net-bs5@^2.0.8: |  | ||||||
|   version "2.3.3" |  | ||||||
|   resolved "https://registry.yarnpkg.com/datatables.net-bs5/-/datatables.net-bs5-2.3.3.tgz#8bf3aec484a69e373f6007038eaac0cc0ef4ee15" |  | ||||||
|   integrity sha512-IPtC57k3KyZaLzIYTHies23Cm2zqaKfD6lkxy/aOAUUAtsg35l53VqNY9y84AEySYG3YLghMHVBvl2ckUhvm0A== |  | ||||||
|   dependencies: |  | ||||||
|     datatables.net "2.3.3" |  | ||||||
|     jquery ">=1.7" |  | ||||||
|  |  | ||||||
| datatables.net@2.3.3, datatables.net@^2.0.8: |  | ||||||
|   version "2.3.3" |  | ||||||
|   resolved "https://registry.yarnpkg.com/datatables.net/-/datatables.net-2.3.3.tgz#fe4f96bdbc4cf47c8d11162a7af525ca6a3683d2" |  | ||||||
|   integrity sha512-SWL3za6nheY6gdoiLgCc++tYmxbwrmv2bjrEiII9rXBWXXSbOZct6pjR3FueMVRM5jmt7pQcXiGovfuFDnutQg== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.7" |  | ||||||
|  |  | ||||||
| jquery-form@^4.3.0: |  | ||||||
|   version "4.3.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/jquery-form/-/jquery-form-4.3.0.tgz#7d3961c314a1f2d15298f4af1d3943f54f4149c6" |  | ||||||
|   integrity sha512-q3uaVCEWdLOYUCI6dpNdwf/7cJFOsUgdpq6r0taxtGQ5NJSkOzofyWm4jpOuJ5YxdmL1FI5QR+q+HB63HHLGnQ== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.7.2" |  | ||||||
|  |  | ||||||
| jquery-mousewheel@>=3.0.6: |  | ||||||
|   version "3.2.2" |  | ||||||
|   resolved "https://registry.yarnpkg.com/jquery-mousewheel/-/jquery-mousewheel-3.2.2.tgz#48c833f6260ee0c46d438a999e7d0060ec9eed0b" |  | ||||||
|   integrity sha512-JP71xTAg08ZY3hcs9ZbYUZ5i+dkSsz4yRl/zpWkAmtzc+kMs5EfPkpkINSidiLYMaR0MTo3DfFGF9WIezMsFQQ== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.2.6" |  | ||||||
|  |  | ||||||
| jquery-validation-unobtrusive@^4.0.0: |  | ||||||
|   version "4.0.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/jquery-validation-unobtrusive/-/jquery-validation-unobtrusive-4.0.0.tgz#dfcf25a558496a2c883db6021d10f5398d15f99d" |  | ||||||
|   integrity sha512-1ervYFFv6LX/rp7ktuLnMakHNG0piNRDyROI8Ir3hL1vPIwylAehB1AY3BPrYJnzW3WmwWryZq+Bz4sazZK9iQ== |  | ||||||
|   dependencies: |  | ||||||
|     jquery "^3.6.0" |  | ||||||
|     jquery-validation ">=1.19" |  | ||||||
|  |  | ||||||
| jquery-validation@>=1.19, jquery-validation@^1.20.1: |  | ||||||
|   version "1.21.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/jquery-validation/-/jquery-validation-1.21.0.tgz#78fc05ab76020912a246af3661b3f54a438bca93" |  | ||||||
|   integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w== |  | ||||||
|  |  | ||||||
| jquery@>=1.10, jquery@>=1.12.0, jquery@>=1.2.6, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.0, jquery@~3.7.1: |  | ||||||
|   version "3.7.1" |  | ||||||
|   resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" |  | ||||||
|   integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== |  | ||||||
|  |  | ||||||
| just-compare@^2.3.0: |  | ||||||
|   version "2.3.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/just-compare/-/just-compare-2.3.0.tgz#a2adcc1d1940536263275f5a1ef1298bcacfeda7" |  | ||||||
|   integrity sha512-6shoR7HDT+fzfL3gBahx1jZG3hWLrhPAf+l7nCwahDdT9XDtosB9kIF0ZrzUp5QY8dJWfQVr5rnsPqsbvflDzg== |  | ||||||
|  |  | ||||||
| lodash@^4.17.21: |  | ||||||
|   version "4.17.21" |  | ||||||
|   resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" |  | ||||||
|   integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== |  | ||||||
|  |  | ||||||
| luxon@^3.4.4: |  | ||||||
|   version "3.7.2" |  | ||||||
|   resolved "https://registry.yarnpkg.com/luxon/-/luxon-3.7.2.tgz#d697e48f478553cca187a0f8436aff468e3ba0ba" |  | ||||||
|   integrity sha512-vtEhXh/gNjI9Yg1u4jX/0YVPMvxzHuGgCm6tC5kZyb08yjGWGnqAjGJvcXbqQR2P3MyMEFnRbpcdFS6PBcLqew== |  | ||||||
|  |  | ||||||
| malihu-custom-scrollbar-plugin@^3.1.5: |  | ||||||
|   version "3.1.5" |  | ||||||
|   resolved "https://registry.yarnpkg.com/malihu-custom-scrollbar-plugin/-/malihu-custom-scrollbar-plugin-3.1.5.tgz#310cecc5e59415a1c29e9dfb5d2b6e01d66a29ef" |  | ||||||
|   integrity sha512-lwW3LgI+CNDMPnP4ED2la6oYxWMkCXlnhex+s2wuOLhFDFGnGmQuTQVdRK9bvDLpxs10sGlfErVufJy9ztfgJQ== |  | ||||||
|   dependencies: |  | ||||||
|     jquery-mousewheel ">=3.0.6" |  | ||||||
|  |  | ||||||
| moment@^2.30.1, moment@^2.9.0: |  | ||||||
|   version "2.30.1" |  | ||||||
|   resolved "https://registry.yarnpkg.com/moment/-/moment-2.30.1.tgz#f8c91c07b7a786e30c59926df530b4eac96974ae" |  | ||||||
|   integrity sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how== |  | ||||||
|  |  | ||||||
| select2@^4.0.13: |  | ||||||
|   version "4.0.13" |  | ||||||
|   resolved "https://registry.yarnpkg.com/select2/-/select2-4.0.13.tgz#0dbe377df3f96167c4c1626033e924372d8ef44d" |  | ||||||
|   integrity sha512-1JeB87s6oN/TDxQQYCvS5EFoQyvV6eYMZZ0AeA4tdFDYWN3BAGZ8npr17UBFddU0lgAt3H0yjX3X6/ekOj1yjw== |  | ||||||
|  |  | ||||||
| sweetalert2@^11.3.6: |  | ||||||
|   version "11.23.0" |  | ||||||
|   resolved "https://registry.yarnpkg.com/sweetalert2/-/sweetalert2-11.23.0.tgz#ba8a051b1e94215c762af08692171b7b4611c4c1" |  | ||||||
|   integrity sha512-cKzzbC3C1sIs7o9XAMw4E8F9kBtGXsBDUsd2JZ8JM/dqa+nzWwSGM+9LLYILZWzWHzX9W+HJNHyBlbHPVS/krw== |  | ||||||
|  |  | ||||||
| timeago@^1.6.7: |  | ||||||
|   version "1.6.7" |  | ||||||
|   resolved "https://registry.yarnpkg.com/timeago/-/timeago-1.6.7.tgz#afd467c29a911e697fc22a81888c7c3022783cb5" |  | ||||||
|   integrity sha512-FikcjN98+ij0siKH4VO4dZ358PR3oDDq4Vdl1+sN9gWz1/+JXGr3uZbUShYH/hL7bMhcTpPbplJU5Tej4b4jbQ== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.5.0 <4.0" |  | ||||||
|  |  | ||||||
| toastr@^2.1.4: |  | ||||||
|   version "2.1.4" |  | ||||||
|   resolved "https://registry.yarnpkg.com/toastr/-/toastr-2.1.4.tgz#8b43be64fb9d0c414871446f2db8e8ca4e95f181" |  | ||||||
|   integrity sha512-LIy77F5n+sz4tefMmFOntcJ6HL0Fv3k1TDnNmFZ0bU/GcvIIfy6eG2v7zQmMiYgaalAiUv75ttFrPn5s0gyqlA== |  | ||||||
|   dependencies: |  | ||||||
|     jquery ">=1.12.0" |  | ||||||
							
								
								
									
										27
									
								
								authserver.Jenkinsfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								authserver.Jenkinsfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | |||||||
|  | pipeline { | ||||||
|  |     agent any | ||||||
|  |      | ||||||
|  |     stages { | ||||||
|  |  | ||||||
|  |         stage('Deploy') { | ||||||
|  |             steps { | ||||||
|  |                 script { | ||||||
|  |                     try { | ||||||
|  |                         sh '/usr/libexec/docker/cli-plugins/docker-compose -f ./docker-compose.yml up --build -d authserver' | ||||||
|  |                     } catch (Exception e) { | ||||||
|  |                         error "部署失败: ${e.message}" | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         stage('Health Check') { | ||||||
|  |             steps { | ||||||
|  |                 script { | ||||||
|  |                     sleep time: 30, unit: 'SECONDS' | ||||||
|  |                     sh 'docker ps | grep authserver' | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -1,7 +1,7 @@ | |||||||
| services: | services: | ||||||
|   internalgateways: |   internalgateways: | ||||||
|     container_name: clean-internalgateways |     container_name: clean-internalgateways | ||||||
|     restart: always |     restart: unless-stopped | ||||||
|     build:  |     build:  | ||||||
|       context: . |       context: . | ||||||
|       dockerfile: ./gateways/KonSoft.InternalGateway/Dockerfile |       dockerfile: ./gateways/KonSoft.InternalGateway/Dockerfile | ||||||
| @ -11,10 +11,25 @@ services: | |||||||
|       - AgileConfig__Name=KonSoft.InternalGateway |       - AgileConfig__Name=KonSoft.InternalGateway | ||||||
|       - AgileConfig__Nodes=https://config.konsoft.top/ |       - AgileConfig__Nodes=https://config.konsoft.top/ | ||||||
|       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 |       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 | ||||||
|  |     ports: | ||||||
|  |       - 8080:8080 | ||||||
|  |     networks: | ||||||
|  |       - konsoft-shared-network | ||||||
|  |     healthcheck: | ||||||
|  |       test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||||||
|  |       interval: 30s | ||||||
|  |       timeout: 10s | ||||||
|  |       retries: 3 | ||||||
|  |       start_period: 40s | ||||||
|  |     logging: | ||||||
|  |       driver: "json-file" | ||||||
|  |       options: | ||||||
|  |         max-size: "10m" | ||||||
|  |         max-file: "3" | ||||||
|        |        | ||||||
|   authserver: |   authserver: | ||||||
|     container_name: clean-authserver |     container_name: clean-authserver | ||||||
|     restart: always |     restart: unless-stopped | ||||||
|     build:  |     build:  | ||||||
|       context: . |       context: . | ||||||
|       dockerfile: ./applications/KonSoft.AuthServer/Dockerfile |       dockerfile: ./applications/KonSoft.AuthServer/Dockerfile | ||||||
| @ -24,10 +39,27 @@ services: | |||||||
|       - AgileConfig__Name=KonSoft.AuthServer |       - AgileConfig__Name=KonSoft.AuthServer | ||||||
|       - AgileConfig__Nodes=https://config.konsoft.top/ |       - AgileConfig__Nodes=https://config.konsoft.top/ | ||||||
|       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 |       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 | ||||||
|  |     ports: | ||||||
|  |       - 8081:8080 | ||||||
|  |     volumes: | ||||||
|  |       - /etc/letsencrypt/archive/code.konsoft.top/openiddict.pfx:/app/openiddict.pfx | ||||||
|  |     networks: | ||||||
|  |       - konsoft-shared-network | ||||||
|  |     healthcheck: | ||||||
|  |       test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||||||
|  |       interval: 30s | ||||||
|  |       timeout: 10s | ||||||
|  |       retries: 3 | ||||||
|  |       start_period: 40s | ||||||
|  |     logging: | ||||||
|  |       driver: "json-file" | ||||||
|  |       options: | ||||||
|  |         max-size: "10m" | ||||||
|  |         max-file: "3" | ||||||
|  |  | ||||||
|   adminservice: |   adminservice: | ||||||
|     container_name: clean-adminservice |     container_name: clean-adminservice | ||||||
|     restart: always |     restart: unless-stopped | ||||||
|     build:  |     build:  | ||||||
|       context: . |       context: . | ||||||
|       dockerfile: ./microservices/KonSoft.Admin.HttpApi.Host/Dockerfile |       dockerfile: ./microservices/KonSoft.Admin.HttpApi.Host/Dockerfile | ||||||
| @ -36,4 +68,23 @@ services: | |||||||
|       - AgileConfig__AppId=KonSoft.Admin.HttpApi.Host |       - AgileConfig__AppId=KonSoft.Admin.HttpApi.Host | ||||||
|       - AgileConfig__Name=KonSoft.Admin.HttpApi.Host |       - AgileConfig__Name=KonSoft.Admin.HttpApi.Host | ||||||
|       - AgileConfig__Nodes=https://config.konsoft.top/ |       - AgileConfig__Nodes=https://config.konsoft.top/ | ||||||
|       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 |       - AgileConfig__Secret=DBE31703-14F9-4B01-893D-900B8380CE04 | ||||||
|  |     networks: | ||||||
|  |       - konsoft-shared-network | ||||||
|  |     healthcheck: | ||||||
|  |       test: ["CMD", "curl", "-f", "http://localhost:8080/health"] | ||||||
|  |       interval: 30s | ||||||
|  |       timeout: 10s | ||||||
|  |       retries: 3 | ||||||
|  |       start_period: 40s | ||||||
|  |     logging: | ||||||
|  |       driver: "json-file" | ||||||
|  |       options: | ||||||
|  |         max-size: "10m" | ||||||
|  |         max-file: "3" | ||||||
|  |  | ||||||
|  | networks: | ||||||
|  |   konsoft-shared-network: | ||||||
|  |     name: konsoft-shared-network | ||||||
|  |     driver: bridge | ||||||
|  |     external: true | ||||||
| @ -2,7 +2,6 @@ FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base | |||||||
| USER $APP_UID | USER $APP_UID | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 8080 | EXPOSE 8080 | ||||||
| EXPOSE 8081 |  | ||||||
|  |  | ||||||
|  |  | ||||||
| FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build | ||||||
|  | |||||||
| @ -0,0 +1,50 @@ | |||||||
|  | using Microsoft.AspNetCore.Builder; | ||||||
|  | using Yarp.ReverseProxy.Configuration; | ||||||
|  | namespace KonSoft.InternalGateway.Extensions | ||||||
|  | { | ||||||
|  |     public static class YarpSwaggerUIBuilderExtensions | ||||||
|  |     { | ||||||
|  |         public static IApplicationBuilder UseSwaggerUIWithYarp(this IApplicationBuilder app) | ||||||
|  |         { | ||||||
|  |             var serviceProvider = app.ApplicationServices; | ||||||
|  |  | ||||||
|  |             app.UseSwagger(); | ||||||
|  |             app.UseSwaggerUI(options => | ||||||
|  |             { | ||||||
|  |                 var configuration = serviceProvider.GetRequiredService<IConfiguration>(); | ||||||
|  |                 var logger = serviceProvider.GetRequiredService<ILogger<Program>>(); | ||||||
|  |                 var proxyConfigProvider = serviceProvider.GetRequiredService<IProxyConfigProvider>(); | ||||||
|  |                 var yarpConfig = proxyConfigProvider.GetConfig(); | ||||||
|  |  | ||||||
|  |                 var routedClusters = yarpConfig.Clusters | ||||||
|  |                     .SelectMany(t => t.Destinations, | ||||||
|  |                         (clusterId, destination) => new { clusterId.ClusterId, destination.Value }); | ||||||
|  |  | ||||||
|  |                 var groupedClusters = routedClusters | ||||||
|  |                     .GroupBy(q => q.Value.Address) | ||||||
|  |                     .Select(t => t.First()) | ||||||
|  |                     .Distinct() | ||||||
|  |                     .ToList(); | ||||||
|  |                 var gatewayUrl = configuration["GatewayUrl"]; | ||||||
|  |  | ||||||
|  |                 options.OAuthClientId(configuration["AuthServer:SwaggerClientId"]); | ||||||
|  |                 options.OAuthClientSecret(configuration["AuthServer:SwaggerClientSecret"]); | ||||||
|  |                 foreach (var clusterGroup in groupedClusters) | ||||||
|  |                 { | ||||||
|  |                     var routeConfig = yarpConfig.Routes.FirstOrDefault(q => | ||||||
|  |                         q.ClusterId == clusterGroup.ClusterId); | ||||||
|  |                     if (routeConfig == null) | ||||||
|  |                     { | ||||||
|  |                         logger.LogWarning($"Swagger UI: Couldn't find route configuration for {clusterGroup.ClusterId}..."); | ||||||
|  |                         continue; | ||||||
|  |                     } | ||||||
|  |                      | ||||||
|  |                    // options.SwaggerEndpoint($"{clusterGroup.Value.Address}/swagger/v1/swagger.json", $"{routeConfig.RouteId} API"); | ||||||
|  |                     options.SwaggerEndpoint(new Uri(new Uri(!string.IsNullOrWhiteSpace(gatewayUrl)? gatewayUrl: clusterGroup.Value.Address), $"{routeConfig.RouteId.Split("-")[0]}/swagger/v1/swagger.json").AbsoluteUri, $"{routeConfig.RouteId} API"); | ||||||
|  |                 } | ||||||
|  |             }); | ||||||
|  |  | ||||||
|  |             return app; | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -1,17 +1,14 @@ | |||||||
| using KonSoft.Shared.Hosting.Gateways; | using KonSoft.Admin; | ||||||
| using Volo.Abp; | using KonSoft.Shared.Hosting.Gateways; | ||||||
| using Volo.Abp.Modularity; | using Volo.Abp.Modularity; | ||||||
|  |  | ||||||
| namespace KonSoft.InternalGateway | namespace KonSoft.InternalGateway | ||||||
| { | { | ||||||
|     [DependsOn( |     [DependsOn( | ||||||
|         typeof(KonSoftSharedHostingGatewaysModule) |         typeof(KonSoftSharedHostingGatewaysModule), | ||||||
|  |         typeof(AdminHttpApiModule) | ||||||
|         )] |         )] | ||||||
|     public class InternalGatewayModule : AbpModule |     public class InternalGatewayModule : AbpModule | ||||||
|     { |     { | ||||||
|         public override void OnApplicationInitialization(ApplicationInitializationContext context) |  | ||||||
|         { |  | ||||||
|  |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -10,11 +10,7 @@ | |||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.22.1" /> |     <ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.HttpApi\KonSoft.Admin.HttpApi.csproj" /> | ||||||
|     <PackageReference Include="Yarp.ReverseProxy" Version="2.3.0" /> |  | ||||||
|   </ItemGroup> |  | ||||||
|  |  | ||||||
|   <ItemGroup> |  | ||||||
|     <ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Gateways\KonSoft.Shared.Hosting.Gateways.csproj" /> |     <ProjectReference Include="..\..\shared\KonSoft.Shared.Hosting.Gateways\KonSoft.Shared.Hosting.Gateways.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,5 +1,9 @@ | |||||||
| using KonSoft.InternalGateway; | using KonSoft.InternalGateway; | ||||||
|  | using KonSoft.InternalGateway.Extensions; | ||||||
| using KonSoft.Shared.Hosting.AspNetCore; | using KonSoft.Shared.Hosting.AspNetCore; | ||||||
|  | using Microsoft.AspNetCore.Rewrite; | ||||||
|  | using Microsoft.Extensions.DependencyInjection; | ||||||
|  | using Microsoft.OpenApi.Models; | ||||||
| using Serilog; | using Serilog; | ||||||
|  |  | ||||||
| var assemblyName = typeof(Program).Assembly.GetName().Name!; | var assemblyName = typeof(Program).Assembly.GetName().Name!; | ||||||
| @ -17,11 +21,28 @@ try | |||||||
|         .AddAppSettingsSecretsJson() |         .AddAppSettingsSecretsJson() | ||||||
|         .UseAutofac() |         .UseAutofac() | ||||||
|         .UseSerilog(); |         .UseSerilog(); | ||||||
|  |  | ||||||
|  |     builder.Services.AddAbpSwaggerGenWithOidc(builder.Configuration["AuthServer:Authority"]!, setupAction: options => | ||||||
|  |     { | ||||||
|  |         options.SwaggerDoc("v1", new OpenApiInfo | ||||||
|  |         { | ||||||
|  |             Title = "Gateway", | ||||||
|  |             Version = "v1" | ||||||
|  |         }); | ||||||
|  |         options.DocInclusionPredicate((docName, description) => true); | ||||||
|  |         options.CustomSchemaIds(type => type.FullName); | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |  | ||||||
|     builder.Services.AddReverseProxy() |     builder.Services.AddReverseProxy() | ||||||
|         .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); |         .LoadFromConfig(builder.Configuration.GetSection("ReverseProxy")); | ||||||
|  |     builder.Services.AddControllers(); | ||||||
|     await builder.AddApplicationAsync<InternalGatewayModule>(); |     await builder.AddApplicationAsync<InternalGatewayModule>(); | ||||||
|     var app = builder.Build(); |     var app = builder.Build(); | ||||||
|     await app.InitializeApplicationAsync(); |     await app.InitializeApplicationAsync(); | ||||||
|  |     app.UseSwaggerUIWithYarp(); | ||||||
|  |     app.MapReverseProxy(); | ||||||
|  |     app.MapGet("/heath", () => "Online"); | ||||||
|     await app.RunAsync(); |     await app.RunAsync(); | ||||||
|  |  | ||||||
|     return 0; |     return 0; | ||||||
|  | |||||||
| @ -4,5 +4,10 @@ | |||||||
|     "name": "KonSoft.InternalGateway", |     "name": "KonSoft.InternalGateway", | ||||||
|     "nodes": "https://config.konsoft.top/", |     "nodes": "https://config.konsoft.top/", | ||||||
|     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" |     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" | ||||||
|  |   }, | ||||||
|  |   "AuthServer": { | ||||||
|  |     "Authority": "https://devauth.konsoft.top", | ||||||
|  |     "RequireHttpsMetadata": true, | ||||||
|  |     "SwaggerClientId": "Gateway_Swagger" | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | |||||||
							
								
								
									
										27
									
								
								internalgateway.Jenkinsfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								internalgateway.Jenkinsfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | |||||||
|  | pipeline { | ||||||
|  |     agent any | ||||||
|  |      | ||||||
|  |     stages { | ||||||
|  |  | ||||||
|  |         stage('Deploy') { | ||||||
|  |             steps { | ||||||
|  |                 script { | ||||||
|  |                     try { | ||||||
|  |                         sh '/usr/libexec/docker/cli-plugins/docker-compose -f ./docker-compose.yml up --build -d internalgateways' | ||||||
|  |                     } catch (Exception e) { | ||||||
|  |                         error "部署失败: ${e.message}" | ||||||
|  |                     } | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         stage('Health Check') { | ||||||
|  |             steps { | ||||||
|  |                 script { | ||||||
|  |                     sleep time: 30, unit: 'SECONDS' | ||||||
|  |                     sh 'docker ps | grep internalgateways' | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -5,6 +5,7 @@ using Microsoft.AspNetCore.Builder; | |||||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Microsoft.Extensions.Hosting; | using Microsoft.Extensions.Hosting; | ||||||
| using Volo.Abp; | using Volo.Abp; | ||||||
|  | using Volo.Abp.AspNetCore.Mvc.Libs; | ||||||
| using Volo.Abp.BackgroundJobs; | using Volo.Abp.BackgroundJobs; | ||||||
| using Volo.Abp.Modularity; | using Volo.Abp.Modularity; | ||||||
|  |  | ||||||
| @ -25,13 +26,18 @@ public class AdminHttpApiHostModule : AbpModule | |||||||
|         SwaggerConfigurationHelper.ConfigureWithOidc( |         SwaggerConfigurationHelper.ConfigureWithOidc( | ||||||
|             context, |             context, | ||||||
|             configuration["AuthServer:Authority"]!, |             configuration["AuthServer:Authority"]!, | ||||||
|             ["AdministrationService"], |             ["Admin", "Dispatch", "Payment", "Report", "TenantManagement"], | ||||||
|             discoveryEndpoint: configuration["AuthServer:MetadataAddress"], |             discoveryEndpoint: configuration["AuthServer:MetadataAddress"], | ||||||
|             apiTitle: "Administration Service API" |             apiTitle: "Administration Service API" | ||||||
|         ); |         ); | ||||||
|  |  | ||||||
|         // ֻ<><D6BB><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> |         // ֻ<><D6BB><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼<EFBFBD> | ||||||
|         Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = false); |         Configure<AbpBackgroundJobOptions>(options => options.IsJobExecutionEnabled = false); | ||||||
|  |  | ||||||
|  |         Configure<AbpMvcLibsOptions>(options => | ||||||
|  |         { | ||||||
|  |             options.CheckLibs = false; | ||||||
|  |         }); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     public override void OnApplicationInitialization(ApplicationInitializationContext context) |     public override void OnApplicationInitialization(ApplicationInitializationContext context) | ||||||
|  | |||||||
| @ -1025,3 +1025,141 @@ System.InvalidOperationException: An exception has been raised that is likely du | |||||||
| --- End of stack trace from previous location --- | --- End of stack trace from previous location --- | ||||||
|    at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) |    at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context) | ||||||
| 2025-10-03 18:04:14.530 +08:00 [INF] Request finished HTTP/2 GET https://localhost:44354/favicon.ico - 500 null text/plain; charset=utf-8 2509.1194ms | 2025-10-03 18:04:14.530 +08:00 [INF] Request finished HTTP/2 GET https://localhost:44354/favicon.ico - 500 null text/plain; charset=utf-8 2509.1194ms | ||||||
|  | 2025-10-26 10:37:00.036 +08:00 [INF] Starting KonSoft.Admin.HttpApi.Host. | ||||||
|  | 2025-10-26 10:39:17.756 +08:00 [INF] Starting KonSoft.Admin.HttpApi.Host. | ||||||
|  | 2025-10-26 10:39:21.029 +08:00 [INF] Loaded ABP modules: | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF] - KonSoft.Admin.AdminHttpApiHostModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]   - KonSoft.Admin.AdminHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - KonSoft.Admin.AdminApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - KonSoft.Admin.AdminDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AuditLogging.AbpAuditLoggingDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Validation.AbpValidationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Validation.AbpValidationAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Localization.AbpLocalizationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.VirtualFileSystem.AbpVirtualFileSystemModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Settings.AbpSettingsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                 - Volo.Abp.Localization.AbpLocalizationAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                 - Volo.Abp.Security.AbpSecurityModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                 - Volo.Abp.Data.AbpDataModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                   - Volo.Abp.ObjectExtending.AbpObjectExtendingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                   - Volo.Abp.Uow.AbpUnitOfWorkModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                   - Volo.Abp.EventBus.Abstractions.AbpEventBusAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Threading.AbpThreadingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Json.SystemTextJson.AbpJsonSystemTextJsonModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Json.AbpJsonAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Timing.AbpTimingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.Identity.AbpIdentityDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Users.AbpUsersDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Features.AbpFeaturesModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.MultiTenancy.AbpMultiTenancyModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.MultiTenancy.AbpMultiTenancyAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Authorization.AbpAuthorizationAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.OpenIddict.AbpOpenIddictDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.SettingManagement.AbpSettingManagementDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.TenantManagement.AbpTenantManagementDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Account.AbpAccountApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.Identity.AbpIdentityApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Users.AbpUsersAbstractionModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.EventBus.AbpEventBusModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Json.AbpJsonModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Guids.AbpGuidsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.BackgroundWorkers.AbpBackgroundWorkersModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.DistributedLocking.AbpDistributedLockingAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Authorization.AbpAuthorizationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Application.AbpDddApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Auditing.AbpAuditingContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.SettingManagement.AbpSettingManagementApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.TenantManagement.AbpTenantManagementApplicationContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.Account.AbpAccountHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Identity.AbpIdentityHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.AspNetCore.AbpAspNetCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Auditing.AbpAuditingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Http.AbpHttpModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Http.AbpHttpAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Minify.AbpMinifyModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.ExceptionHandling.AbpExceptionHandlingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.AspNetCore.AbpAspNetCoreAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.ApiVersioning.AbpApiVersioningAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.AspNetCore.Mvc.AbpAspNetCoreMvcContractsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.UI.Navigation.AbpUiNavigationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.UI.AbpUiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.GlobalFeatures.AbpGlobalFeaturesModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Application.AbpDddApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.Domain.AbpDddDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.ObjectMapping.AbpObjectMappingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Specifications.AbpSpecificationsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Caching.AbpCachingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]                 - Volo.Abp.Serialization.AbpSerializationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]               - Volo.Abp.Domain.AbpDddDomainSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.PermissionManagement.HttpApi.AbpPermissionManagementHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.TenantManagement.AbpTenantManagementHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.FeatureManagement.AbpFeatureManagementHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.SettingManagement.AbpSettingManagementHttpApiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]   - KonSoft.Admin.AdminApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - KonSoft.Admin.AdminDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.AuditLogging.AbpAuditLoggingDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.BackgroundJobs.AbpBackgroundJobsDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.BackgroundJobs.AbpBackgroundJobsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.BackgroundJobs.AbpBackgroundJobsAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AutoMapper.AbpAutoMapperModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.FeatureManagement.AbpFeatureManagementDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Identity.AbpIdentityDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.Users.AbpUsersDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.OpenIddict.AbpOpenIddictDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.PermissionManagement.OpenIddict.AbpPermissionManagementDomainOpenIddictModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.PermissionManagement.AbpPermissionManagementDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.PermissionManagement.Identity.AbpPermissionManagementDomainIdentityModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.SettingManagement.AbpSettingManagementDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.TenantManagement.AbpTenantManagementDomainModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Emailing.AbpEmailingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.TextTemplating.AbpTextTemplatingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.TextTemplating.Scriban.AbpTextTemplatingScribanModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]             - Volo.Abp.TextTemplating.AbpTextTemplatingCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.Account.AbpAccountApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Identity.AbpIdentityApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.PermissionManagement.AbpPermissionManagementApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.TenantManagement.AbpTenantManagementApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.FeatureManagement.AbpFeatureManagementApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.SettingManagement.AbpSettingManagementApplicationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]   - KonSoft.Admin.EntityFrameworkCore.AdminEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.Identity.EntityFrameworkCore.AbpIdentityEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Users.EntityFrameworkCore.AbpUsersEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.EntityFrameworkCore.AbpEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.OpenIddict.EntityFrameworkCore.AbpOpenIddictEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.PermissionManagement.EntityFrameworkCore.AbpPermissionManagementEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.SettingManagement.EntityFrameworkCore.AbpSettingManagementEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.EntityFrameworkCore.PostgreSql.AbpEntityFrameworkCorePostgreSqlModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.BackgroundJobs.EntityFrameworkCore.AbpBackgroundJobsEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.AuditLogging.EntityFrameworkCore.AbpAuditLoggingEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.TenantManagement.EntityFrameworkCore.AbpTenantManagementEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.FeatureManagement.EntityFrameworkCore.AbpFeatureManagementEntityFrameworkCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]   - KonSoft.Shared.Hosting.Microservices.KonSoftSharedHostingMicroservicesModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - KonSoft.Shared.Hosting.AspNetCore.KonSoftSharedHostingAspNetCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - KonSoft.Shared.Localization.KonSoftSharedLocalizationModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - KonSoft.Shared.Hosting.KonSoftSharedHostingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.Autofac.AbpAutofacModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.Castle.AbpCastleCoreModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.AspNetCore.Serilog.AbpAspNetCoreSerilogModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.Swashbuckle.AbpSwashbuckleModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.BackgroundJobs.RabbitMQ.AbpBackgroundJobsRabbitMqModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.RabbitMQ.AbpRabbitMqModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.AspNetCore.Authentication.JwtBearer.AbpAspNetCoreAuthenticationJwtBearerModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.EventBus.RabbitMq.AbpEventBusRabbitMqModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.Caching.StackExchangeRedis.AbpCachingStackExchangeRedisModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.DistributedLocking.AbpDistributedLockingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]     - Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy.AbpAspNetCoreMvcUiMultiTenancyModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared.AbpAspNetCoreMvcUiThemeSharedModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.AbpAspNetCoreMvcUiBootstrapModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.AspNetCore.Mvc.UI.AbpAspNetCoreMvcUiModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AspNetCore.Mvc.UI.Packages.AbpAspNetCoreMvcUiPackagesModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingAbstractionsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]         - Volo.Abp.AspNetCore.Mvc.UI.Widgets.AbpAspNetCoreMvcUiWidgetsModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]           - Volo.Abp.AspNetCore.Mvc.UI.Bundling.AbpAspNetCoreMvcUiBundlingModule | ||||||
|  | 2025-10-26 10:39:21.030 +08:00 [INF]       - Volo.Abp.AspNetCore.MultiTenancy.AbpAspNetCoreMultiTenancyModule | ||||||
|  | 2025-10-26 10:39:21.367 +08:00 [DBG] Started background worker: Volo.Abp.OpenIddict.Tokens.TokenCleanupBackgroundWorker | ||||||
|  | |||||||
| @ -1,8 +1,8 @@ | |||||||
| using System; | using KonSoft.Admin; | ||||||
| using KonSoft.Admin; |  | ||||||
| using KonSoft.Shared.Hosting.AspNetCore; | using KonSoft.Shared.Hosting.AspNetCore; | ||||||
| using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||||
| using Serilog; | using Serilog; | ||||||
|  | using System; | ||||||
|  |  | ||||||
| var assemblyName = typeof(Program).Assembly.GetName().Name!; | var assemblyName = typeof(Program).Assembly.GetName().Name!; | ||||||
|  |  | ||||||
| @ -13,6 +13,7 @@ try | |||||||
|     var app = await ApplicationBuilderHelper |     var app = await ApplicationBuilderHelper | ||||||
|         .BuildApplicationAsync<AdminHttpApiHostModule>(args); |         .BuildApplicationAsync<AdminHttpApiHostModule>(args); | ||||||
|     await app.InitializeApplicationAsync(); |     await app.InitializeApplicationAsync(); | ||||||
|  |     app.MapGet("/heath", () => "Online"); | ||||||
|     await app.RunAsync(); |     await app.RunAsync(); | ||||||
|  |  | ||||||
|     return 0; |     return 0; | ||||||
|  | |||||||
| @ -6,18 +6,7 @@ | |||||||
|       "environmentVariables": { |       "environmentVariables": { | ||||||
|         "ASPNETCORE_ENVIRONMENT": "Development" |         "ASPNETCORE_ENVIRONMENT": "Development" | ||||||
|       }, |       }, | ||||||
|       "applicationUrl": "https://localhost:44354" |       "applicationUrl": "http://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 |  | ||||||
|     } |     } | ||||||
|   }, |   }, | ||||||
|   "$schema": "http://json.schemastore.org/launchsettings.json" |   "$schema": "http://json.schemastore.org/launchsettings.json" | ||||||
|  | |||||||
| @ -6,8 +6,9 @@ | |||||||
|     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" |     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" | ||||||
|   }, |   }, | ||||||
|   "AuthServer": { |   "AuthServer": { | ||||||
|     "Authority": "https://localhost:44322", |     "Authority": "https://devauth.konsoft.top", | ||||||
|     "RequireHttpsMetadata": true, |     "RequireHttpsMetadata": false, | ||||||
|     "SwaggerClientId": "Admin_Swagger" |     "SwaggerClientId": "Dev_Admin_Swagger", | ||||||
|  |     "MetadataAddress": "https://devauth.konsoft.top" | ||||||
|   } |   } | ||||||
| } | } | ||||||
| @ -0,0 +1,25 @@ | |||||||
|  | using KonSoft.Admin.Enums; | ||||||
|  | using System; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Text; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  | using Volo.Abp.Application.Dtos; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Admin.Dtos | ||||||
|  | { | ||||||
|  |     public class OrderPagedResultRequestDto : PagedResultRequestDto | ||||||
|  |     { | ||||||
|  |         /// <summary> | ||||||
|  |         /// 订单状态 | ||||||
|  |         /// </summary> | ||||||
|  |         public OrderStatus Status { get; set; } = OrderStatus.Created; | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 服务时间 | ||||||
|  |         /// </summary> | ||||||
|  |         public DateTime? ServiceTime { get;  set; } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,12 @@ | |||||||
|  | using System; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Text; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Admin.Dtos | ||||||
|  | { | ||||||
|  |     public class WorkerRegisterDto | ||||||
|  |     { | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,61 @@ | |||||||
|  | using KonSoft.Admin.Dtos; | ||||||
|  | using System; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  | using Volo.Abp.Application.Services; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Admin.IApplicationServices; | ||||||
|  |  | ||||||
|  | public interface IHouseholdWorkerAppService : IApplicationService | ||||||
|  | { | ||||||
|  |     /// <summary> | ||||||
|  |     /// 家政人员注册 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="input"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task RegisterAsync(WorkerRegisterDto input); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 家政人员接单 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task AcceptOrderAsync(Guid orderId); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 家政人员退单 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task RejectOrderAsync(Guid orderId); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 已到达(开始服务) | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task StartServiceAsync(Guid orderId); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 完成服务 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task CompleteServiceAsync(Guid orderId); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 获取当前分配给家政人员的订单列表 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task<List<OrderDto>> GetAssignedOrdersAsync(OrderPagedResultRequestDto requestDto); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 获取待接单订单 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task<List<OrderDto>> GetCreatedOrdersAsync(OrderPagedResultRequestDto requestDto); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  | } | ||||||
| @ -15,14 +15,37 @@ public interface IOrderAppService : IApplicationService | |||||||
|     /// <returns></returns> |     /// <returns></returns> | ||||||
|     Task<OrderDto> CreateAsync(CreateOrderDto input); |     Task<OrderDto> CreateAsync(CreateOrderDto input); | ||||||
|  |  | ||||||
|     Task<OrderDto> PayAsync(Guid orderId, PayOrderDto input); |     /// <summary> | ||||||
|     Task AssignAsync(Guid orderId, Guid workerId); |     /// 支付上门费 | ||||||
|     Task StartServiceAsync(Guid orderId); |     /// </summary> | ||||||
|     Task CompleteServiceAsync(Guid orderId); |     /// <param name="orderId"></param> | ||||||
|     Task ConfirmAsync(Guid orderId); |     /// <param name="input"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task PayServiceCallFeeAsync(Guid orderId, PayOrderDto input); | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 支付 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <param name="input"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|  |     Task PayAsync(Guid orderId, PayOrderDto input); | ||||||
|  |  | ||||||
|  |     /// <summary> | ||||||
|  |     /// 取消订单 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="orderId"></param> | ||||||
|  |     /// <param name="reason"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|     Task CancelAsync(Guid orderId, string reason); |     Task CancelAsync(Guid orderId, string reason); | ||||||
|     Task DeleteAsync(params Guid[] ids); |     Task DeleteAsync(params Guid[] ids); | ||||||
|  |     /// <summary> | ||||||
|  |     /// 修改订单 | ||||||
|  |     /// </summary> | ||||||
|  |     /// <param name="input"></param> | ||||||
|  |     /// <returns></returns> | ||||||
|     Task EditAsync(OrderDto input); |     Task EditAsync(OrderDto input); | ||||||
|     Task<OrderDto> GetAsync(Guid id); |     Task<OrderDto> GetAsync(Guid id); | ||||||
|     Task<PagedResultDto<OrderDto>> GetListAsync(PagedResultRequestDto input); |     Task<PagedResultDto<OrderDto>> GetListAsync(OrderPagedResultRequestDto input); | ||||||
| } | } | ||||||
| @ -1,7 +0,0 @@ | |||||||
| using Volo.Abp.Application.Services; |  | ||||||
|  |  | ||||||
| namespace KonSoft.Admin.IApplicationServices; |  | ||||||
|  |  | ||||||
| public interface IWorkerAppService : IApplicationService |  | ||||||
| { |  | ||||||
| } |  | ||||||
| @ -0,0 +1,126 @@ | |||||||
|  | using KonSoft.Admin.Dtos; | ||||||
|  | using KonSoft.Admin.Entities; | ||||||
|  | using KonSoft.Admin.IApplicationServices; | ||||||
|  | using KonSoft.Admin.IRepositories; | ||||||
|  | using System; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Text; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  | using Volo.Abp; | ||||||
|  | using Volo.Abp.Application.Services; | ||||||
|  | using Volo.Abp.Domain.Repositories; | ||||||
|  | using Volo.Abp.ObjectMapping; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Admin.ApplicationServices | ||||||
|  | { | ||||||
|  |     public class HouseholdWorkerAppService : ApplicationService, IHouseholdWorkerAppService | ||||||
|  |     { | ||||||
|  |         public IOrderRepository _orderRepository { get; set; } | ||||||
|  |  | ||||||
|  |         public HouseholdWorkerAppService(IOrderRepository orderRepository) | ||||||
|  |         { | ||||||
|  |             _orderRepository = orderRepository; | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 家政人员接单 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="orderId"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exception cref="NotImplementedException"></exception> | ||||||
|  |         public async Task AcceptOrderAsync(Guid orderId) | ||||||
|  |         { | ||||||
|  |             var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |             if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |             order.AssignWorker(CurrentUser.Id!.Value); | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 获取已接单任务 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exception cref="NotImplementedException"></exception> | ||||||
|  |         public async Task<List<OrderDto>> GetAssignedOrdersAsync(OrderPagedResultRequestDto requestDto) | ||||||
|  |         { | ||||||
|  |             //TODO 默认根据角色筛选对应订单,整合到一个接口中 | ||||||
|  |             var query =  await _orderRepository.GetQueryableAsync(); | ||||||
|  |            var orders = query.Where(o => o.HouseholdWorkerId == CurrentUser.Id) | ||||||
|  |                 .PageBy(requestDto).ToList(); ; | ||||||
|  |  | ||||||
|  |             return ObjectMapper.Map<List<Order>, List<OrderDto>>(orders); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 获取待接单任务 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="requestDto"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         public async Task<List<OrderDto>> GetCreatedOrdersAsync(OrderPagedResultRequestDto requestDto) | ||||||
|  |         {        | ||||||
|  |            //TODO 默认根据角色筛选对应订单,整合到一个接口中 | ||||||
|  |             var query = await _orderRepository.GetQueryableAsync(); | ||||||
|  |             var orders = query.Where(o => o.Status == Enums.OrderStatus.Created) | ||||||
|  |                  .PageBy(requestDto).ToList(); ; | ||||||
|  |  | ||||||
|  |             return ObjectMapper.Map<List<Order>, List<OrderDto>>(orders); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 家政人员注册 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="input"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exception cref="NotImplementedException"></exception> | ||||||
|  |         public Task RegisterAsync(WorkerRegisterDto input) | ||||||
|  |         { | ||||||
|  |             throw new NotImplementedException(); | ||||||
|  |         } | ||||||
|  |         /// <summary> | ||||||
|  |         /// 退单 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="orderId"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exasception cref="NotImplementedException"></exception> | ||||||
|  |         public async Task RejectOrderAsync(Guid orderId) | ||||||
|  |         { | ||||||
|  |             var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |             if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |             order.RejectOrder(CurrentUser.Id!.Value); | ||||||
|  |         } | ||||||
|  |         /// <summary> | ||||||
|  |         /// 开始服务 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="orderId"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exception cref="NotImplementedException"></exception> | ||||||
|  |         public async Task StartServiceAsync(Guid orderId) | ||||||
|  |         { | ||||||
|  |             var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |             if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |             order.StartService(); | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         /// <summary> | ||||||
|  |         /// 服务完成 | ||||||
|  |         /// </summary> | ||||||
|  |         /// <param name="orderId"></param> | ||||||
|  |         /// <returns></returns> | ||||||
|  |         /// <exception cref="NotImplementedException"></exception> | ||||||
|  |         public async Task CompleteServiceAsync(Guid orderId) | ||||||
|  |         { | ||||||
|  |             var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |             if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |             order.CompleteService(); | ||||||
|  |  | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -18,18 +18,6 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
| { | { | ||||||
|     private readonly IOrderRepository _orderRepository = orderRepository; |     private readonly IOrderRepository _orderRepository = orderRepository; | ||||||
|  |  | ||||||
|     /// <summary> |  | ||||||
|     ///     分配师傅 |  | ||||||
|     /// </summary> |  | ||||||
|     /// <param name="orderId"></param> |  | ||||||
|     /// <param name="workerId"></param> |  | ||||||
|     /// <returns></returns> |  | ||||||
|     /// <exception cref="NotImplementedException"></exception> |  | ||||||
|     public async Task AssignAsync(Guid orderId, Guid workerId) |  | ||||||
|     { |  | ||||||
|         var order = await _orderRepository.GetAsync(o => o.Id == orderId); |  | ||||||
|         order.AssignWorker(workerId); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     取消订单 |     ///     取消订单 | ||||||
| @ -44,29 +32,6 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
|         order.Cancel(reason); |         order.Cancel(reason); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// <summary> |  | ||||||
|     ///     完成订单 |  | ||||||
|     /// </summary> |  | ||||||
|     /// <param name="orderId"></param> |  | ||||||
|     /// <returns></returns> |  | ||||||
|     /// <exception cref="NotImplementedException"></exception> |  | ||||||
|     public async Task CompleteServiceAsync(Guid orderId) |  | ||||||
|     { |  | ||||||
|         var order = await _orderRepository.GetAsync(o => o.Id == orderId); |  | ||||||
|         order.CompleteService(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /// <summary> |  | ||||||
|     ///     确认订单 |  | ||||||
|     /// </summary> |  | ||||||
|     /// <param name="orderId"></param> |  | ||||||
|     /// <returns></returns> |  | ||||||
|     /// <exception cref="NotImplementedException"></exception> |  | ||||||
|     public async Task ConfirmAsync(Guid orderId) |  | ||||||
|     { |  | ||||||
|         var order = await _orderRepository.GetAsync(o => o.Id == orderId); |  | ||||||
|         order.ConfirmCompletion(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     创建订单 |     ///     创建订单 | ||||||
| @ -97,10 +62,9 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     修改订单信息 |     /// 修改订单信息 | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     /// <param name="input">订单DTO对象</param> |     /// <param name="input">订单DTO对象</param> | ||||||
|     /// s |  | ||||||
|     public async Task EditAsync(OrderDto input) |     public async Task EditAsync(OrderDto input) | ||||||
|     { |     { | ||||||
|         // 根据ID查询订单,如果不存在则抛出异常【修改前端必然看到了,数据若查不到提示自定义异常信息】 |         // 根据ID查询订单,如果不存在则抛出异常【修改前端必然看到了,数据若查不到提示自定义异常信息】 | ||||||
| @ -111,35 +75,37 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
|         ObjectMapper.Map(input, order); |         ObjectMapper.Map(input, order); | ||||||
|  |  | ||||||
|         // 更新订单 |         // 更新订单 | ||||||
|         await _orderRepository.UpdateAsync(order); |         //await _orderRepository.UpdateAsync(order); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |     public async Task PayServiceCallFeeAsync(Guid orderId, PayOrderDto input) | ||||||
|  |     { | ||||||
|  |         var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |         if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |         order.PayServiceCallFee(); | ||||||
|  |  | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     支付 |     /// 支付 | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     /// <param name="orderId"></param> |     /// <param name="orderId"></param> | ||||||
|     /// <param name="input"></param> |     /// <param name="input"></param> | ||||||
|     /// <returns></returns> |     /// <returns></returns> | ||||||
|     /// <exception cref="NotImplementedException"></exception> |     /// <exception cref="NotImplementedException"></exception> | ||||||
|     public Task<OrderDto> PayAsync(Guid orderId, PayOrderDto input) |     public async Task PayAsync(Guid orderId, PayOrderDto input) | ||||||
|     { |     { | ||||||
|         throw new NotImplementedException(); |         var order = await _orderRepository.FirstOrDefaultAsync(o => o.Id == orderId); | ||||||
|  |         if (order == null) throw new BusinessException("未找到订单"); | ||||||
|  |  | ||||||
|  |         order.Pay(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// <summary> |  | ||||||
|     ///     开始订单 |  | ||||||
|     /// </summary> |  | ||||||
|     /// <param name="orderId"></param> |  | ||||||
|     /// <returns></returns> |  | ||||||
|     /// <exception cref="NotImplementedException"></exception> |  | ||||||
|     public async Task StartServiceAsync(Guid orderId) |  | ||||||
|     { |  | ||||||
|         var order = await _orderRepository.GetAsync(o => o.Id == orderId); |  | ||||||
|         order.StartService(); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     根据订单ID获取单个订单 |     /// 根据订单ID获取单个订单 | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public async Task<OrderDto> GetAsync(Guid id) |     public async Task<OrderDto> GetAsync(Guid id) | ||||||
|     { |     { | ||||||
| @ -151,12 +117,13 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     获取所有订单列表 |     /// 获取订单列表 | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public async Task<PagedResultDto<OrderDto>> GetListAsync(PagedResultRequestDto input) |     public async Task<PagedResultDto<OrderDto>> GetListAsync(OrderPagedResultRequestDto input) | ||||||
|     { |     { | ||||||
|         // 查询所有订单 |         //TODO 默认根据角色筛选对应订单,整合到一个接口中 | ||||||
|         var orders = await _orderRepository.GetPagedListAsync(input.SkipCount, input.MaxResultCount, "Id"); |         var query = await _orderRepository.GetQueryableAsync(); | ||||||
|  |         var orders = query.PageBy(input).OrderBy(o => o.Id).ToList(); | ||||||
|  |  | ||||||
|         var totalCount = await _orderRepository.CountAsync(); |         var totalCount = await _orderRepository.CountAsync(); | ||||||
|  |  | ||||||
| @ -164,4 +131,8 @@ public class OrderAppService(IOrderRepository orderRepository) : ApplicationServ | |||||||
|  |  | ||||||
|         return new PagedResultDto<OrderDto>(totalCount, orderDtos); |         return new PagedResultDto<OrderDto>(totalCount, orderDtos); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
| } | } | ||||||
| @ -2,13 +2,13 @@ | |||||||
|  |  | ||||||
| public enum OrderStatus | public enum OrderStatus | ||||||
| { | { | ||||||
|     PendingPayment, // 待支付 |     Created = 1,             //用户创建订单 | ||||||
|     PaidWaitingAssign, // 已支付待派单 |     Assigned,                //家政人员已接单 | ||||||
|     AssignedWaitingService, // 已派单待服务 |     ServiceCallPaymentComplete,   //上门费支付完成 | ||||||
|     InService, // 服务中 |     ServiceStarted,          //服务开始 | ||||||
|     WaitingConfirm, // 待用户确认 |     ServiceCompleted,        //服务已完成 | ||||||
|     Completed, // 已完成 |     PaymentPending,          //用户支付订单 | ||||||
|     Canceled, // 已取消 |     PaymentComplete,         //用户支付完成 | ||||||
|     Refunding, // 退款中 |     Cancelled,               //订单取消 | ||||||
|     Refunded // 已退款 |     Refunded,                //订单退款 | ||||||
| } | } | ||||||
| @ -1,8 +0,0 @@ | |||||||
| using System.Threading.Tasks; |  | ||||||
|  |  | ||||||
| namespace KonSoft.Admin.Data; |  | ||||||
|  |  | ||||||
| public interface IAdminDbSchemaMigrator |  | ||||||
| { |  | ||||||
|     Task MigrateAsync(); |  | ||||||
| } |  | ||||||
| @ -1,15 +0,0 @@ | |||||||
| using System.Threading.Tasks; |  | ||||||
| using Volo.Abp.DependencyInjection; |  | ||||||
|  |  | ||||||
| namespace KonSoft.Admin.Data; |  | ||||||
|  |  | ||||||
| /* This is used if database provider does't define |  | ||||||
|  * IAdminDbSchemaMigrator implementation. |  | ||||||
|  */ |  | ||||||
| public class NullAdminDbSchemaMigrator : IAdminDbSchemaMigrator, ITransientDependency |  | ||||||
| { |  | ||||||
|     public Task MigrateAsync() |  | ||||||
|     { |  | ||||||
|         return Task.CompletedTask; |  | ||||||
|     } |  | ||||||
| } |  | ||||||
| @ -1,7 +1,9 @@ | |||||||
| using System; | using KonSoft.Admin.Enums; | ||||||
| using KonSoft.Admin.Enums; |  | ||||||
| using KonSoft.Admin.ValueObjects; | using KonSoft.Admin.ValueObjects; | ||||||
|  | using System; | ||||||
|  | using Volo.Abp; | ||||||
| using Volo.Abp.Domain.Entities.Auditing; | using Volo.Abp.Domain.Entities.Auditing; | ||||||
|  | using Volo.Abp.Identity; | ||||||
|  |  | ||||||
| namespace KonSoft.Admin.Entities; | namespace KonSoft.Admin.Entities; | ||||||
|  |  | ||||||
| @ -21,18 +23,20 @@ public class Order : FullAuditedAggregateRoot<Guid> | |||||||
|         Amount = amount; |         Amount = amount; | ||||||
|         Address = address; |         Address = address; | ||||||
|         Remark = remark; |         Remark = remark; | ||||||
|         Status = OrderStatus.PendingPayment; |         Status = OrderStatus.Created; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     用户ID |     ///     用户ID | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public Guid CustomerId { get; private set; } |     public Guid CustomerId { get; private set; } | ||||||
|  |     public virtual IdentityUser Customer { get; private set; } | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     家政人员ID |     ///     家政人员ID | ||||||
|     /// </summary> |     /// </summary> | ||||||
|     public Guid? WorkerId { get; private set; } |     public Guid? HouseholdWorkerId { get; private set; } | ||||||
|  |     public IdentityUser? HouseholdWorker { get; private set; } | ||||||
|  |  | ||||||
|     /// <summary> |     /// <summary> | ||||||
|     ///     服务项目ID |     ///     服务项目ID | ||||||
| @ -80,79 +84,105 @@ public class Order : FullAuditedAggregateRoot<Guid> | |||||||
|     public string? CancelReason { get; private set; } |     public string? CancelReason { get; private set; } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void MarkPaid(decimal paidAmount, string method) |     //public void MarkPaid(decimal paidAmount, string method) | ||||||
|     { |     //{ | ||||||
|         if (Status != OrderStatus.PendingPayment) |     //    if (Status != OrderStatus.PendingPayment) | ||||||
|         { |     //    { | ||||||
|             throw new InvalidOperationException("订单不在待付款状态"); |     //        throw new InvalidOperationException("订单不在待付款状态"); | ||||||
|         } |     //    } | ||||||
|  |  | ||||||
|  |  | ||||||
|         PaidAmount = paidAmount; |     //    PaidAmount = paidAmount; | ||||||
|         PaymentMethod = method; |     //    PaymentMethod = method; | ||||||
|         Status = OrderStatus.PaidWaitingAssign; |     //    Status = OrderStatus.PaidWaitingAssign; | ||||||
|     } |     //} | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void AssignWorker(Guid workerId) |     public void AssignWorker(Guid workerId) | ||||||
|     { |     { | ||||||
|         if (Status != OrderStatus.PaidWaitingAssign) |         if (Status != OrderStatus.Created) | ||||||
|         { |         { | ||||||
|             throw new InvalidOperationException("订单无法分配师傅"); |             throw new BusinessException("订单无法分配师傅"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|         WorkerId = workerId; |         HouseholdWorkerId = workerId; | ||||||
|         Status = OrderStatus.AssignedWaitingService; |         Status = OrderStatus.Assigned; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public void RejectOrder(Guid workerId) | ||||||
|  |     { | ||||||
|  |         if (Status != OrderStatus.Created) | ||||||
|  |         { | ||||||
|  |             throw new BusinessException("订单无法分配师傅"); | ||||||
|  |         } | ||||||
|  |         if (HouseholdWorkerId != workerId) | ||||||
|  |         { | ||||||
|  |             throw new BusinessException("订单不属于你,无法退单"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         Status = OrderStatus.Created; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     public void PayServiceCallFee() | ||||||
|  |     { | ||||||
|  |         if (Status != OrderStatus.Assigned) | ||||||
|  |         { | ||||||
|  |             throw new BusinessException("订单无法支付上门费"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |         Status = OrderStatus.ServiceCallPaymentComplete; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|  |     public void Pay() | ||||||
|  |     { | ||||||
|  |         if (Status != OrderStatus.ServiceCompleted) | ||||||
|  |         { | ||||||
|  |             throw new BusinessException("订单服务未完成无法支付"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         Status = OrderStatus.PaymentPending; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void StartService() |     public void StartService() | ||||||
|     { |     { | ||||||
|         if (Status != OrderStatus.AssignedWaitingService) |         if (Status != OrderStatus.ServiceCallPaymentComplete) | ||||||
|         { |         { | ||||||
|             throw new InvalidOperationException("订单无法开始"); |             throw new BusinessException("订单未支付上门费无法开始"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         Status = OrderStatus.ServiceStarted; | ||||||
|         Status = OrderStatus.InService; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void CompleteService() |     public void CompleteService() | ||||||
|     { |     { | ||||||
|         if (Status != OrderStatus.InService) |         if (Status != OrderStatus.ServiceStarted) | ||||||
|         { |         { | ||||||
|             throw new InvalidOperationException("订单未开始服务,无法完成"); |             throw new BusinessException("订单未开始,无法完成"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |         Status = OrderStatus.ServiceCompleted; | ||||||
|         Status = OrderStatus.WaitingConfirm; |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void ConfirmCompletion() |  | ||||||
|     { |  | ||||||
|         if (Status != OrderStatus.WaitingConfirm) |  | ||||||
|         { |  | ||||||
|             throw new InvalidOperationException("订单无法确认"); |  | ||||||
|         } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|         Status = OrderStatus.Completed; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|  |  | ||||||
|     public void Cancel(string reason) |     public void Cancel(string reason) | ||||||
|     { |     { | ||||||
|         // 若已完成或退款中则不可取消 |         // 若已完成或退款中则不可取消 | ||||||
|         if (Status == OrderStatus.Completed || Status == OrderStatus.Refunding || Status == OrderStatus.Refunded) |         if (Status == OrderStatus.ServiceCompleted || Status == OrderStatus.Cancelled || Status == OrderStatus.Refunded) | ||||||
|         { |         { | ||||||
|             throw new InvalidOperationException("订单无法被取消"); |             throw new BusinessException("订单无法被取消"); | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  |  | ||||||
|         CancelReason = reason; |         CancelReason = reason; | ||||||
|         Status = OrderStatus.Canceled; |         Status = OrderStatus.Cancelled; | ||||||
|     } |     } | ||||||
| } | } | ||||||
							
								
								
									
										2315
									
								
								modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20251026064212_V1.0.1.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										2315
									
								
								modules/admin/src/KonSoft.Admin.EntityFrameworkCore/Migrations/20251026064212_V1.0.1.Designer.cs
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -0,0 +1,69 @@ | |||||||
|  | using Microsoft.EntityFrameworkCore.Migrations; | ||||||
|  |  | ||||||
|  | #nullable disable | ||||||
|  |  | ||||||
|  | namespace KonSoft.Admin.Migrations | ||||||
|  | { | ||||||
|  |     /// <inheritdoc /> | ||||||
|  |     public partial class V101 : Migration | ||||||
|  |     { | ||||||
|  |         /// <inheritdoc /> | ||||||
|  |         protected override void Up(MigrationBuilder migrationBuilder) | ||||||
|  |         { | ||||||
|  |             migrationBuilder.RenameColumn( | ||||||
|  |                 name: "WorkerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 newName: "HouseholdWorkerId"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.CreateIndex( | ||||||
|  |                 name: "IX_AppOrder_CustomerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 column: "CustomerId"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.CreateIndex( | ||||||
|  |                 name: "IX_AppOrder_HouseholdWorkerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 column: "HouseholdWorkerId"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.AddForeignKey( | ||||||
|  |                 name: "FK_AppOrder_AbpUsers_CustomerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 column: "CustomerId", | ||||||
|  |                 principalTable: "AbpUsers", | ||||||
|  |                 principalColumn: "Id", | ||||||
|  |                 onDelete: ReferentialAction.Cascade); | ||||||
|  |  | ||||||
|  |             migrationBuilder.AddForeignKey( | ||||||
|  |                 name: "FK_AppOrder_AbpUsers_HouseholdWorkerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 column: "HouseholdWorkerId", | ||||||
|  |                 principalTable: "AbpUsers", | ||||||
|  |                 principalColumn: "Id"); | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         /// <inheritdoc /> | ||||||
|  |         protected override void Down(MigrationBuilder migrationBuilder) | ||||||
|  |         { | ||||||
|  |             migrationBuilder.DropForeignKey( | ||||||
|  |                 name: "FK_AppOrder_AbpUsers_CustomerId", | ||||||
|  |                 table: "AppOrder"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.DropForeignKey( | ||||||
|  |                 name: "FK_AppOrder_AbpUsers_HouseholdWorkerId", | ||||||
|  |                 table: "AppOrder"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.DropIndex( | ||||||
|  |                 name: "IX_AppOrder_CustomerId", | ||||||
|  |                 table: "AppOrder"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.DropIndex( | ||||||
|  |                 name: "IX_AppOrder_HouseholdWorkerId", | ||||||
|  |                 table: "AppOrder"); | ||||||
|  |  | ||||||
|  |             migrationBuilder.RenameColumn( | ||||||
|  |                 name: "HouseholdWorkerId", | ||||||
|  |                 table: "AppOrder", | ||||||
|  |                 newName: "WorkerId"); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -68,6 +68,9 @@ namespace KonSoft.Admin.Migrations | |||||||
|                         .HasColumnType("text") |                         .HasColumnType("text") | ||||||
|                         .HasColumnName("ExtraProperties"); |                         .HasColumnName("ExtraProperties"); | ||||||
|  |  | ||||||
|  |                     b.Property<Guid?>("HouseholdWorkerId") | ||||||
|  |                         .HasColumnType("uuid"); | ||||||
|  |  | ||||||
|                     b.Property<bool>("IsDeleted") |                     b.Property<bool>("IsDeleted") | ||||||
|                         .ValueGeneratedOnAdd() |                         .ValueGeneratedOnAdd() | ||||||
|                         .HasColumnType("boolean") |                         .HasColumnType("boolean") | ||||||
| @ -101,9 +104,6 @@ namespace KonSoft.Admin.Migrations | |||||||
|                     b.Property<int>("Status") |                     b.Property<int>("Status") | ||||||
|                         .HasColumnType("integer"); |                         .HasColumnType("integer"); | ||||||
|  |  | ||||||
|                     b.Property<Guid?>("WorkerId") |  | ||||||
|                         .HasColumnType("uuid"); |  | ||||||
|  |  | ||||||
|                     b.ComplexProperty<Dictionary<string, object>>("Address", "KonSoft.Admin.Entities.Order.Address#AddressInfo", b1 => |                     b.ComplexProperty<Dictionary<string, object>>("Address", "KonSoft.Admin.Entities.Order.Address#AddressInfo", b1 => | ||||||
|                         { |                         { | ||||||
|                             b1.IsRequired(); |                             b1.IsRequired(); | ||||||
| @ -131,6 +131,10 @@ namespace KonSoft.Admin.Migrations | |||||||
|  |  | ||||||
|                     b.HasKey("Id"); |                     b.HasKey("Id"); | ||||||
|  |  | ||||||
|  |                     b.HasIndex("CustomerId"); | ||||||
|  |  | ||||||
|  |                     b.HasIndex("HouseholdWorkerId"); | ||||||
|  |  | ||||||
|                     b.ToTable("AppOrder", (string)null); |                     b.ToTable("AppOrder", (string)null); | ||||||
|                 }); |                 }); | ||||||
|  |  | ||||||
| @ -2104,6 +2108,23 @@ namespace KonSoft.Admin.Migrations | |||||||
|                     b.HasDiscriminator().HasValue("HouseholdWorker"); |                     b.HasDiscriminator().HasValue("HouseholdWorker"); | ||||||
|                 }); |                 }); | ||||||
|  |  | ||||||
|  |             modelBuilder.Entity("KonSoft.Admin.Entities.Order", b => | ||||||
|  |                 { | ||||||
|  |                     b.HasOne("Volo.Abp.Identity.IdentityUser", "Customer") | ||||||
|  |                         .WithMany() | ||||||
|  |                         .HasForeignKey("CustomerId") | ||||||
|  |                         .OnDelete(DeleteBehavior.Cascade) | ||||||
|  |                         .IsRequired(); | ||||||
|  |  | ||||||
|  |                     b.HasOne("Volo.Abp.Identity.IdentityUser", "HouseholdWorker") | ||||||
|  |                         .WithMany() | ||||||
|  |                         .HasForeignKey("HouseholdWorkerId"); | ||||||
|  |  | ||||||
|  |                     b.Navigation("Customer"); | ||||||
|  |  | ||||||
|  |                     b.Navigation("HouseholdWorker"); | ||||||
|  |                 }); | ||||||
|  |  | ||||||
|             modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => |             modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => | ||||||
|                 { |                 { | ||||||
|                     b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) |                     b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) | ||||||
|  | |||||||
| @ -13,19 +13,19 @@ using Volo.Abp.Identity; | |||||||
| using Volo.Abp.MultiTenancy; | using Volo.Abp.MultiTenancy; | ||||||
| using Volo.Abp.TenantManagement; | using Volo.Abp.TenantManagement; | ||||||
| 
 | 
 | ||||||
| namespace KonSoft.Admin.Data; | namespace KonSoft.Shared.DbMigrator.Data; | ||||||
| 
 | 
 | ||||||
| public class AdminDbMigrationService : ITransientDependency | public class DbMigrationService : ITransientDependency | ||||||
| { | { | ||||||
|     private readonly ICurrentTenant _currentTenant; |     private readonly ICurrentTenant _currentTenant; | ||||||
| 
 | 
 | ||||||
|     private readonly IDataSeeder _dataSeeder; |     private readonly IDataSeeder _dataSeeder; | ||||||
|     private readonly IEnumerable<IAdminDbSchemaMigrator> _dbSchemaMigrators; |     private readonly IEnumerable<IDbSchemaMigrator> _dbSchemaMigrators; | ||||||
|     private readonly ITenantRepository _tenantRepository; |     private readonly ITenantRepository _tenantRepository; | ||||||
| 
 | 
 | ||||||
|     public AdminDbMigrationService( |     public DbMigrationService( | ||||||
|         IDataSeeder dataSeeder, |         IDataSeeder dataSeeder, | ||||||
|         IEnumerable<IAdminDbSchemaMigrator> dbSchemaMigrators, |         IEnumerable<IDbSchemaMigrator> dbSchemaMigrators, | ||||||
|         ITenantRepository tenantRepository, |         ITenantRepository tenantRepository, | ||||||
|         ICurrentTenant currentTenant) |         ICurrentTenant currentTenant) | ||||||
|     { |     { | ||||||
| @ -34,10 +34,10 @@ public class AdminDbMigrationService : ITransientDependency | |||||||
|         _tenantRepository = tenantRepository; |         _tenantRepository = tenantRepository; | ||||||
|         _currentTenant = currentTenant; |         _currentTenant = currentTenant; | ||||||
| 
 | 
 | ||||||
|         Logger = NullLogger<AdminDbMigrationService>.Instance; |         Logger = NullLogger<DbMigrationService>.Instance; | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     public ILogger<AdminDbMigrationService> Logger { get; set; } |     public ILogger<DbMigrationService> Logger { get; set; } | ||||||
| 
 | 
 | ||||||
|     public async Task MigrateAsync() |     public async Task MigrateAsync() | ||||||
|     { |     { | ||||||
| @ -1,18 +1,18 @@ | |||||||
| using System; | using System; | ||||||
| using System.Threading.Tasks; | using System.Threading.Tasks; | ||||||
| using KonSoft.Admin.Data; | using KonSoft.Admin.EntityFrameworkCore; | ||||||
| using Microsoft.EntityFrameworkCore; | using Microsoft.EntityFrameworkCore; | ||||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Volo.Abp.DependencyInjection; | using Volo.Abp.DependencyInjection; | ||||||
| 
 | 
 | ||||||
| namespace KonSoft.Admin.EntityFrameworkCore; | namespace KonSoft.Shared.DbMigrator.Data; | ||||||
| 
 | 
 | ||||||
| public class EntityFrameworkCoreAdminDbSchemaMigrator | public class EntityFrameworkCoreDbSchemaMigrator | ||||||
|     : IAdminDbSchemaMigrator, ITransientDependency |     : IDbSchemaMigrator, ITransientDependency | ||||||
| { | { | ||||||
|     private readonly IServiceProvider _serviceProvider; |     private readonly IServiceProvider _serviceProvider; | ||||||
| 
 | 
 | ||||||
|     public EntityFrameworkCoreAdminDbSchemaMigrator( |     public EntityFrameworkCoreDbSchemaMigrator( | ||||||
|         IServiceProvider serviceProvider) |         IServiceProvider serviceProvider) | ||||||
|     { |     { | ||||||
|         _serviceProvider = serviceProvider; |         _serviceProvider = serviceProvider; | ||||||
| @ -0,0 +1,8 @@ | |||||||
|  | using System.Threading.Tasks; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Shared.DbMigrator.Data; | ||||||
|  |  | ||||||
|  | public interface IDbSchemaMigrator | ||||||
|  | { | ||||||
|  |     Task MigrateAsync(); | ||||||
|  | } | ||||||
							
								
								
									
										51
									
								
								shared/KonSoft.Shared.DbMigrator/DbMigratorHostedService.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										51
									
								
								shared/KonSoft.Shared.DbMigrator/DbMigratorHostedService.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,51 @@ | |||||||
|  | using Microsoft.Extensions.Configuration; | ||||||
|  | using Microsoft.Extensions.DependencyInjection; | ||||||
|  | using Microsoft.Extensions.Hosting; | ||||||
|  | using Serilog; | ||||||
|  | using System.Threading; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  | using KonSoft.Shared.DbMigrator.Data; | ||||||
|  | using Volo.Abp; | ||||||
|  | using Volo.Abp.Data; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Shared.DbMigrator; | ||||||
|  |  | ||||||
|  | public class DbMigratorHostedService : IHostedService | ||||||
|  | { | ||||||
|  |     private readonly IHostApplicationLifetime _hostApplicationLifetime; | ||||||
|  |     private readonly IConfiguration _configuration; | ||||||
|  |  | ||||||
|  |     public DbMigratorHostedService(IHostApplicationLifetime hostApplicationLifetime, IConfiguration configuration) | ||||||
|  |     { | ||||||
|  |         _hostApplicationLifetime = hostApplicationLifetime; | ||||||
|  |         _configuration = configuration; | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public async Task StartAsync(CancellationToken cancellationToken) | ||||||
|  |     { | ||||||
|  |         using (var application = await AbpApplicationFactory.CreateAsync<KonSoftSharedDbMigratorModule>(options => | ||||||
|  |         { | ||||||
|  |            options.Services.ReplaceConfiguration(_configuration); | ||||||
|  |            options.UseAutofac(); | ||||||
|  |            options.Services.AddLogging(c => c.AddSerilog()); | ||||||
|  |            options.AddDataMigrationEnvironment(); | ||||||
|  |         })) | ||||||
|  |         { | ||||||
|  |             await application.InitializeAsync(); | ||||||
|  |  | ||||||
|  |             await application | ||||||
|  |                 .ServiceProvider | ||||||
|  |                 .GetRequiredService<DbMigrationService>() | ||||||
|  |                 .MigrateAsync(); | ||||||
|  |  | ||||||
|  |             await application.ShutdownAsync(); | ||||||
|  |  | ||||||
|  |             _hostApplicationLifetime.StopApplication(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     public Task StopAsync(CancellationToken cancellationToken) | ||||||
|  |     { | ||||||
|  |         return Task.CompletedTask; | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										26
									
								
								shared/KonSoft.Shared.DbMigrator/Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								shared/KonSoft.Shared.DbMigrator/Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,26 @@ | |||||||
|  | FROM mcr.microsoft.com/dotnet/runtime:9.0 AS base | ||||||
|  | USER $APP_UID | ||||||
|  | WORKDIR /app | ||||||
|  |  | ||||||
|  | FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build | ||||||
|  | ARG BUILD_CONFIGURATION=Release | ||||||
|  | COPY ["./common.props", "."] | ||||||
|  | COPY ["./NuGet.Config", "."] | ||||||
|  | COPY ["./src/KonSoft.SnowClub.DbMigrator/KonSoft.SnowClub.DbMigrator.csproj", "KonSoft.SnowClub.DbMigrator/"] | ||||||
|  | COPY ["./src/KonSoft.SnowClub.Application.Contracts/KonSoft.SnowClub.Application.Contracts.csproj", "KonSoft.SnowClub.Application.Contracts/"] | ||||||
|  | COPY ["./src/KonSoft.SnowClub.Domain.Shared/KonSoft.SnowClub.Domain.Shared.csproj", "KonSoft.SnowClub.Domain.Shared/"] | ||||||
|  | COPY ["./src/KonSoft.SnowClub.EntityFrameworkCore/KonSoft.SnowClub.EntityFrameworkCore.csproj", "KonSoft.SnowClub.EntityFrameworkCore/"] | ||||||
|  | COPY ["./src/KonSoft.SnowClub.Domain/KonSoft.SnowClub.Domain.csproj", "KonSoft.SnowClub.Domain/"] | ||||||
|  | RUN dotnet restore "./KonSoft.SnowClub.DbMigrator/KonSoft.SnowClub.DbMigrator.csproj" | ||||||
|  | COPY . . | ||||||
|  | WORKDIR "/src/KonSoft.SnowClub.DbMigrator" | ||||||
|  | RUN dotnet build "./KonSoft.SnowClub.DbMigrator.csproj" -c $BUILD_CONFIGURATION -o /app/build | ||||||
|  |  | ||||||
|  | FROM build AS publish | ||||||
|  | ARG BUILD_CONFIGURATION=Release | ||||||
|  | RUN dotnet publish "./KonSoft.SnowClub.DbMigrator.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false | ||||||
|  |  | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app/publish . | ||||||
|  | ENTRYPOINT ["dotnet", "KonSoft.SnowClub.DbMigrator.dll"] | ||||||
| @ -0,0 +1,31 @@ | |||||||
|  | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|  |  | ||||||
|  | 	<PropertyGroup> | ||||||
|  | 		<OutputType>Exe</OutputType> | ||||||
|  | 		<TargetFramework>net8.0</TargetFramework> | ||||||
|  | 		<Nullable>enable</Nullable> | ||||||
|  | 	</PropertyGroup> | ||||||
|  |  | ||||||
|  | 	<ItemGroup> | ||||||
|  | 		<None Remove="appsettings.json" /> | ||||||
|  | 		<Content Include="appsettings.json"> | ||||||
|  | 			<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||||||
|  | 			<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||||||
|  | 		</Content> | ||||||
|  | 	</ItemGroup> | ||||||
|  |  | ||||||
|  |  | ||||||
|  | 	<ItemGroup> | ||||||
|  | 		<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.Application.Contracts\KonSoft.Admin.Application.Contracts.csproj" /> | ||||||
|  | 		<ProjectReference Include="..\..\modules\admin\src\KonSoft.Admin.EntityFrameworkCore\KonSoft.Admin.EntityFrameworkCore.csproj" /> | ||||||
|  | 		<ProjectReference Include="..\KonSoft.Shared.Hosting.AspNetCore\KonSoft.Shared.Hosting.AspNetCore.csproj" /> | ||||||
|  | 	</ItemGroup> | ||||||
|  |  | ||||||
|  | 	<ItemGroup> | ||||||
|  | 		<Compile Remove="Logs\**" /> | ||||||
|  | 		<Content Remove="Logs\**" /> | ||||||
|  | 		<EmbeddedResource Remove="Logs\**" /> | ||||||
|  | 		<None Remove="Logs\**" /> | ||||||
|  | 	</ItemGroup> | ||||||
|  |  | ||||||
|  | </Project> | ||||||
| @ -0,0 +1,20 @@ | |||||||
|  | using KonSoft.Admin; | ||||||
|  | using KonSoft.Admin.EntityFrameworkCore; | ||||||
|  | using KonSoft.Shared.Hosting; | ||||||
|  | using Volo.Abp.Caching; | ||||||
|  | using Volo.Abp.Modularity; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Shared.DbMigrator; | ||||||
|  |  | ||||||
|  | [DependsOn( | ||||||
|  |     typeof(KonSoftSharedHostingModule), | ||||||
|  |     typeof(AdminEntityFrameworkCoreModule), | ||||||
|  |     typeof(AdminApplicationContractsModule) | ||||||
|  |     )] | ||||||
|  | public class KonSoftSharedDbMigratorModule : AbpModule | ||||||
|  | { | ||||||
|  |     public override void ConfigureServices(ServiceConfigurationContext context) | ||||||
|  |     { | ||||||
|  |         Configure<AbpDistributedCacheOptions>(options => { options.KeyPrefix = "KonSoft:"; }); | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -0,0 +1,19 @@ | |||||||
|  | using System; | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using System.Linq; | ||||||
|  | using System.Text; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Shared.DbMigrator.OpenIddict | ||||||
|  | { | ||||||
|  |     public class OpenIddictApplicationOptions | ||||||
|  |     { | ||||||
|  |         public string Name { get; set; } | ||||||
|  |         public string Type { get; set; } | ||||||
|  |         public string ConsentType { get; set; } | ||||||
|  |         public string DisplayName { get; set; } | ||||||
|  |         public string? Secret { get; set; } | ||||||
|  |         public List<string> GrantTypes { get; set; } | ||||||
|  |         public string? PostLogoutRedirectUri { get; set; } | ||||||
|  |     } | ||||||
|  | } | ||||||
| @ -16,7 +16,7 @@ using Volo.Abp.OpenIddict.Scopes; | |||||||
| using Volo.Abp.PermissionManagement; | using Volo.Abp.PermissionManagement; | ||||||
| using Volo.Abp.Uow; | using Volo.Abp.Uow; | ||||||
| 
 | 
 | ||||||
| namespace KonSoft.Admin.OpenIddict; | namespace KonSoft.Shared.DbMigrator.OpenIddict; | ||||||
| 
 | 
 | ||||||
| /* Creates initial data that is needed to property run the application | /* Creates initial data that is needed to property run the application | ||||||
|  * and make client-to-server communication possible. |  * and make client-to-server communication possible. | ||||||
| @ -62,7 +62,49 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep | |||||||
|         { |         { | ||||||
|             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor |             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor | ||||||
|             { |             { | ||||||
|                 Name = "Admin", DisplayName = "Admin API", Resources = { "Admin" } |                 Name = "Admin", | ||||||
|  |                 DisplayName = "Admin API", | ||||||
|  |                 Resources = { "Admin" } | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (await _openIddictScopeRepository.FindByNameAsync("Dispatch") == null) | ||||||
|  |         { | ||||||
|  |             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor | ||||||
|  |             { | ||||||
|  |                 Name = "Dispatch", | ||||||
|  |                 DisplayName = "Dispatch API", | ||||||
|  |                 Resources = { "Dispatch" } | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (await _openIddictScopeRepository.FindByNameAsync("Payment") == null) | ||||||
|  |         { | ||||||
|  |             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor | ||||||
|  |             { | ||||||
|  |                 Name = "Payment", | ||||||
|  |                 DisplayName = "Payment API", | ||||||
|  |                 Resources = { "Payment" } | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (await _openIddictScopeRepository.FindByNameAsync("Report") == null) | ||||||
|  |         { | ||||||
|  |             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor | ||||||
|  |             { | ||||||
|  |                 Name = "Report", | ||||||
|  |                 DisplayName = "Report API", | ||||||
|  |                 Resources = { "Report" } | ||||||
|  |             }); | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         if (await _openIddictScopeRepository.FindByNameAsync("TenantManagement") == null) | ||||||
|  |         { | ||||||
|  |             await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor | ||||||
|  |             { | ||||||
|  |                 Name = "TenantManagement", | ||||||
|  |                 DisplayName = "TenantManagement API", | ||||||
|  |                 Resources = { "TenantManagement" } | ||||||
|             }); |             }); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| @ -76,29 +118,20 @@ public class OpenIddictDataSeedContributor : IDataSeedContributor, ITransientDep | |||||||
|             OpenIddictConstants.Permissions.Scopes.Phone, |             OpenIddictConstants.Permissions.Scopes.Phone, | ||||||
|             OpenIddictConstants.Permissions.Scopes.Profile, |             OpenIddictConstants.Permissions.Scopes.Profile, | ||||||
|             OpenIddictConstants.Permissions.Scopes.Roles, |             OpenIddictConstants.Permissions.Scopes.Roles, | ||||||
|             "Admin" |             "Admin", | ||||||
|  |             "Dispatch", | ||||||
|  |             "Payment", | ||||||
|  |             "Report", | ||||||
|  |             "TenantManagement" | ||||||
|         }; |         }; | ||||||
| 
 | 
 | ||||||
|         var configurationSection = _configuration.GetSection("OpenIddict:Applications"); |         var apps = new List<OpenIddictApplicationOptions>(); | ||||||
| 
 |         _configuration.GetSection("OpenIddict:Applications").Bind(apps); | ||||||
| 
 |         foreach (var openIddictApplication in apps) | ||||||
|         // Swagger Client |  | ||||||
|         var swaggerClientId = configurationSection["Admin_Swagger:ClientId"]; |  | ||||||
|         if (!swaggerClientId.IsNullOrWhiteSpace()) |  | ||||||
|         { |         { | ||||||
|             var swaggerRootUrl = configurationSection["Admin_Swagger:RootUrl"]?.TrimEnd('/'); |             await CreateApplicationAsync(openIddictApplication.Name, openIddictApplication.Type, | ||||||
| 
 |                 openIddictApplication.ConsentType, openIddictApplication.DisplayName, openIddictApplication.Secret, | ||||||
|             await CreateApplicationAsync( |                 openIddictApplication.GrantTypes, commonScopes, openIddictApplication.PostLogoutRedirectUri); | ||||||
|                 swaggerClientId!, |  | ||||||
|                 OpenIddictConstants.ClientTypes.Public, |  | ||||||
|                 OpenIddictConstants.ConsentTypes.Implicit, |  | ||||||
|                 "Swagger Application", |  | ||||||
|                 null, |  | ||||||
|                 [OpenIddictConstants.GrantTypes.AuthorizationCode], |  | ||||||
|                 commonScopes, |  | ||||||
|                 redirectUri: $"{swaggerRootUrl}/swagger/oauth2-redirect.html", |  | ||||||
|                 clientUri: swaggerRootUrl |  | ||||||
|             ); |  | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
							
								
								
									
										44
									
								
								shared/KonSoft.Shared.DbMigrator/Program.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										44
									
								
								shared/KonSoft.Shared.DbMigrator/Program.cs
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,44 @@ | |||||||
|  | using Microsoft.Extensions.DependencyInjection; | ||||||
|  | using Microsoft.Extensions.Hosting; | ||||||
|  | using Microsoft.Extensions.Logging; | ||||||
|  | using Serilog; | ||||||
|  | using Serilog.Events; | ||||||
|  | using System; | ||||||
|  | using System.Threading.Tasks; | ||||||
|  |  | ||||||
|  | namespace KonSoft.Shared.DbMigrator; | ||||||
|  |  | ||||||
|  | class Program | ||||||
|  | { | ||||||
|  |     static async Task Main(string[] args) | ||||||
|  |     { | ||||||
|  |         Log.Logger = new LoggerConfiguration() | ||||||
|  |             .MinimumLevel.Information() | ||||||
|  |             .MinimumLevel.Override("Microsoft", LogEventLevel.Warning) | ||||||
|  |             .MinimumLevel.Override("Volo.Abp", LogEventLevel.Warning) | ||||||
|  | #if DEBUG | ||||||
|  |             .MinimumLevel.Override("KonSoft.Clean", LogEventLevel.Debug) | ||||||
|  | #else | ||||||
|  |             .MinimumLevel.Override("KonSoft.Clean", LogEventLevel.Information) | ||||||
|  | #endif | ||||||
|  |             .Enrich.FromLogContext() | ||||||
|  |             .WriteTo.Async(c => c.File("Logs/logs.txt")) | ||||||
|  |             .WriteTo.Async(c => c.Console()) | ||||||
|  |             .CreateLogger(); | ||||||
|  |  | ||||||
|  |         await CreateHostBuilder(args).RunConsoleAsync(); | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     private static IHostBuilder CreateHostBuilder(string[] args) => | ||||||
|  |         Host.CreateDefaultBuilder(args) | ||||||
|  |             .UseAgileConfig(options => | ||||||
|  |             { | ||||||
|  |                 options.ENV = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; | ||||||
|  |             }) | ||||||
|  |             .AddAppSettingsSecretsJson() | ||||||
|  |             .ConfigureLogging((context, logging) => logging.ClearProviders()) | ||||||
|  |             .ConfigureServices((hostContext, services) => | ||||||
|  |             { | ||||||
|  |                 services.AddHostedService<DbMigratorHostedService>(); | ||||||
|  |             }); | ||||||
|  | } | ||||||
| @ -0,0 +1,7 @@ | |||||||
|  | { | ||||||
|  |   "profiles": { | ||||||
|  |     "KonSoft.SnowClub.DbMigrator": { | ||||||
|  |       "commandName": "Project" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								shared/KonSoft.Shared.DbMigrator/appsettings.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								shared/KonSoft.Shared.DbMigrator/appsettings.json
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,8 @@ | |||||||
|  | { | ||||||
|  |   "AgileConfig": { | ||||||
|  |     "appId": "KonSoft.Shared.DbMigrator", | ||||||
|  |     "name": "KonSoft.Shared.DbMigrator", | ||||||
|  |     "nodes": "https://config.konsoft.top/", | ||||||
|  |     "secret": "DBE31703-14F9-4B01-893D-900B8380CE04" | ||||||
|  |   } | ||||||
|  | } | ||||||
| @ -1,5 +1,4 @@ | |||||||
| using Microsoft.AspNetCore.Builder; | using Microsoft.AspNetCore.Builder; | ||||||
| using Microsoft.AspNetCore.Hosting; |  | ||||||
| using Microsoft.Extensions.DependencyInjection; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using Microsoft.Extensions.Hosting; | using Microsoft.Extensions.Hosting; | ||||||
| using Serilog; | using Serilog; | ||||||
| @ -15,13 +14,12 @@ public static class ApplicationBuilderHelper | |||||||
|         where TStartupModule : IAbpModule |         where TStartupModule : IAbpModule | ||||||
|     { |     { | ||||||
|         var builder = WebApplication.CreateBuilder(args); |         var builder = WebApplication.CreateBuilder(args); | ||||||
|         builder.Configuration |  | ||||||
|             .AddAgileConfig(option => |  | ||||||
|             { |  | ||||||
|                 option.ENV = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; |  | ||||||
|             }); |  | ||||||
|         builder.Host |         builder.Host | ||||||
|             .AddAppSettingsSecretsJson() |             .AddAppSettingsSecretsJson() | ||||||
|  |             .UseAgileConfig(options => | ||||||
|  |             { | ||||||
|  |                 options.ENV = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") ?? "Development"; | ||||||
|  |             }) | ||||||
|             .UseAutofac() |             .UseAutofac() | ||||||
|             .UseSerilog(); |             .UseSerilog(); | ||||||
|  |  | ||||||
|  | |||||||
| @ -1,4 +1,5 @@ | |||||||
| using KonSoft.Shared.Localization; | using KonSoft.Shared.Localization; | ||||||
|  | using Volo.Abp; | ||||||
| using Volo.Abp.AspNetCore.Serilog; | using Volo.Abp.AspNetCore.Serilog; | ||||||
| using Volo.Abp.Modularity; | using Volo.Abp.Modularity; | ||||||
| using Volo.Abp.MultiTenancy; | using Volo.Abp.MultiTenancy; | ||||||
|  | |||||||
| @ -6,6 +6,10 @@ | |||||||
| 	  <Nullable>enable</Nullable> | 	  <Nullable>enable</Nullable> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|  |  | ||||||
|  |   <ItemGroup> | ||||||
|  |     <PackageReference Include="Yarp.ReverseProxy" Version="2.3.0" /> | ||||||
|  |   </ItemGroup> | ||||||
|  |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <ProjectReference Include="..\KonSoft.Shared.Hosting.AspNetCore\KonSoft.Shared.Hosting.AspNetCore.csproj" /> |     <ProjectReference Include="..\KonSoft.Shared.Hosting.AspNetCore\KonSoft.Shared.Hosting.AspNetCore.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  | |||||||
| @ -56,13 +56,14 @@ public class KonSoftSharedHostingMicroservicesModule : AbpModule | |||||||
|         ServiceConfigurationContext context, |         ServiceConfigurationContext context, | ||||||
|         IConfiguration configuration) |         IConfiguration configuration) | ||||||
|     { |     { | ||||||
|  |         var redisConnStr = configuration["Redis:Configuration"]!; | ||||||
|         context.Services.AddDataProtection().SetApplicationName("KonSoft") |         context.Services.AddDataProtection().SetApplicationName("KonSoft") | ||||||
|             .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!), |             .PersistKeysToStackExchangeRedis(ConnectionMultiplexer.Connect(redisConnStr), | ||||||
|                 "KonSoft-Protection-Keys"); |                 "KonSoft-Protection-Keys"); | ||||||
|  |  | ||||||
|         context.Services.AddSingleton<IDistributedLockProvider>(_ => |         context.Services.AddSingleton<IDistributedLockProvider>(_ => | ||||||
|             new RedisDistributedSynchronizationProvider(ConnectionMultiplexer |             new RedisDistributedSynchronizationProvider(ConnectionMultiplexer | ||||||
|                 .Connect(configuration["Redis:Configuration"]!).GetDatabase())); |                 .Connect(redisConnStr).GetDatabase())); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) |     private void ConfigureAuthentication(ServiceConfigurationContext context, IConfiguration configuration) | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	