Browse Source

using System.Text.Json

pull/275/head
cKey 5 years ago
parent
commit
22c2e01b80
  1. 21
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 14
      aspnet-core/LINGYUN.MicroService.Common.sln
  3. 2
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj
  4. 16
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs
  5. 23
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/JsonHubProtocolOptionsSetup.cs
  6. 6
      aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN/Abp/AspNetCore/SignalR/JwtToken/AbpAspNetCoreSignalRJwtTokenMapPathOptions.cs
  7. 3
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj
  8. 6
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml
  9. 18
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPExecutionFailedException.cs
  10. 45
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs
  11. 78
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs
  12. 2
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs
  13. 6
      aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml
  14. 15
      aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs
  15. 4
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj
  16. 3
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs
  17. 2
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs
  18. 18
      aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs
  19. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs
  20. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
  21. 5
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationOptions.cs
  22. 6
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs
  23. 34
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs
  24. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs
  25. 51
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEto.cs
  26. 1
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj
  27. 13
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs
  28. 7
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/ISnowflakeIdrGenerator.cs
  29. 21
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs
  30. 2
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdOptions.cs
  31. 6
      aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdrGenerator.cs
  32. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs
  33. 11
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs
  34. 27
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs
  35. 14
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs
  36. 7
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/ISnowflakeIdGenerator.cs
  37. 15
      aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs
  38. 15
      aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs
  39. 15
      aspnet-core/services/apigateway/LINGYUN.Abp.ApiGateway.Host/AbpApiGatewayHostModule.cs
  40. 15
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/ApiGatewayHostModule.cs
  41. 15
      aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs
  42. 28
      aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/AbpIdentityServerAdminHttpApiHostModule.cs
  43. 12
      aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/AbpLocalizationManagementHttpApiHostModule.cs
  44. 15
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs
  45. 9
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs
  46. 24
      aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs
  47. 15
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs
  48. 40
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DomainTenantResolveContributor.cs
  49. 50
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/HeaderTenantResolveContributor.cs
  50. 66
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/TenantConfigurationProvider.cs
  51. 48
      aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/TenantResolver.cs
  52. 1
      build/build-aspnetcore-release.ps1
  53. 84
      docker-compose.override.windows.yml
  54. 112
      docker-compose.override.yml
  55. 112
      docker-compose.yml

21
aspnet-core/LINGYUN.MicroService.All.sln

@ -115,8 +115,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Storag
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs.Hangfire", "modules\common\LINGYUN.Abp.BackgroundJobs.Hangfire\LINGYUN.Abp.BackgroundJobs.Hangfire.csproj", "{5CF403B2-47C9-4E4E-8856-0294BDD64884}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs.Hangfire", "modules\common\LINGYUN.Abp.BackgroundJobs.Hangfire\LINGYUN.Abp.BackgroundJobs.Hangfire.csproj", "{5CF403B2-47C9-4E4E-8856-0294BDD64884}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs", "modules\common\LINGYUN.Abp.BackgroundJobs\LINGYUN.Abp.BackgroundJobs.csproj", "{8A22674D-151D-474E-8C99-9D991C0D8297}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun", "modules\common\LINGYUN.Abp.BlobStoring.Aliyun\LINGYUN.Abp.BlobStoring.Aliyun.csproj", "{059473BA-FAF9-405F-9985-33DDCA2E9F0D}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun", "modules\common\LINGYUN.Abp.BlobStoring.Aliyun\LINGYUN.Abp.BlobStoring.Aliyun.csproj", "{059473BA-FAF9-405F-9985-33DDCA2E9F0D}"
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}"
@ -331,6 +329,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Http
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.ApiGateway.Host", "services\apigateway\LINGYUN.Abp.ApiGateway.Host\LINGYUN.Abp.ApiGateway.Host.csproj", "{A320E23E-792D-4736-B963-381F9D7AF605}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.ApiGateway.Host", "services\apigateway\LINGYUN.Abp.ApiGateway.Host\LINGYUN.Abp.ApiGateway.Host.csproj", "{A320E23E-792D-4736-B963-381F9D7AF605}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundWorkers.Hangfire", "modules\common\LINGYUN.Abp.BackgroundWorkers.Hangfire\LINGYUN.Abp.BackgroundWorkers.Hangfire.csproj", "{60D0BEF2-FEAF-4066-8377-6C873CB24858}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Hangfire.Dashboard", "modules\common\LINGYUN.Abp.Hangfire.Dashboard\LINGYUN.Abp.Hangfire.Dashboard.csproj", "{340BE5AC-68EC-41A5-9D0D-266037C58F13}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -509,10 +511,6 @@ Global
{5CF403B2-47C9-4E4E-8856-0294BDD64884}.Debug|Any CPU.Build.0 = Debug|Any CPU {5CF403B2-47C9-4E4E-8856-0294BDD64884}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5CF403B2-47C9-4E4E-8856-0294BDD64884}.Release|Any CPU.ActiveCfg = Release|Any CPU {5CF403B2-47C9-4E4E-8856-0294BDD64884}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5CF403B2-47C9-4E4E-8856-0294BDD64884}.Release|Any CPU.Build.0 = Release|Any CPU {5CF403B2-47C9-4E4E-8856-0294BDD64884}.Release|Any CPU.Build.0 = Release|Any CPU
{8A22674D-151D-474E-8C99-9D991C0D8297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A22674D-151D-474E-8C99-9D991C0D8297}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A22674D-151D-474E-8C99-9D991C0D8297}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A22674D-151D-474E-8C99-9D991C0D8297}.Release|Any CPU.Build.0 = Release|Any CPU
{059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU {059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU {059473BA-FAF9-405F-9985-33DDCA2E9F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -865,6 +863,14 @@ Global
{A320E23E-792D-4736-B963-381F9D7AF605}.Debug|Any CPU.Build.0 = Debug|Any CPU {A320E23E-792D-4736-B963-381F9D7AF605}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.ActiveCfg = Release|Any CPU {A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.Build.0 = Release|Any CPU {A320E23E-792D-4736-B963-381F9D7AF605}.Release|Any CPU.Build.0 = Release|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Debug|Any CPU.Build.0 = Debug|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Release|Any CPU.ActiveCfg = Release|Any CPU
{60D0BEF2-FEAF-4066-8377-6C873CB24858}.Release|Any CPU.Build.0 = Release|Any CPU
{340BE5AC-68EC-41A5-9D0D-266037C58F13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{340BE5AC-68EC-41A5-9D0D-266037C58F13}.Debug|Any CPU.Build.0 = Debug|Any CPU
{340BE5AC-68EC-41A5-9D0D-266037C58F13}.Release|Any CPU.ActiveCfg = Release|Any CPU
{340BE5AC-68EC-41A5-9D0D-266037C58F13}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -924,7 +930,6 @@ Global
{47CC8F7A-681D-42B9-AE04-78453782C1B6} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {47CC8F7A-681D-42B9-AE04-78453782C1B6} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {F595CB9F-B117-4D62-A1AE-48599927DB36} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {5CF403B2-47C9-4E4E-8856-0294BDD64884} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{8A22674D-151D-474E-8C99-9D991C0D8297} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{059473BA-FAF9-405F-9985-33DDCA2E9F0D} = {14CDBAD1-10C8-464A-B445-1F727C988010} {059473BA-FAF9-405F-9985-33DDCA2E9F0D} = {14CDBAD1-10C8-464A-B445-1F727C988010}
{B39B5FB6-E7B9-4A13-8FFA-FC7FEED4371B} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F} {B39B5FB6-E7B9-4A13-8FFA-FC7FEED4371B} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{C8A00439-5B8D-4923-8FAA-AB75E2A786ED} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F} {C8A00439-5B8D-4923-8FAA-AB75E2A786ED} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
@ -1028,6 +1033,8 @@ Global
{8EF31071-3521-409D-9740-BBFBFC04C50E} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F} {8EF31071-3521-409D-9740-BBFBFC04C50E} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{13219C1C-23E1-4EBA-93FB-86830C93A800} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E} {13219C1C-23E1-4EBA-93FB-86830C93A800} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{A320E23E-792D-4736-B963-381F9D7AF605} = {19E6BD61-062B-4FAD-A51A-B55F5CE88B7A} {A320E23E-792D-4736-B963-381F9D7AF605} = {19E6BD61-062B-4FAD-A51A-B55F5CE88B7A}
{60D0BEF2-FEAF-4066-8377-6C873CB24858} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{340BE5AC-68EC-41A5-9D0D-266037C58F13} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718} SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

14
aspnet-core/LINGYUN.MicroService.Common.sln

@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Sign
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.SignalR.JwtToken", "modules\common\LINGYUN.Abp.AspNetCore.SignalR\LINGYUN.Abp.AspNetCore.SignalR.JwtToken.csproj", "{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs", "modules\common\LINGYUN.Abp.BackgroundJobs\LINGYUN.Abp.BackgroundJobs.csproj", "{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs.Hangfire", "modules\common\LINGYUN.Abp.BackgroundJobs.Hangfire\LINGYUN.Abp.BackgroundJobs.Hangfire.csproj", "{492710E6-EEF5-4390-A474-8FB2412ECBE5}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundJobs.Hangfire", "modules\common\LINGYUN.Abp.BackgroundJobs.Hangfire\LINGYUN.Abp.BackgroundJobs.Hangfire.csproj", "{492710E6-EEF5-4390-A474-8FB2412ECBE5}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun", "modules\common\LINGYUN.Abp.BlobStoring.Aliyun\LINGYUN.Abp.BlobStoring.Aliyun.csproj", "{CCF1EB86-29BD-4531-BB27-C9111CC67570}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BlobStoring.Aliyun", "modules\common\LINGYUN.Abp.BlobStoring.Aliyun\LINGYUN.Abp.BlobStoring.Aliyun.csproj", "{CCF1EB86-29BD-4531-BB27-C9111CC67570}"
@ -156,6 +154,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dapr.Actors.Tes
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.HttpOverrides", "modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj", "{191BB108-546E-4E70-978E-D6A8149C319C}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.HttpOverrides", "modules\common\LINGYUN.Abp.AspNetCore.HttpOverrides\LINGYUN.Abp.AspNetCore.HttpOverrides.csproj", "{191BB108-546E-4E70-978E-D6A8149C319C}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IM.SignalR", "modules\common\LINGYUN.Abp.IM.SignalR\LINGYUN.Abp.IM.SignalR.csproj", "{DEB98AD7-9630-4F32-89E6-C1A118D1D18C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -182,10 +182,6 @@ Global
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Debug|Any CPU.Build.0 = Debug|Any CPU {304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.ActiveCfg = Release|Any CPU {304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.Build.0 = Release|Any CPU {304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC}.Release|Any CPU.Build.0 = Release|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8}.Release|Any CPU.Build.0 = Release|Any CPU
{492710E6-EEF5-4390-A474-8FB2412ECBE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {492710E6-EEF5-4390-A474-8FB2412ECBE5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{492710E6-EEF5-4390-A474-8FB2412ECBE5}.Debug|Any CPU.Build.0 = Debug|Any CPU {492710E6-EEF5-4390-A474-8FB2412ECBE5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{492710E6-EEF5-4390-A474-8FB2412ECBE5}.Release|Any CPU.ActiveCfg = Release|Any CPU {492710E6-EEF5-4390-A474-8FB2412ECBE5}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -406,6 +402,10 @@ Global
{191BB108-546E-4E70-978E-D6A8149C319C}.Debug|Any CPU.Build.0 = Debug|Any CPU {191BB108-546E-4E70-978E-D6A8149C319C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{191BB108-546E-4E70-978E-D6A8149C319C}.Release|Any CPU.ActiveCfg = Release|Any CPU {191BB108-546E-4E70-978E-D6A8149C319C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{191BB108-546E-4E70-978E-D6A8149C319C}.Release|Any CPU.Build.0 = Release|Any CPU {191BB108-546E-4E70-978E-D6A8149C319C}.Release|Any CPU.Build.0 = Release|Any CPU
{DEB98AD7-9630-4F32-89E6-C1A118D1D18C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEB98AD7-9630-4F32-89E6-C1A118D1D18C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEB98AD7-9630-4F32-89E6-C1A118D1D18C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEB98AD7-9630-4F32-89E6-C1A118D1D18C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -417,7 +417,6 @@ Global
{824CB367-383B-48B2-972D-33923438A9A0} = {B91F26C5-B148-4094-B5F1-71E5F945DBED} {824CB367-383B-48B2-972D-33923438A9A0} = {B91F26C5-B148-4094-B5F1-71E5F945DBED}
{E9AEC9D6-1FE7-4B00-BAC5-2C3D4B63CCA2} = {E2E7A062-0ABB-41B4-8220-60228446D2C2} {E9AEC9D6-1FE7-4B00-BAC5-2C3D4B63CCA2} = {E2E7A062-0ABB-41B4-8220-60228446D2C2}
{304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC} = {E2E7A062-0ABB-41B4-8220-60228446D2C2} {304D06E6-41EC-4DCB-AEAE-DBEEC75F9ADC} = {E2E7A062-0ABB-41B4-8220-60228446D2C2}
{FFC21AA5-8DCF-4514-95F0-9A1D428095F8} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{492710E6-EEF5-4390-A474-8FB2412ECBE5} = {086BE5BE-8594-4DA7-8819-935FEF76DABD} {492710E6-EEF5-4390-A474-8FB2412ECBE5} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{CCF1EB86-29BD-4531-BB27-C9111CC67570} = {7F18BCA5-35BD-41FB-8EFF-801B56E5E414} {CCF1EB86-29BD-4531-BB27-C9111CC67570} = {7F18BCA5-35BD-41FB-8EFF-801B56E5E414}
{4BD715F2-D117-45FB-B26C-F92D912144C7} = {086BE5BE-8594-4DA7-8819-935FEF76DABD} {4BD715F2-D117-45FB-B26C-F92D912144C7} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
@ -484,6 +483,7 @@ Global
{8968EDAF-9F5C-4786-AF2A-D3928B70C3EC} = {B86C21A4-73B7-471E-B73A-B4B905EC9435} {8968EDAF-9F5C-4786-AF2A-D3928B70C3EC} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{CF30221B-CA7A-42CD-B91A-B7224AB2F38B} = {B86C21A4-73B7-471E-B73A-B4B905EC9435} {CF30221B-CA7A-42CD-B91A-B7224AB2F38B} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{191BB108-546E-4E70-978E-D6A8149C319C} = {086BE5BE-8594-4DA7-8819-935FEF76DABD} {191BB108-546E-4E70-978E-D6A8149C319C} = {086BE5BE-8594-4DA7-8819-935FEF76DABD}
{DEB98AD7-9630-4F32-89E6-C1A118D1D18C} = {B91F26C5-B148-4094-B5F1-71E5F945DBED}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8} SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

2
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json.csproj

@ -8,7 +8,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" Version="5.0.0" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="5.0.*" />
<PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.3.0" /> <PackageReference Include="Volo.Abp.AspNetCore.SignalR" Version="4.3.0" />
</ItemGroup> </ItemGroup>

16
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/AbpAspNetCoreSignalRProtocolJsonModule.cs

@ -1,7 +1,7 @@
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.AspNetCore.SignalR.Protocol;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
using Volo.Abp.AspNetCore.SignalR; using Volo.Abp.AspNetCore.SignalR;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
@ -11,12 +11,18 @@ namespace LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json
typeof(AbpAspNetCoreSignalRModule))] typeof(AbpAspNetCoreSignalRModule))]
public class AbpAspNetCoreSignalRProtocolJsonModule : AbpModule public class AbpAspNetCoreSignalRProtocolJsonModule : AbpModule
{ {
public override void ConfigureServices(ServiceConfigurationContext context) public override void PreConfigureServices(ServiceConfigurationContext context)
{
PreConfigure<ISignalRServerBuilder>(builder =>
{ {
var newtonsoftJsonOptions = new NewtonsoftJsonHubProtocolOptions(); builder.AddJsonProtocol();
context.Services.ExecutePreConfiguredActions(newtonsoftJsonOptions); });
}
context.Services.TryAddEnumerable(ServiceDescriptor.Singleton<IHubProtocol, NewtonsoftJsonHubProtocol>()); public override void ConfigureServices(ServiceConfigurationContext context)
{
context.Services.TryAddEnumerable(ServiceDescriptor
.Transient<IConfigureOptions<JsonHubProtocolOptions>, JsonHubProtocolOptionsSetup>());
} }
} }
} }

23
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json/LINGYUN/Abp/AspNetCore/SignalR/Protocol/Json/JsonHubProtocolOptionsSetup.cs

@ -0,0 +1,23 @@
using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using Volo.Abp.Json.SystemTextJson;
namespace LINGYUN.Abp.AspNetCore.SignalR.Protocol.Json
{
public class JsonHubProtocolOptionsSetup : IConfigureOptions<JsonHubProtocolOptions>
{
protected IServiceProvider ServiceProvider { get; }
public JsonHubProtocolOptionsSetup(IServiceProvider serviceProvider)
{
ServiceProvider = serviceProvider;
}
public void Configure(JsonHubProtocolOptions options)
{
options.PayloadSerializerOptions = ServiceProvider.GetRequiredService<IOptions<AbpSystemTextJsonSerializerOptions>>().Value.JsonSerializerOptions;
}
}
}

6
aspnet-core/modules/common/LINGYUN.Abp.AspNetCore.SignalR/LINGYUN/Abp/AspNetCore/SignalR/JwtToken/AbpAspNetCoreSignalRJwtTokenMapPathOptions.cs

@ -4,21 +4,23 @@ namespace LINGYUN.Abp.AspNetCore.SignalR.JwtToken
{ {
public class AbpAspNetCoreSignalRJwtTokenMapPathOptions public class AbpAspNetCoreSignalRJwtTokenMapPathOptions
{ {
public string PrefixHubPath { get; set; }
public List<string> MapJwtTokenPaths { get; set; } public List<string> MapJwtTokenPaths { get; set; }
public AbpAspNetCoreSignalRJwtTokenMapPathOptions() public AbpAspNetCoreSignalRJwtTokenMapPathOptions()
{ {
PrefixHubPath = "/signalr-hubs/";
MapJwtTokenPaths = new List<string>(); MapJwtTokenPaths = new List<string>();
} }
public void MapPath(string path) public void MapPath(string path)
{ {
if (path.StartsWith("/signalr-hubs/")) if (path.StartsWith(PrefixHubPath))
{ {
MapJwtTokenPaths.AddIfNotContains(path); MapJwtTokenPaths.AddIfNotContains(path);
} }
else else
{ {
MapJwtTokenPaths.AddIfNotContains($"/signalr-hubs/{path}"); MapJwtTokenPaths.AddIfNotContains($"{PrefixHubPath}{path}");
} }
} }
} }

3
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.csproj

@ -11,9 +11,10 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="DotNetCore.CAP" Version="5.0.3" /> <PackageReference Include="DotNetCore.CAP" Version="5.1.0" />
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" /> <PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" />
<PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" /> <PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" />
<PackageReference Include="Volo.Abp.Json" Version="4.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

6
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml

@ -169,14 +169,14 @@
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
</member> </member>
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String)"> <member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String)">
<summary> <summary>
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
<param name="message"></param> <param name="message"></param>
</member> </member>
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String,System.Exception)"> <member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String,System.Exception)">
@ -184,7 +184,7 @@
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
<param name="message"></param> <param name="message"></param>
<param name="innerException"></param> <param name="innerException"></param>
</member> </member>

18
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPExecutionFailedException.cs

@ -21,36 +21,36 @@ namespace LINGYUN.Abp.EventBus.CAP
/// constructor /// constructor
/// </summary> /// </summary>
/// <param name="messageType"></param> /// <param name="messageType"></param>
/// <param name="prigin"></param> /// <param name="origin"></param>
public AbpCAPExecutionFailedException(MessageType messageType, Message prigin) public AbpCAPExecutionFailedException(MessageType messageType, Message origin)
{ {
MessageType = messageType; MessageType = messageType;
Origin = prigin; Origin = origin;
} }
/// <summary> /// <summary>
/// constructor /// constructor
/// </summary> /// </summary>
/// <param name="messageType"></param> /// <param name="messageType"></param>
/// <param name="prigin"></param> /// <param name="origin"></param>
/// <param name="message"></param> /// <param name="message"></param>
public AbpCAPExecutionFailedException(MessageType messageType, Message prigin, string message) : base(message) public AbpCAPExecutionFailedException(MessageType messageType, Message origin, string message) : base(message)
{ {
MessageType = messageType; MessageType = messageType;
Origin = prigin; Origin = origin;
} }
/// <summary> /// <summary>
/// constructor /// constructor
/// </summary> /// </summary>
/// <param name="messageType"></param> /// <param name="messageType"></param>
/// <param name="prigin"></param> /// <param name="origin"></param>
/// <param name="message"></param> /// <param name="message"></param>
/// <param name="innerException"></param> /// <param name="innerException"></param>
public AbpCAPExecutionFailedException(MessageType messageType, Message prigin, string message, Exception innerException) : base(message, innerException) public AbpCAPExecutionFailedException(MessageType messageType, Message origin, string message, Exception innerException) : base(message, innerException)
{ {
MessageType = messageType; MessageType = messageType;
Origin = prigin; Origin = origin;
} }
} }
} }

45
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCAPSubscribeInvoker.cs

@ -1,4 +1,5 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using DotNetCore.CAP.Filter;
using DotNetCore.CAP.Internal; using DotNetCore.CAP.Internal;
using DotNetCore.CAP.Messages; using DotNetCore.CAP.Messages;
using DotNetCore.CAP.Serialization; using DotNetCore.CAP.Serialization;
@ -137,7 +138,49 @@ namespace LINGYUN.Abp.EventBus.CAP
// 改变租户 // 改变租户
using (_currentTenant.Change(tenantId)) using (_currentTenant.Change(tenantId))
{ {
var resultObj = await ExecuteWithParameterAsync(executor, obj, executeParameters); var filter = provider.GetService<ISubscribeFilter>();
object resultObj = null;
try
{
if (filter != null)
{
var etContext = new ExecutingContext(context, executeParameters);
filter.OnSubscribeExecuting(etContext);
executeParameters = etContext.Arguments;
}
resultObj = await ExecuteWithParameterAsync(executor, obj, executeParameters);
if (filter != null)
{
var edContext = new ExecutedContext(context, resultObj);
filter.OnSubscribeExecuted(edContext);
resultObj = edContext.Result;
}
}
catch (Exception e)
{
if (filter != null)
{
var exContext = new ExceptionContext(context, e);
filter.OnSubscribeException(exContext);
if (!exContext.ExceptionHandled)
{
throw exContext.Exception;
}
if (exContext.Result != null)
{
resultObj = exContext.Result;
}
}
else
{
throw;
}
}
return new ConsumerExecutedResult(resultObj, message.GetId(), message.GetCallbackName()); return new ConsumerExecutedResult(resultObj, message.GetId(), message.GetCallbackName());
} }
} }

78
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/AbpCapSerializer.cs

@ -0,0 +1,78 @@
using DotNetCore.CAP.Messages;
using DotNetCore.CAP.Serialization;
using Microsoft.Extensions.Options;
using System;
using System.Buffers;
using System.Text.Json;
using System.Threading.Tasks;
using Volo.Abp.Json.SystemTextJson;
namespace LINGYUN.Abp.EventBus.CAP
{
public class AbpCapSerializer : ISerializer
{
private readonly AbpSystemTextJsonSerializerOptions _jsonSerializerOptions;
public AbpCapSerializer(IOptions<AbpSystemTextJsonSerializerOptions> options)
{
_jsonSerializerOptions = options.Value;
}
public Task<TransportMessage> SerializeAsync(Message message)
{
if (message == null)
{
throw new ArgumentNullException(nameof(message));
}
if (message.Value == null)
{
return Task.FromResult(new TransportMessage(message.Headers, null));
}
var jsonBytes = JsonSerializer.SerializeToUtf8Bytes(message.Value, _jsonSerializerOptions.JsonSerializerOptions);
return Task.FromResult(new TransportMessage(message.Headers, jsonBytes));
}
public Task<Message> DeserializeAsync(TransportMessage transportMessage, Type valueType)
{
if (valueType == null || transportMessage.Body == null)
{
return Task.FromResult(new Message(transportMessage.Headers, null));
}
var obj = JsonSerializer.Deserialize(transportMessage.Body, valueType, _jsonSerializerOptions.JsonSerializerOptions);
return Task.FromResult(new Message(transportMessage.Headers, obj));
}
public string Serialize(Message message)
{
return JsonSerializer.Serialize(message, _jsonSerializerOptions.JsonSerializerOptions);
}
public Message Deserialize(string json)
{
return JsonSerializer.Deserialize<Message>(json, _jsonSerializerOptions.JsonSerializerOptions);
}
public object Deserialize(object value, Type valueType)
{
if (value is JsonElement jToken)
{
var bufferWriter = new ArrayBufferWriter<byte>();
using (var writer = new Utf8JsonWriter(bufferWriter))
{
jToken.WriteTo(writer);
}
return JsonSerializer.Deserialize(bufferWriter.WrittenSpan, valueType, _jsonSerializerOptions.JsonSerializerOptions);
}
throw new NotSupportedException("Type is not of type JToken");
}
public bool IsJsonType(object jsonObject)
{
return jsonObject is JsonElement;
}
}
}

2
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/Microsoft/Extensions/DependencyInjection/ServiceCollectionExtensions.cs

@ -1,6 +1,7 @@
using DotNetCore.CAP; using DotNetCore.CAP;
using DotNetCore.CAP.Internal; using DotNetCore.CAP.Internal;
using DotNetCore.CAP.Processor; using DotNetCore.CAP.Processor;
using DotNetCore.CAP.Serialization;
using LINGYUN.Abp.EventBus.CAP; using LINGYUN.Abp.EventBus.CAP;
using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.DependencyInjection.Extensions;
using System; using System;
@ -34,6 +35,7 @@ namespace Microsoft.Extensions.DependencyInjection
services.TryAddEnumerable(ServiceDescriptor.Singleton<IProcessingServer, AbpCapProcessingServer>()); services.TryAddEnumerable(ServiceDescriptor.Singleton<IProcessingServer, AbpCapProcessingServer>());
// 替换为自己的实现 // 替换为自己的实现
services.AddSingleton<ISubscribeInvoker, AbpCAPSubscribeInvoker>(); services.AddSingleton<ISubscribeInvoker, AbpCAPSubscribeInvoker>();
services.AddSingleton<ISerializer, AbpCapSerializer>();
return services; return services;
} }
} }

6
aspnet-core/modules/common/LINGYUN.Abp.EventBus.CAP/modules/common/LINGYUN.Abp.EventBus.CAP/LINGYUN.Abp.EventBus.CAP.xml

@ -169,14 +169,14 @@
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
</member> </member>
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String)"> <member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String)">
<summary> <summary>
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
<param name="message"></param> <param name="message"></param>
</member> </member>
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String,System.Exception)"> <member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String,System.Exception)">
@ -184,7 +184,7 @@
constructor constructor
</summary> </summary>
<param name="messageType"></param> <param name="messageType"></param>
<param name="prigin"></param> <param name="origin"></param>
<param name="message"></param> <param name="message"></param>
<param name="innerException"></param> <param name="innerException"></param>
</member> </member>

15
aspnet-core/modules/common/LINGYUN.Abp.IM.SignalR/LINGYUN/Abp/IM/SignalR/Messages/SignalRMessageSenderProvider.cs

@ -3,6 +3,7 @@ using LINGYUN.Abp.IM.SignalR.Hubs;
using LINGYUN.Abp.RealTime.Client; using LINGYUN.Abp.RealTime.Client;
using Microsoft.AspNetCore.SignalR; using Microsoft.AspNetCore.SignalR;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using System; using System;
using System.Collections.Immutable; using System.Collections.Immutable;
using System.Linq; using System.Linq;
@ -13,6 +14,7 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
public class SignalRMessageSenderProvider : MessageSenderProviderBase public class SignalRMessageSenderProvider : MessageSenderProviderBase
{ {
public override string Name => "SignalR"; public override string Name => "SignalR";
private readonly AbpIMSignalROptions _options;
private readonly IOnlineClientManager _onlineClientManager; private readonly IOnlineClientManager _onlineClientManager;
@ -21,9 +23,11 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
public SignalRMessageSenderProvider( public SignalRMessageSenderProvider(
IOnlineClientManager onlineClientManager, IOnlineClientManager onlineClientManager,
IHubContext<MessagesHub> hubContext, IHubContext<MessagesHub> hubContext,
IServiceProvider serviceProvider) IServiceProvider serviceProvider,
IOptions<AbpIMSignalROptions> options)
: base(serviceProvider) : base(serviceProvider)
{ {
_options = options.Value;
_hubContext = hubContext; _hubContext = hubContext;
_onlineClientManager = onlineClientManager; _onlineClientManager = onlineClientManager;
} }
@ -37,15 +41,16 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
return; return;
} }
await signalRClient.SendAsync("getChatMessage", chatMessage); await signalRClient.SendAsync(_options.GetChatMessageMethod, chatMessage);
} }
protected override async Task SendMessageToUserAsync(ChatMessage chatMessage) protected override async Task SendMessageToUserAsync(ChatMessage chatMessage)
{ {
var onlineClientContext = new OnlineClientContext(chatMessage.TenantId, chatMessage.ToUserId.Value);
var onlineClients = _onlineClientManager.GetAllByContext(onlineClientContext);
try try
{ {
var onlineClientContext = new OnlineClientContext(chatMessage.TenantId, chatMessage.ToUserId.Value);
var onlineClients = _onlineClientManager.GetAllByContext(onlineClientContext);
var onlineClientConnectionIds = onlineClients.Select(client => client.ConnectionId).ToImmutableArray(); var onlineClientConnectionIds = onlineClients.Select(client => client.ConnectionId).ToImmutableArray();
var signalRClients = _hubContext.Clients.Clients(onlineClientConnectionIds); var signalRClients = _hubContext.Clients.Clients(onlineClientConnectionIds);
if (signalRClients == null) if (signalRClients == null)
@ -53,7 +58,7 @@ namespace LINGYUN.Abp.IM.SignalR.Messages
Logger.LogDebug("Can not get user " + onlineClientContext.UserId + " connection from SignalR hub!"); Logger.LogDebug("Can not get user " + onlineClientContext.UserId + " connection from SignalR hub!");
return; return;
} }
await signalRClients.SendAsync("getChatMessage", chatMessage); await signalRClients.SendAsync(_options.GetChatMessageMethod, chatMessage);
} }
catch (Exception ex) catch (Exception ex)
{ {

4
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN.Abp.IM.csproj

@ -12,4 +12,8 @@
<PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" /> <PackageReference Include="Volo.Abp.EventBus" Version="4.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.RealTime\LINGYUN.Abp.RealTime.csproj" />
</ItemGroup>
</Project> </Project>

3
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/ChatMessage.cs

@ -2,10 +2,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
using Volo.Abp.EventBus;
using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending;
namespace LINGYUN.Abp.IM.Messages namespace LINGYUN.Abp.IM.Messages
{ {
[Serializable]
[EventName("im.message")]
public class ChatMessage : ExtensibleObject public class ChatMessage : ExtensibleObject
{ {
/// <summary> /// <summary>

2
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/IMessageSender.cs

@ -4,6 +4,6 @@ namespace LINGYUN.Abp.IM.Messages
{ {
public interface IMessageSender public interface IMessageSender
{ {
Task SendMessageAsync(ChatMessage chatMessage); Task<string> SendMessageAsync(ChatMessage chatMessage);
} }
} }

18
aspnet-core/modules/common/LINGYUN.Abp.IM/LINGYUN/Abp/IM/Messages/MessageSender.cs

@ -1,4 +1,5 @@
using System.Threading.Tasks; using LINGYUN.Abp.RealTime;
using System.Threading.Tasks;
using Volo.Abp.Data; using Volo.Abp.Data;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
using Volo.Abp.EventBus.Distributed; using Volo.Abp.EventBus.Distributed;
@ -8,19 +9,26 @@ namespace LINGYUN.Abp.IM.Messages
public class MessageSender : IMessageSender, ITransientDependency public class MessageSender : IMessageSender, ITransientDependency
{ {
protected IDistributedEventBus EventBus { get; } protected IDistributedEventBus EventBus { get; }
public MessageSender(IDistributedEventBus eventBus) protected ISnowflakeIdrGenerator SnowflakeIdrGenerator { get; }
public MessageSender(
IDistributedEventBus eventBus,
ISnowflakeIdrGenerator snowflakeIdrGenerator)
{ {
EventBus = eventBus; EventBus = eventBus;
SnowflakeIdrGenerator = snowflakeIdrGenerator;
} }
public virtual async Task SendMessageAsync(ChatMessage chatMessage) public virtual async Task<string> SendMessageAsync(ChatMessage chatMessage)
{ {
chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); chatMessage.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous);
chatMessage.MessageId = SnowflakeIdrGenerator.Create().ToString();
// 如果先存储的话,就紧耦合消息处理模块了 // 如果先存储的话,就紧耦合消息处理模块了
// await Store.StoreMessageAsync(chatMessage); // await Store.StoreMessageAsync(chatMessage);
var eto = new RealTimeEto<ChatMessage>(chatMessage);
await EventBus.PublishAsync(eto);
await EventBus.PublishAsync(chatMessage); return chatMessage.MessageId;
} }
} }
} }

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/SignalRNotificationPublishProvider.cs

@ -63,7 +63,7 @@ namespace LINGYUN.Abp.Notifications.SignalR
return; return;
} }
Logger.LogDebug($"Found a singalr client, begin senging notifications"); Logger.LogDebug($"Found a singalr client, begin senging notifications");
await signalRClients.SendAsync("getNotification", notification, cancellationToken); await signalRClients.SendAsync(_options.MethodName, notification, cancellationToken);
} }
catch (Exception ex) catch (Exception ex)
{ {

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj

@ -14,4 +14,8 @@
<PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" /> <PackageReference Include="Volo.Abp.BackgroundWorkers" Version="4.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.RealTime\LINGYUN.Abp.RealTime.csproj" />
</ItemGroup>
</Project> </Project>

5
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationOptions.cs

@ -5,10 +5,6 @@ namespace LINGYUN.Abp.Notifications
// TODO: 需要重命名 AbpNotificationsOptions // TODO: 需要重命名 AbpNotificationsOptions
public class AbpNotificationOptions public class AbpNotificationOptions
{ {
/// <summary>
/// 通知系统对于某个应用的定义
/// </summary>
public string Application { get; set; }
/// <summary> /// <summary>
/// 自定义通知集合 /// 自定义通知集合
/// </summary> /// </summary>
@ -23,7 +19,6 @@ namespace LINGYUN.Abp.Notifications
public NotificationDataMappingDictionary NotificationDataMappings { get; } public NotificationDataMappingDictionary NotificationDataMappings { get; }
public AbpNotificationOptions() public AbpNotificationOptions()
{ {
Application = "Abp";
PublishProviders = new TypeList<INotificationPublishProvider>(); PublishProviders = new TypeList<INotificationPublishProvider>();
DefinitionProviders = new TypeList<INotificationDefinitionProvider>(); DefinitionProviders = new TypeList<INotificationDefinitionProvider>();
NotificationDataMappings = new NotificationDataMappingDictionary(); NotificationDataMappings = new NotificationDataMappingDictionary();

6
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationSender.cs

@ -17,7 +17,8 @@ namespace LINGYUN.Abp.Notifications
/// <param name="userId">用户,为空标识发给所有订阅用户</param> /// <param name="userId">用户,为空标识发给所有订阅用户</param>
/// <param name="tenantId">租户</param> /// <param name="tenantId">租户</param>
/// <param name="severity">严重级别</param> /// <param name="severity">严重级别</param>
Task SendNofiterAsync( /// <returns>通知标识</returns>
Task<string> SendNofiterAsync(
string name, string name,
NotificationData data, NotificationData data,
UserIdentifier user = null, UserIdentifier user = null,
@ -31,7 +32,8 @@ namespace LINGYUN.Abp.Notifications
/// <param name="users">用户列表,为空标识发给所有订阅用户</param> /// <param name="users">用户列表,为空标识发给所有订阅用户</param>
/// <param name="tenantId">租户</param> /// <param name="tenantId">租户</param>
/// <param name="severity">严重级别</param> /// <param name="severity">严重级别</param>
Task SendNofitersAsync( /// <returns>通知标识</returns>
Task<string> SendNofitersAsync(
string name, string name,
NotificationData data, NotificationData data,
IEnumerable<UserIdentifier> users = null, IEnumerable<UserIdentifier> users = null,

34
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs

@ -1,4 +1,5 @@
using Microsoft.Extensions.Logging; using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using System; using System;
@ -24,18 +25,24 @@ namespace LINGYUN.Abp.Notifications
/// Reference to <see cref="IDistributedEventBus"/>. /// Reference to <see cref="IDistributedEventBus"/>.
/// </summary> /// </summary>
public IDistributedEventBus DistributedEventBus { get; } public IDistributedEventBus DistributedEventBus { get; }
/// <summary>
/// Reference to <see cref="IMessageIdGenerator"/>.
/// </summary>
protected ISnowflakeIdrGenerator SnowflakeIdGenerator { get; }
protected AbpNotificationOptions Options { get; } protected AbpNotificationOptions Options { get; }
public NotificationSender( public NotificationSender(
IDistributedEventBus distributedEventBus, IDistributedEventBus distributedEventBus,
ISnowflakeIdrGenerator snowflakeIdrGenerator,
IOptions<AbpNotificationOptions> options) IOptions<AbpNotificationOptions> options)
{ {
Options = options.Value; Options = options.Value;
DistributedEventBus = distributedEventBus; DistributedEventBus = distributedEventBus;
SnowflakeIdGenerator = snowflakeIdrGenerator;
Logger = NullLogger<NotificationSender>.Instance; Logger = NullLogger<NotificationSender>.Instance;
} }
public async Task SendNofiterAsync( public async Task<string> SendNofiterAsync(
string name, string name,
NotificationData data, NotificationData data,
UserIdentifier user = null, UserIdentifier user = null,
@ -44,44 +51,45 @@ namespace LINGYUN.Abp.Notifications
{ {
if (user == null) if (user == null)
{ {
await PublishNofiterAsync(name, data, null, tenantId, severity); return await PublishNofiterAsync(name, data, null, tenantId, severity);
} }
else else
{ {
await PublishNofiterAsync(name, data, new List<UserIdentifier> { user }, tenantId, severity); return await PublishNofiterAsync(name, data, new List<UserIdentifier> { user }, tenantId, severity);
} }
} }
public async Task SendNofitersAsync( public async Task<string> SendNofitersAsync(
string name, string name,
NotificationData data, NotificationData data,
IEnumerable<UserIdentifier> users = null, IEnumerable<UserIdentifier> users = null,
Guid? tenantId = null, Guid? tenantId = null,
NotificationSeverity severity = NotificationSeverity.Info) NotificationSeverity severity = NotificationSeverity.Info)
{ {
await PublishNofiterAsync(name, data, users, tenantId, severity); return await PublishNofiterAsync(name, data, users, tenantId, severity);
} }
protected async Task PublishNofiterAsync( protected async Task<string> PublishNofiterAsync(
string name, string name,
NotificationData data, NotificationData data,
IEnumerable<UserIdentifier> users = null, IEnumerable<UserIdentifier> users = null,
Guid? tenantId = null, Guid? tenantId = null,
NotificationSeverity severity = NotificationSeverity.Info) NotificationSeverity severity = NotificationSeverity.Info)
{ {
await DistributedEventBus var eto = new NotificationEto<NotificationData>(data)
.PublishAsync(
new NotificationEventData
{ {
Application = Options.Application, Id = SnowflakeIdGenerator.Create(),
TenantId = tenantId, TenantId = tenantId,
Users = users?.ToList(), Users = users?.ToList(),
Name = name, Name = name,
Data = data,
CreationTime = DateTime.Now, CreationTime = DateTime.Now,
Severity = severity Severity = severity
}); };
await DistributedEventBus.PublishAsync(eto);
return eto.Id.ToString();
} }
} }
} }

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationData.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.Notifications namespace LINGYUN.Abp.Notifications
{ {
@ -10,6 +11,8 @@ namespace LINGYUN.Abp.Notifications
/// TODO: 2020-10-29 针对不同语言的用户,如果在发布时期就本地化语言是错误的设计 /// TODO: 2020-10-29 针对不同语言的用户,如果在发布时期就本地化语言是错误的设计
/// 把通知的标题和内容设计为 <see cref="LocalizableStringInfo"/> 让客户端自行本地化 /// 把通知的标题和内容设计为 <see cref="LocalizableStringInfo"/> 让客户端自行本地化
/// </remarks> /// </remarks>
[Serializable]
[EventName("notifications")]
public class NotificationData public class NotificationData
{ {
/// <summary> /// <summary>

51
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationEto.cs

@ -0,0 +1,51 @@
using LINGYUN.Abp.RealTime;
using System;
using System.Collections.Generic;
using Volo.Abp.EventBus;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Notifications
{
[Serializable]
[GenericEventName(Prefix = "abp.realtime.")]
public class NotificationEto<T> : RealTimeEto<T>, IMultiTenant
{
/// <summary>
/// 通知标识
/// 自动计算
/// </summary>
public long Id { get; set; }
/// <summary>
/// 租户
/// </summary>
public Guid? TenantId { get; set; }
/// <summary>
/// 通知名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreationTime { get; set; }
/// <summary>
/// 紧急级别
/// </summary>
public NotificationSeverity Severity { get; set; }
/// <summary>
/// 指定的接收用户信息集合
/// </summary>
/// <remarks>
/// 注:<br/>
/// 如果指定了用户列表,应该在事件订阅程序中通过此集合过滤订阅用户<br/>
/// 如果未指定用户列表,应该在事件订阅程序中过滤所有订阅此通知的用户
/// </remarks>
public List<UserIdentifier> Users { get; set; }
public NotificationEto() : base()
{
}
public NotificationEto(T data) : base(data)
{
}
}
}

1
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN.Abp.RealTime.csproj

@ -9,6 +9,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Volo.Abp.Core" Version="4.3.0" /> <PackageReference Include="Volo.Abp.Core" Version="4.3.0" />
<PackageReference Include="Volo.Abp.EventBus.Abstractions" Version="4.3.0" />
</ItemGroup> </ItemGroup>
</Project> </Project>

13
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/AbpRealTimeModule.cs

@ -1,8 +1,19 @@
using Volo.Abp.Modularity; using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.EventBus.Abstractions;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.RealTime namespace LINGYUN.Abp.RealTime
{ {
[DependsOn(typeof(AbpEventBusAbstractionsModule))]
public class AbpRealTimeModule : AbpModule public class AbpRealTimeModule : AbpModule
{ {
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
context
.ServiceProvider
.GetRequiredService<SnowflakeIdrGenerator>()
.Initialize();
}
} }
} }

7
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/ISnowflakeIdrGenerator.cs

@ -0,0 +1,7 @@
namespace LINGYUN.Abp.RealTime
{
public interface ISnowflakeIdrGenerator
{
long Create();
}
}

21
aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/RealTimeEto.cs

@ -0,0 +1,21 @@
using System;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.RealTime
{
[Serializable]
[GenericEventName(Prefix = "abp.realtime.")]
public class RealTimeEto<T> : EtoBase
{
public T Data { get; set; }
public RealTimeEto() : base()
{
}
public RealTimeEto(T data) : base()
{
Data = data;
}
}
}

2
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/SnowflakeIdOptions.cs → aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdOptions.cs

@ -1,4 +1,4 @@
namespace LINGYUN.Abp.MessageService.Utils namespace LINGYUN.Abp.RealTime
{ {
public class SnowflakeIdOptions public class SnowflakeIdOptions
{ {

6
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/SnowflakeIdGenerator.cs → aspnet-core/modules/common/LINGYUN.Abp.RealTime/LINGYUN/Abp/RealTime/SnowflakeIdrGenerator.cs

@ -3,11 +3,11 @@ using System;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
namespace LINGYUN.Abp.MessageService.Utils namespace LINGYUN.Abp.RealTime
{ {
// reference: https://github.com/dotnetcore/CAP // reference: https://github.com/dotnetcore/CAP
// reference: https://blog.csdn.net/lq18050010830/article/details/89845790 // reference: https://blog.csdn.net/lq18050010830/article/details/89845790
public class SnowflakeIdGenerator : ISnowflakeIdGenerator, ISingletonDependency public class SnowflakeIdrGenerator : ISnowflakeIdrGenerator, ISingletonDependency
{ {
public const long Twepoch = 1288834974657L; public const long Twepoch = 1288834974657L;
@ -24,7 +24,7 @@ namespace LINGYUN.Abp.MessageService.Utils
protected SnowflakeIdOptions Options { get; } protected SnowflakeIdOptions Options { get; }
public SnowflakeIdGenerator(IOptions<SnowflakeIdOptions> options) public SnowflakeIdrGenerator(IOptions<SnowflakeIdOptions> options)
{ {
Options = options.Value; Options = options.Value;

4
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Application/LINGYUN/Abp/MessageService/Chat/ChatAppService.cs

@ -128,9 +128,9 @@ namespace LINGYUN.Abp.MessageService.Chat
// TODO:向其他租户发送消息? // TODO:向其他租户发送消息?
input.TenantId ??= CurrentTenant.Id; input.TenantId ??= CurrentTenant.Id;
await MessageSender.SendMessageAsync(input); var messageId = await MessageSender.SendMessageAsync(input);
return new ChatMessageSendResultDto(input.MessageId); return new ChatMessageSendResultDto(messageId);
} }
} }
} }

11
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/AbpMessageServiceDomainModule.cs

@ -2,9 +2,6 @@
using LINGYUN.Abp.MessageService.Localization; using LINGYUN.Abp.MessageService.Localization;
using LINGYUN.Abp.MessageService.Mapper; using LINGYUN.Abp.MessageService.Mapper;
using LINGYUN.Abp.MessageService.ObjectExtending; using LINGYUN.Abp.MessageService.ObjectExtending;
using LINGYUN.Abp.MessageService.Utils;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp;
using Volo.Abp.AutoMapper; using Volo.Abp.AutoMapper;
using Volo.Abp.Caching; using Volo.Abp.Caching;
using Volo.Abp.Localization; using Volo.Abp.Localization;
@ -54,13 +51,5 @@ namespace LINGYUN.Abp.MessageService
typeof(Message) typeof(Message)
); );
} }
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
context
.ServiceProvider
.GetRequiredService<SnowflakeIdGenerator>()
.Initialize();
}
} }
} }

27
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Chat/MessageStore.cs

@ -1,7 +1,6 @@
using LINGYUN.Abp.IM.Contract; using LINGYUN.Abp.IM.Contract;
using LINGYUN.Abp.IM.Messages; using LINGYUN.Abp.IM.Messages;
using LINGYUN.Abp.MessageService.Group; using LINGYUN.Abp.MessageService.Group;
using LINGYUN.Abp.MessageService.Utils;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Threading; using System.Threading;
@ -29,8 +28,6 @@ namespace LINGYUN.Abp.MessageService.Chat
private readonly IMessageRepository _messageRepository; private readonly IMessageRepository _messageRepository;
private readonly ISnowflakeIdGenerator _snowflakeIdGenerator;
private readonly IUserChatSettingRepository _userChatSettingRepository; private readonly IUserChatSettingRepository _userChatSettingRepository;
public MessageStore( public MessageStore(
IFriendStore friendStore, IFriendStore friendStore,
@ -39,7 +36,6 @@ namespace LINGYUN.Abp.MessageService.Chat
IUnitOfWorkManager unitOfWorkManager, IUnitOfWorkManager unitOfWorkManager,
IGroupRepository groupRepository, IGroupRepository groupRepository,
IMessageRepository messageRepository, IMessageRepository messageRepository,
ISnowflakeIdGenerator snowflakeIdGenerator,
IUserChatSettingRepository userChatSettingRepository) IUserChatSettingRepository userChatSettingRepository)
{ {
_friendStore = friendStore; _friendStore = friendStore;
@ -48,7 +44,6 @@ namespace LINGYUN.Abp.MessageService.Chat
_unitOfWorkManager = unitOfWorkManager; _unitOfWorkManager = unitOfWorkManager;
_groupRepository = groupRepository; _groupRepository = groupRepository;
_messageRepository = messageRepository; _messageRepository = messageRepository;
_snowflakeIdGenerator = snowflakeIdGenerator;
_userChatSettingRepository = userChatSettingRepository; _userChatSettingRepository = userChatSettingRepository;
} }
@ -208,15 +203,18 @@ namespace LINGYUN.Abp.MessageService.Chat
{ {
throw new BusinessException(MessageServiceErrorCodes.UserHasBlack); throw new BusinessException(MessageServiceErrorCodes.UserHasBlack);
} }
var messageId = _snowflakeIdGenerator.Create();
var message = new UserMessage(messageId, chatMessage.FormUserId, chatMessage.FormUserName, chatMessage.Content, chatMessage.MessageType); var message = new UserMessage(
long.Parse(chatMessage.MessageId),
chatMessage.FormUserId,
chatMessage.FormUserName,
chatMessage.Content,
chatMessage.MessageType);
message.SendToUser(chatMessage.ToUserId.Value); message.SendToUser(chatMessage.ToUserId.Value);
message.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); message.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous);
await _messageRepository.InsertUserMessageAsync(message, cancellationToken); await _messageRepository.InsertUserMessageAsync(message, cancellationToken);
chatMessage.MessageId = messageId.ToString();
} }
protected virtual async Task StoreGroupMessageAsync( protected virtual async Task StoreGroupMessageAsync(
@ -242,15 +240,18 @@ namespace LINGYUN.Abp.MessageService.Chat
// 当前群组不允许匿名发言 // 当前群组不允许匿名发言
throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeakAnonymously); throw new BusinessException(MessageServiceErrorCodes.GroupNotAllowedToSpeakAnonymously);
} }
var messageId = _snowflakeIdGenerator.Create();
var message = new GroupMessage(messageId, chatMessage.FormUserId, chatMessage.FormUserName, chatMessage.Content, chatMessage.MessageType); var message = new GroupMessage(
long.Parse(chatMessage.MessageId),
chatMessage.FormUserId,
chatMessage.FormUserName,
chatMessage.Content,
chatMessage.MessageType);
message.SendToGroup(groupId); message.SendToGroup(groupId);
message.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous); message.SetProperty(nameof(ChatMessage.IsAnonymous), chatMessage.IsAnonymous);
await _messageRepository.InsertGroupMessageAsync(message, cancellationToken); await _messageRepository.InsertGroupMessageAsync(message, cancellationToken);
chatMessage.MessageId = messageId.ToString();
} }
} }
} }

14
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs

@ -1,5 +1,4 @@
using LINGYUN.Abp.MessageService.Subscriptions; using LINGYUN.Abp.MessageService.Subscriptions;
using LINGYUN.Abp.MessageService.Utils;
using LINGYUN.Abp.Notifications; using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using System; using System;
@ -30,8 +29,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IUnitOfWorkManager _unitOfWorkManager;
private readonly ISnowflakeIdGenerator _snowflakeIdGenerator;
private readonly INotificationRepository _notificationRepository; private readonly INotificationRepository _notificationRepository;
private readonly IUserNotificationRepository _userNotificationRepository; private readonly IUserNotificationRepository _userNotificationRepository;
@ -44,7 +41,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
ICurrentTenant currentTenant, ICurrentTenant currentTenant,
IJsonSerializer jsonSerializer, IJsonSerializer jsonSerializer,
IUnitOfWorkManager unitOfWorkManager, IUnitOfWorkManager unitOfWorkManager,
ISnowflakeIdGenerator snowflakeIdGenerator,
INotificationRepository notificationRepository, INotificationRepository notificationRepository,
IUserSubscribeRepository userSubscribeRepository, IUserSubscribeRepository userSubscribeRepository,
IUserNotificationRepository userNotificationRepository IUserNotificationRepository userNotificationRepository
@ -55,7 +51,6 @@ namespace LINGYUN.Abp.MessageService.Notifications
_currentTenant = currentTenant; _currentTenant = currentTenant;
_jsonSerializer = jsonSerializer; _jsonSerializer = jsonSerializer;
_unitOfWorkManager = unitOfWorkManager; _unitOfWorkManager = unitOfWorkManager;
_snowflakeIdGenerator = snowflakeIdGenerator;
_notificationRepository = notificationRepository; _notificationRepository = notificationRepository;
_userSubscribeRepository = userSubscribeRepository; _userSubscribeRepository = userSubscribeRepository;
_userNotificationRepository = userNotificationRepository; _userNotificationRepository = userNotificationRepository;
@ -322,12 +317,9 @@ namespace LINGYUN.Abp.MessageService.Notifications
using (var unitOfWork = _unitOfWorkManager.Begin()) using (var unitOfWork = _unitOfWorkManager.Begin())
using (_currentTenant.Change(notification.TenantId)) using (_currentTenant.Change(notification.TenantId))
{ {
// var notifyId = notification.GetId(); var notify = new Notification(
var notifyId = _snowflakeIdGenerator.Create(); notification.GetId(),
// 保存主键,防止前端js long类型溢出 notification.Name,
// notification.Data["id"] = notifyId.ToString();
var notify = new Notification(notifyId, notification.Name,
notification.Data.GetType().AssemblyQualifiedName, notification.Data.GetType().AssemblyQualifiedName,
_jsonSerializer.Serialize(notification.Data), _jsonSerializer.Serialize(notification.Data),
notification.Severity, notification.TenantId) notification.Severity, notification.TenantId)

7
aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Utils/ISnowflakeIdGenerator.cs

@ -1,7 +0,0 @@
namespace LINGYUN.Abp.MessageService.Utils
{
public interface ISnowflakeIdGenerator
{
long Create();
}
}

15
aspnet-core/services/account/AuthServer.Host/AuthIdentityServerModule.cs

@ -23,6 +23,8 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Security.Cryptography.X509Certificates; using System.Security.Cryptography.X509Certificates;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Account; using Volo.Abp.Account;
using Volo.Abp.Account.Localization; using Volo.Abp.Account.Localization;
@ -43,6 +45,7 @@ using Volo.Abp.Identity;
using Volo.Abp.IdentityServer; using Volo.Abp.IdentityServer;
using Volo.Abp.IdentityServer.Jwt; using Volo.Abp.IdentityServer.Jwt;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -134,17 +137,11 @@ namespace AuthServer.Host
options.UseMySQL(); options.UseMySQL();
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>

15
aspnet-core/services/admin/LINGYUN.Abp.BackendAdmin.HttpApi.Host/BackendAdminHostModule.cs

@ -30,6 +30,8 @@ using Microsoft.OpenApi.Models;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
@ -50,6 +52,7 @@ using Volo.Abp.Identity.EntityFrameworkCore;
using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Localization;
using Volo.Abp.IdentityServer.EntityFrameworkCore; using Volo.Abp.IdentityServer.EntityFrameworkCore;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -138,17 +141,11 @@ namespace LINGYUN.Abp.BackendAdmin
options.UseMySQL(); options.UseMySQL();
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>

15
aspnet-core/services/apigateway/LINGYUN.Abp.ApiGateway.Host/AbpApiGatewayHostModule.cs

@ -17,6 +17,8 @@ using Ocelot.Provider.Polly;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore; using Volo.Abp.AspNetCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -24,6 +26,7 @@ using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Http.Client; using Volo.Abp.Http.Client;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Security.Encryption; using Volo.Abp.Security.Encryption;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
@ -50,17 +53,11 @@ namespace LINGYUN.Abp.ApiGateway
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
Configure<AbpApiGatewayOptions>(configuration.GetSection("ApiGateway")); Configure<AbpApiGatewayOptions>(configuration.GetSection("ApiGateway"));

15
aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/ApiGatewayHostModule.cs

@ -20,6 +20,8 @@ using Ocelot.Provider.Polly;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore; using Volo.Abp.AspNetCore;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
@ -28,6 +30,7 @@ using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.Http.Client.IdentityModel; using Volo.Abp.Http.Client.IdentityModel;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.Security.Encryption; using Volo.Abp.Security.Encryption;
@ -81,17 +84,11 @@ namespace LINGYUN.ApiGateway
Configure<ApiGatewayOptions>(configuration.GetSection("ApiGateway")); Configure<ApiGatewayOptions>(configuration.GetSection("ApiGateway"));
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => .AddJwtBearer(options =>

15
aspnet-core/services/apigateway/LINGYUN.ApiGateway.HttpApi.Host/ApiGatewayHttpApiHostModule.cs

@ -15,6 +15,8 @@ using Microsoft.OpenApi.Models;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Security.Claims; using Volo.Abp.AspNetCore.Security.Claims;
using Volo.Abp.Auditing; using Volo.Abp.Auditing;
@ -27,6 +29,7 @@ using Volo.Abp.Data;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -82,17 +85,11 @@ namespace LINGYUN.ApiGateway
options.UseMySQL(); options.UseMySQL();
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>

28
aspnet-core/services/identity-server/LINGYUN.Abp.IdentityServer4.HttpApi.Host/AbpIdentityServerAdminHttpApiHostModule.cs

@ -19,6 +19,8 @@ using Microsoft.OpenApi.Models;
using StackExchange.Redis; using StackExchange.Redis;
using System; using System;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy; using Volo.Abp.AspNetCore.Mvc.UI.MultiTenancy;
@ -34,6 +36,7 @@ using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.MySQL; using Volo.Abp.EntityFrameworkCore.MySQL;
using Volo.Abp.Identity.Localization; using Volo.Abp.Identity.Localization;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -104,27 +107,13 @@ namespace LINGYUN.Abp.IdentityServer4
Configure<AbpDbContextOptions>(options => Configure<AbpDbContextOptions>(options =>
{ {
options.UseMySQL(); options.UseMySQL();
//if (hostingEnvironment.IsDevelopment())
//{
// options.PreConfigure(ctx =>
// {
// ctx.DbContextOptions.EnableDetailedErrors();
// ctx.DbContextOptions.EnableSensitiveDataLogging();
// });
//}
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>
@ -271,11 +260,6 @@ namespace LINGYUN.Abp.IdentityServer4
options.Resources.AddDynamic(typeof(IdentityResource)); options.Resources.AddDynamic(typeof(IdentityResource));
}); });
Configure<AbpClaimsMapOptions>(options =>
{
options.Maps.TryAdd("name", () => AbpClaimTypes.UserName);
});
context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) context.Services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme)
.AddJwtBearer(options => .AddJwtBearer(options =>
{ {

12
aspnet-core/services/localization/LINGYUN.Abp.LocalizationManagement.HttpApi.Host/AbpLocalizationManagementHttpApiHostModule.cs

@ -88,17 +88,11 @@ namespace LINGYUN.Abp.LocalizationManagement
options.UseMySQL(); options.UseMySQL();
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>

15
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/AbpMessageServiceHttpApiHostModule.cs

@ -29,6 +29,8 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Auditing; using Volo.Abp.AspNetCore.Auditing;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
@ -41,6 +43,7 @@ using Volo.Abp.Caching;
using Volo.Abp.Caching.StackExchangeRedis; using Volo.Abp.Caching.StackExchangeRedis;
using Volo.Abp.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -113,17 +116,11 @@ namespace LINGYUN.Abp.MessageService
options.IgnoredUrls.AddIfNotContains("/hangfire"); options.IgnoredUrls.AddIfNotContains("/hangfire");
}); });
// 解决某些不支持类型的序列化 // 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
// 加解密 // 加解密
Configure<AbpStringEncryptionOptions>(options => Configure<AbpStringEncryptionOptions>(options =>

9
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/ChatMessageEventHandler.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.IM; using LINGYUN.Abp.IM;
using LINGYUN.Abp.IM.Messages; using LINGYUN.Abp.IM.Messages;
using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -9,7 +10,7 @@ using Volo.Abp.EventBus.Distributed;
namespace LINGYUN.Abp.MessageService.EventBus.Distributed namespace LINGYUN.Abp.MessageService.EventBus.Distributed
{ {
public class ChatMessageEventHandler : IDistributedEventHandler<ChatMessage>, ITransientDependency public class ChatMessageEventHandler : IDistributedEventHandler<RealTimeEto<ChatMessage>>, ITransientDependency
{ {
/// <summary> /// <summary>
/// Reference to <see cref="ILogger<DefaultNotificationDispatcher>"/>. /// Reference to <see cref="ILogger<DefaultNotificationDispatcher>"/>.
@ -35,17 +36,17 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
Logger = NullLogger<ChatMessageEventHandler>.Instance; Logger = NullLogger<ChatMessageEventHandler>.Instance;
} }
public virtual async Task HandleEventAsync(ChatMessage eventData) public virtual async Task HandleEventAsync(RealTimeEto<ChatMessage> eventData)
{ {
Logger.LogDebug($"Persistent chat message."); Logger.LogDebug($"Persistent chat message.");
await MessageStore.StoreMessageAsync(eventData); await MessageStore.StoreMessageAsync(eventData.Data);
// 发送消息 // 发送消息
foreach (var provider in MessageSenderProviderManager.Providers) foreach (var provider in MessageSenderProviderManager.Providers)
{ {
Logger.LogDebug($"Sending message with provider {provider.Name}"); Logger.LogDebug($"Sending message with provider {provider.Name}");
await provider.SendMessageAsync(eventData); await provider.SendMessageAsync(eventData.Data);
} }
} }
} }

24
aspnet-core/services/messages/LINGYUN.Abp.MessageService.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs

@ -1,5 +1,6 @@
using LINGYUN.Abp.MessageService.Utils; using LINGYUN.Abp.MessageService.Utils;
using LINGYUN.Abp.Notifications; using LINGYUN.Abp.Notifications;
using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions; using Microsoft.Extensions.Logging.Abstractions;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -22,7 +23,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// 作用在于SignalR客户端只会与一台服务器建立连接, /// 作用在于SignalR客户端只会与一台服务器建立连接,
/// 只有启用了SignlR服务端的才能真正将消息发布到客户端 /// 只有启用了SignlR服务端的才能真正将消息发布到客户端
/// </remarks> /// </remarks>
public class NotificationEventHandler : IDistributedEventHandler<NotificationEventData>, ITransientDependency public class NotificationEventHandler : IDistributedEventHandler<NotificationEto<NotificationData>>, ITransientDependency
{ {
/// <summary> /// <summary>
/// Reference to <see cref="ILogger<DefaultNotificationDispatcher>"/>. /// Reference to <see cref="ILogger<DefaultNotificationDispatcher>"/>.
@ -37,10 +38,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
/// </summary> /// </summary>
protected IJsonSerializer JsonSerializer { get; } protected IJsonSerializer JsonSerializer { get; }
/// <summary> /// <summary>
/// Reference to <see cref="ISnowflakeIdGenerator"/>.
/// </summary>
protected ISnowflakeIdGenerator SnowflakeIdGenerator { get; }
/// <summary>
/// Reference to <see cref="IBackgroundJobManager"/>. /// Reference to <see cref="IBackgroundJobManager"/>.
/// </summary> /// </summary>
protected IBackgroundJobManager BackgroundJobManager { get; } protected IBackgroundJobManager BackgroundJobManager { get; }
@ -69,7 +66,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
IBackgroundJobManager backgroundJobManager, IBackgroundJobManager backgroundJobManager,
IOptions<AbpNotificationOptions> options, IOptions<AbpNotificationOptions> options,
INotificationStore notificationStore, INotificationStore notificationStore,
ISnowflakeIdGenerator snowflakeIdGenerator,
INotificationDefinitionManager notificationDefinitionManager, INotificationDefinitionManager notificationDefinitionManager,
INotificationSubscriptionManager notificationSubscriptionManager, INotificationSubscriptionManager notificationSubscriptionManager,
INotificationPublishProviderManager notificationPublishProviderManager) INotificationPublishProviderManager notificationPublishProviderManager)
@ -78,7 +74,6 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
JsonSerializer = jsonSerializer; JsonSerializer = jsonSerializer;
BackgroundJobManager = backgroundJobManager; BackgroundJobManager = backgroundJobManager;
NotificationStore = notificationStore; NotificationStore = notificationStore;
SnowflakeIdGenerator = snowflakeIdGenerator;
NotificationDefinitionManager = notificationDefinitionManager; NotificationDefinitionManager = notificationDefinitionManager;
NotificationSubscriptionManager = notificationSubscriptionManager; NotificationSubscriptionManager = notificationSubscriptionManager;
NotificationPublishProviderManager = notificationPublishProviderManager; NotificationPublishProviderManager = notificationPublishProviderManager;
@ -87,19 +82,14 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
} }
[UnitOfWork] [UnitOfWork]
public virtual async Task HandleEventAsync(NotificationEventData eventData) public virtual async Task HandleEventAsync(NotificationEto<NotificationData> eventData)
{ {
// 这样做的话就要注意了 // 如果上面过滤了应用程序,这里可以使用Get方法,否则,最好使用GetOrNull加以判断
// 当只有一个消费者订阅时,事件总线会认为消息已经处理,从而发布Ack指令,从消息队列中移除此消息 var notification = NotificationDefinitionManager.GetOrNull(eventData.Name);
// 可能造成通知数据丢失 if (notification == null)
var application = Options.Application ?? "Abp";
if (!string.Equals(application, eventData.Application, StringComparison.InvariantCultureIgnoreCase))
{ {
// 不是当前监听应用的消息不做处理
return; return;
} }
// 如果上面过滤了应用程序,这里可以使用Get方法,否则,最好使用GetOrNull加以判断
var notification = NotificationDefinitionManager.Get(eventData.Name);
var notificationInfo = new NotificationInfo var notificationInfo = new NotificationInfo
{ {
@ -111,7 +101,7 @@ namespace LINGYUN.Abp.MessageService.EventBus.Distributed
TenantId = eventData.TenantId, TenantId = eventData.TenantId,
Type = notification.NotificationType Type = notification.NotificationType
}; };
notificationInfo.SetId(SnowflakeIdGenerator.Create()); notificationInfo.SetId(eventData.Id);
// TODO: 可以做成一个接口来序列化消息 // TODO: 可以做成一个接口来序列化消息
notificationInfo.Data = NotificationDataConverter.Convert(notificationInfo.Data); notificationInfo.Data = NotificationDataConverter.Convert(notificationInfo.Data);

15
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/AppPlatformHttpApiHostModule.cs

@ -27,6 +27,8 @@ using StackExchange.Redis;
using System; using System;
using System.IO; using System.IO;
using System.Text; using System.Text;
using System.Text.Encodings.Web;
using System.Text.Unicode;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.AspNetCore.Authentication.JwtBearer; using Volo.Abp.AspNetCore.Authentication.JwtBearer;
using Volo.Abp.AspNetCore.MultiTenancy; using Volo.Abp.AspNetCore.MultiTenancy;
@ -44,6 +46,7 @@ using Volo.Abp.FeatureManagement.EntityFrameworkCore;
using Volo.Abp.Http.Client.IdentityModel.Web; using Volo.Abp.Http.Client.IdentityModel.Web;
using Volo.Abp.Identity; using Volo.Abp.Identity;
using Volo.Abp.Json; using Volo.Abp.Json;
using Volo.Abp.Json.SystemTextJson;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.MultiTenancy; using Volo.Abp.MultiTenancy;
@ -117,17 +120,11 @@ namespace LINGYUN.Platform
options.UseMySQL(); options.UseMySQL();
}); });
// 解决某些不支持类型的序列化 //// 中文序列化的编码问题
Configure<AbpJsonOptions>(options => Configure<AbpSystemTextJsonSerializerOptions>(options =>
{ {
// See: https://docs.abp.io/en/abp/4.0/Migration-Guides/Abp-4_0#always-use-the-newtonsoft-json options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
options.UseHybridSerializer = false;
}); });
//// 中文序列化的编码问题
//Configure<AbpSystemTextJsonSerializerOptions>(options =>
//{
// options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All);
//});
Configure<KestrelServerOptions>(options => Configure<KestrelServerOptions>(options =>
{ {

40
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/DomainTenantResolveContributor.cs

@ -1,40 +0,0 @@
using Microsoft.AspNetCore.Http;
using System;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Text.Formatting;
namespace LINGYUN.Platform
{
public class DomainTenantResolveContributor : HttpTenantResolveContributorBase
{
public const string ContributorName = "Domain";
public override string Name => ContributorName;
private static readonly string[] ProtocolPrefixes = { "http://", "https://" };
private readonly string _domainFormat;
public DomainTenantResolveContributor(string domainFormat)
{
_domainFormat = domainFormat.RemovePreFix(ProtocolPrefixes);
}
protected override Task<string> GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext)
{
if (!httpContext.Request.Host.HasValue)
{
return Task.FromResult<string>(null);
}
var hostName = httpContext.Request.Host.Value.RemovePreFix(ProtocolPrefixes);
var extractResult = FormattedStringValueExtracter.Extract(hostName, _domainFormat, ignoreCase: true);
context.Handled = true;
return Task.FromResult(extractResult.IsMatch ? extractResult.Matches[0].Value : null);
}
}
}

50
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/HeaderTenantResolveContributor.cs

@ -1,50 +0,0 @@
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.AspNetCore.MultiTenancy;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform
{
public class HeaderTenantResolveContributor : HttpTenantResolveContributorBase
{
public const string ContributorName = "Header";
public override string Name => ContributorName;
protected override Task<string> GetTenantIdOrNameFromHttpContextOrNullAsync(ITenantResolveContext context, HttpContext httpContext)
{
if (httpContext.Request.Headers.IsNullOrEmpty())
{
return Task.FromResult((string)null);
}
var tenantIdKey = context.GetAbpAspNetCoreMultiTenancyOptions().TenantKey;
var tenantIdHeader = httpContext.Request.Headers[tenantIdKey];
if (tenantIdHeader == string.Empty || tenantIdHeader.Count < 1)
{
return Task.FromResult((string)null);
}
if (tenantIdHeader.Count > 1)
{
Log(context, $"HTTP request includes more than one {tenantIdKey} header value. First one will be used. All of them: {tenantIdHeader.JoinAsString(", ")}");
}
return Task.FromResult(tenantIdHeader.First());
}
protected virtual void Log(ITenantResolveContext context, string text)
{
context
.ServiceProvider
.GetRequiredService<ILogger<HeaderTenantResolveContributor>>()
.LogWarning(text);
}
}
}

66
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/TenantConfigurationProvider.cs

@ -1,66 +0,0 @@
using System;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform
{
[Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(ITenantConfigurationProvider))]
public class TenantConfigurationProvider : ITenantConfigurationProvider
{
protected virtual ITenantResolver TenantResolver { get; }
protected virtual ITenantStore TenantStore { get; }
protected virtual ITenantResolveResultAccessor TenantResolveResultAccessor { get; }
public TenantConfigurationProvider(
ITenantResolver tenantResolver,
ITenantStore tenantStore,
ITenantResolveResultAccessor tenantResolveResultAccessor)
{
TenantResolver = tenantResolver;
TenantStore = tenantStore;
TenantResolveResultAccessor = tenantResolveResultAccessor;
}
public virtual async Task<TenantConfiguration> GetAsync(bool saveResolveResult = false)
{
var resolveResult = await TenantResolver.ResolveTenantIdOrNameAsync();
if (saveResolveResult)
{
TenantResolveResultAccessor.Result = resolveResult;
}
TenantConfiguration tenant = null;
if (resolveResult.TenantIdOrName != null)
{
tenant = await FindTenantAsync(resolveResult.TenantIdOrName);
if (tenant == null)
{
throw new BusinessException(
code: "Volo.AbpIo.MultiTenancy:010001",
message: "Tenant not found!",
details: "There is no tenant with the tenant id or name: " + resolveResult.TenantIdOrName
);
}
}
return tenant;
}
protected virtual async Task<TenantConfiguration> FindTenantAsync(string tenantIdOrName)
{
if (Guid.TryParse(tenantIdOrName, out var parsedTenantId))
{
return await TenantStore.FindAsync(parsedTenantId);
}
else
{
return await TenantStore.FindAsync(tenantIdOrName);
}
}
}
}

48
aspnet-core/services/platform/LINGYUN.Platform.HttpApi.Host/TenantResolver.cs

@ -1,48 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using System;
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Platform
{
[Dependency(Microsoft.Extensions.DependencyInjection.ServiceLifetime.Transient, ReplaceServices = true)]
[ExposeServices(typeof(ITenantResolver))]
public class TenantResolver : ITenantResolver
{
private readonly IServiceProvider _serviceProvider;
private readonly AbpTenantResolveOptions _options;
public TenantResolver(IOptions<AbpTenantResolveOptions> options, IServiceProvider serviceProvider)
{
_serviceProvider = serviceProvider;
_options = options.Value;
}
public virtual async Task<TenantResolveResult> ResolveTenantIdOrNameAsync()
{
var result = new TenantResolveResult();
using (var serviceScope = _serviceProvider.CreateScope())
{
var context = new TenantResolveContext(serviceScope.ServiceProvider);
foreach (var tenantResolver in _options.TenantResolvers)
{
await tenantResolver.ResolveAsync(context);
result.AppliedResolvers.Add(tenantResolver.Name);
if (context.Handled || context.TenantIdOrName != null)
{
result.TenantIdOrName = context.TenantIdOrName;
break;
}
}
}
return result;
}
}
}

1
build/build-aspnetcore-release.ps1

@ -5,6 +5,7 @@ foreach ($service in $serviceArray) {
Set-Location $service.Path Set-Location $service.Path
$publishPath = $service.Path + "/../../Publish/" + $service.Service $publishPath = $service.Path + "/../../Publish/" + $service.Service
dotnet publish -c Release -o $publishPath --no-cache --no-restore dotnet publish -c Release -o $publishPath --no-cache --no-restore
Copy-Item (Join-Path $service.Path "Dockerfile") -Destination $publishPath -Recurse
} }
Set-Location $rootFolder Set-Location $rootFolder

84
docker-compose.override.windows.yml

@ -0,0 +1,84 @@
version: '3.4'
services:
identity-server-sts:
build:
context: ./aspnet-core/services/Publish/identityserver
volumes:
- D:\Projects\Development\Abp\Application\logs\ids-sts:/app/Logs
restart: always
identity-server-admin:
build:
context: ./aspnet-core/services/Publish/identityserver4-admin
volumes:
- D:\Projects\Development\Abp\Application\logs\ids-admin:/app/Logs
depends_on:
- identity-server-sts
restart: always
admin-service:
build:
context: ./aspnet-core/services/Publish/admin
volumes:
- D:\Projects\Development\Abp\Application\logs\backend-admin:/app/Logs
depends_on:
- identity-server-sts
restart: always
localization-service:
build:
context: ./aspnet-core/services/Publish/localization
volumes:
- D:\Projects\Development\Abp\Application\logs\localization:/app/Logs
restart: always
platform-service:
build:
context: ./aspnet-core/services/Publish/platform
volumes:
- D:\Projects\Development\Abp\Application\logs\platform:/app/Logs
- D:\Projects\Development\Abp\Application\data\platform:/app/file-blob-storing
depends_on:
- identity-server-sts
restart: always
messages-service:
build:
context: ./aspnet-core/services/Publish/messages
volumes:
- D:\Projects\Development\Abp\Application\logs\messages:/app/Logs
depends_on:
- identity-server-sts
restart: always
apigateway-admin-service:
build:
context: ./aspnet-core/services/Publish/apigateway-admin
volumes:
- D:\Projects\Development\Abp\Application\logs\apigateway-admin:/app/Logs
depends_on:
- identity-server-sts
- admin-service
restart: always
apigateway-host-service:
build:
context: ./aspnet-core/services/Publish/apigateway-host
volumes:
- D:\Projects\Development\Abp\Application\logs\apigateway-host:/app/Logs
depends_on:
- identity-server-sts
- apigateway-admin-service
restart: always
abp-vue-admin-client:
build:
context: ./aspnet-core/services/Publish/client
restart: always
volumes:
dbdata:
networks:
linyun-abp:

112
docker-compose.override.yml

@ -1,62 +1,84 @@
version: '3.4' version: '3.4'
services: services:
admin-service: identity-server-sts:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/identityserver
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/ids-sts:/app/Logs
- "30010:80" restart: always
identity-server-admin: identity-server-admin:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/identityserver4-admin
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/ids-admin:/app/Logs
- "30015:80" depends_on:
- identity-server-sts
restart: always
admin-service:
build:
context: ./aspnet-core/services/Publish/admin
volumes:
- /var/opt/abp/logs/backend-admin:/app/Logs
depends_on:
- identity-server-sts
restart: always
localization-service: localization-service:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/localization
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/localization:/app/Logs
- "30030:80" restart: always
platform-service: platform-service:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/platform
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/platform:/app/Logs
- "30025:80" - /var/opt/abp/data/platform:/app/file-blob-storing
depends_on:
- identity-server-sts
restart: always
messages-service: messages-service:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/messages
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/messages:/app/Logs
- "30020:80" depends_on:
- identity-server-sts
identity-server-sts: restart: always
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://0.0.0.0:80
ports:
- "44385:80"
apigateway-admin-service: apigateway-admin-service:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/apigateway-admin
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/apigateway-admin:/app/Logs
- "30001:80" depends_on:
- identity-server-sts
- admin-service
restart: always
apigateway-host-service: apigateway-host-service:
environment: build:
- ASPNETCORE_ENVIRONMENT=Production context: ./aspnet-core/services/Publish/apigateway-host
- ASPNETCORE_URLS=http://0.0.0.0:80 volumes:
ports: - /var/opt/abp/logs/apigateway-host:/app/Logs
- "30000:80" depends_on:
- identity-server-sts
- apigateway-admin-service
restart: always
abp-vue-admin-client: abp-vue-admin-client:
ports: build:
- "40000:80" context: ./aspnet-core/services/Publish/client
restart: always
volumes:
dbdata:
networks:
linyun-abp:

112
docker-compose.yml

@ -1,84 +1,62 @@
version: '3.4' version: '3.4'
services: services:
identity-server-sts: admin-service:
build: environment:
context: ./aspnet-core/services/Publish/identityserver - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/ids-sts:/app/Logs ports:
restart: always - "30010:80"
identity-server-admin: identity-server-admin:
build: environment:
context: ./aspnet-core/services/Publish/identityserver4-admin - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/ids-admin:/app/Logs ports:
depends_on: - "30015:80"
- identity-server-sts
restart: always
admin-service:
build:
context: ./aspnet-core/services/Publish/admin
volumes:
- /var/opt/abp/logs/backend-admin:/app/Logs
depends_on:
- identity-server-sts
restart: always
localization-service: localization-service:
build: environment:
context: ./aspnet-core/services/Publish/localization - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/localization:/app/Logs ports:
restart: always - "30030:80"
platform-service: platform-service:
build: environment:
context: ./aspnet-core/services/Publish/platform - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/platform:/app/Logs ports:
- /var/opt/abp/data/platform:/app/file-blob-storing - "30025:80"
depends_on:
- identity-server-sts
restart: always
messages-service: messages-service:
build: environment:
context: ./aspnet-core/services/Publish/messages - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/messages:/app/Logs ports:
depends_on: - "30020:80"
- identity-server-sts
restart: always identity-server-sts:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://0.0.0.0:80
ports:
- "44385:80"
apigateway-admin-service: apigateway-admin-service:
build: environment:
context: ./aspnet-core/services/Publish/apigateway-admin - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/apigateway-admin:/app/Logs ports:
depends_on: - "30001:80"
- identity-server-sts
- admin-service
restart: always
apigateway-host-service: apigateway-host-service:
build: environment:
context: ./aspnet-core/services/Publish/apigateway-host - ASPNETCORE_ENVIRONMENT=Production
volumes: - ASPNETCORE_URLS=http://0.0.0.0:80
- /var/opt/abp/logs/apigateway-host:/app/Logs ports:
depends_on: - "30000:80"
- identity-server-sts
- apigateway-admin-service
restart: always
abp-vue-admin-client: abp-vue-admin-client:
build: ports:
context: ./aspnet-core/services/Publish/client - "40000:80"
restart: always
volumes:
dbdata:
networks:
linyun-abp:

Loading…
Cancel
Save