Browse Source

abstract notification core module

pull/671/head
cKey 3 years ago
parent
commit
67af9e5220
  1. 33
      aspnet-core/LINGYUN.MicroService.All.sln
  2. 9
      aspnet-core/LINGYUN.MicroService.Common.sln
  3. 9
      aspnet-core/LINGYUN.MicroService.TaskManagement.sln
  4. 11
      aspnet-core/LINGYUN.MicroService.Workflow.sln
  5. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/AbpNotificationsCommonModule.cs
  6. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/FodyWeavers.xml
  7. 30
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/FodyWeavers.xsd
  8. 16
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj
  9. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs
  10. 44
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsCoreModule.cs
  11. 17
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs
  12. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/DefaultNotifications.cs
  13. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs
  14. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs
  15. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs
  16. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs
  17. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs
  18. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs
  19. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs
  20. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs
  21. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs
  22. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationProviderNames.cs
  23. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs
  24. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs
  25. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs
  26. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/AbpNotificationsEmailingModule.cs
  27. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Jobs/LINGYUN/Abp/Notifications/Jobs/AbpNotificationsJobsModule.cs
  28. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs
  29. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs
  30. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj
  31. 35
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationOptions.cs
  32. 37
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs
  33. 28
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsPublishOptions.cs
  34. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs
  35. 4
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/Internal/NotificationSender.cs
  36. 24
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs
  37. 6
      aspnet-core/modules/common/LINGYUN.Abp.Notifications/README.md
  38. 2
      aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/AbpElsaActivitiesNotificationsModule.cs
  39. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.Domain/LINGYUN/Abp/MessageService/Notifications/NotificationStore.cs
  40. 4
      aspnet-core/modules/pushplus/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/PushPlus/AbpNotificationsPushPlusModule.cs
  41. 2
      aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN/Abp/BackgroundTasks/Notifications/AbpBackgroundTasksNotificationsModule.cs
  42. 4
      aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs
  43. 4
      aspnet-core/modules/wx-pusher/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/AbpNotificationsWxPusherModule.cs
  44. 2
      aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs
  45. 4
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/BackgroundJobs/NotificationPublishJob.cs
  46. 6
      aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs
  47. 2
      aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/AbpNotificationsTestsModule.cs
  48. 4
      aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/FakeNotificationSender.cs
  49. 4
      aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/NotificationsTestsDefinitionProvider_Tests.cs
  50. 2
      aspnet-core/tests/LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramTestsModule.cs
  51. 10
      aspnet-core/tests/LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests/LINGYUN/Abp/Notifications/WeChat/WeChatMiniProgramNotificationDataMapping_Tests.cs

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

@ -462,6 +462,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PushPlus.Settin
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.PushPlus", "modules\pushplus\LINGYUN.Abp.Notifications.PushPlus\LINGYUN.Abp.Notifications.PushPlus.csproj", "{2B7C1441-8801-4121-ABFB-03771E9DFE46}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "realtime", "realtime", "{ECC8B9A9-9E92-4493-984D-2E350A49189D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.Core", "modules\common\LINGYUN.Abp.Notifications.Core\LINGYUN.Abp.Notifications.Core.csproj", "{62971DAE-CE71-4E9C-B6F5-514C8E2B915C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Jobs", "modules\common\LINGYUN.Abp.Notifications.Jobs\LINGYUN.Abp.Notifications.Jobs.csproj", "{3E9D07D8-963C-4A61-B720-BD47593BE752}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1200,6 +1206,14 @@ Global
{2B7C1441-8801-4121-ABFB-03771E9DFE46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2B7C1441-8801-4121-ABFB-03771E9DFE46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2B7C1441-8801-4121-ABFB-03771E9DFE46}.Release|Any CPU.Build.0 = Release|Any CPU
{62971DAE-CE71-4E9C-B6F5-514C8E2B915C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{62971DAE-CE71-4E9C-B6F5-514C8E2B915C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{62971DAE-CE71-4E9C-B6F5-514C8E2B915C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{62971DAE-CE71-4E9C-B6F5-514C8E2B915C}.Release|Any CPU.Build.0 = Release|Any CPU
{3E9D07D8-963C-4A61-B720-BD47593BE752}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3E9D07D8-963C-4A61-B720-BD47593BE752}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3E9D07D8-963C-4A61-B720-BD47593BE752}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3E9D07D8-963C-4A61-B720-BD47593BE752}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1229,11 +1243,11 @@ Global
{3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{A5851F0F-CB0D-4E29-A829-D1BDEADB807B} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{FDEECE0D-6F66-4053-948E-9AC021B97C8D} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{B9FA1A02-A2BF-480D-914E-0780DAE442FC} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{59619184-02E7-4C61-8F96-89320CD7A3AE} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{865A2AE3-864B-4425-8FA6-AFD62F6466DB} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{81DF3392-38F4-41E9-8499-4F7EA8ADF4F2} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{4DFA9E60-E9CE-4FD3-A57F-F76EF3FF4873} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{B9FA1A02-A2BF-480D-914E-0780DAE442FC} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{59619184-02E7-4C61-8F96-89320CD7A3AE} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{865A2AE3-864B-4425-8FA6-AFD62F6466DB} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{81DF3392-38F4-41E9-8499-4F7EA8ADF4F2} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{4DFA9E60-E9CE-4FD3-A57F-F76EF3FF4873} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{371B293B-0CA9-4385-8EBB-5224332066D2} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
{608A3BD0-FC8D-48B0-B1C5-F3203A3BE99F} = {672E1170-7B18-474B-85C7-1961BF2A48AE}
{9E12ADBF-713B-4FE7-B71F-52B5078A57CE} = {3CDBA2A6-DC8A-48C5-8A6C-AF207394B43D}
@ -1302,7 +1316,7 @@ Global
{3B96F4D8-4993-419B-BCEB-AFE4ED39449F} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{FCFAF1AF-B3F6-45F3-85AB-8249EB8432CC} = {14CDBAD1-10C8-464A-B445-1F727C988010}
{97B4A37E-B93E-48C9-95D5-689CB9495D8B} = {3B96F4D8-4993-419B-BCEB-AFE4ED39449F}
{8C3312E7-F51E-4780-A893-CE0E0B80B579} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{8C3312E7-F51E-4780-A893-CE0E0B80B579} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{FE0F0889-C4AF-43C5-B851-B8CCC873BA2C} = {14CDBAD1-10C8-464A-B445-1F727C988010}
{B86EBB6F-A27F-4277-8265-937951A9DCB0} = {370D7CD5-1E17-4F3D-BBFA-03429F6D4F2F}
{35B17218-9FB6-439E-AF73-9A1454BC923C} = {B05CB08F-C088-4D6D-97EE-A94A5D1AE4A6}
@ -1396,7 +1410,7 @@ Global
{902D822A-52B6-481C-96C5-ECD891FF83FC} = {9EC33D45-CCC7-41DF-829E-6B89A640FE35}
{46244C99-3A0D-4D88-9F24-2B7B586ADBA4} = {CC362C67-6FC1-42B3-A130-8120AA8D790C}
{76A5564E-033B-4AA6-A22B-78B6EB134CC6} = {9EC33D45-CCC7-41DF-829E-6B89A640FE35}
{88502844-D83C-4541-96AC-A8291E261F63} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{88502844-D83C-4541-96AC-A8291E261F63} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{67DC7FA0-506A-4977-95F6-BC739B2BC4BA} = {F4923692-D343-4318-AECA-96F580B1A563}
{8DF55DAB-4C1D-46F7-9324-0050F47B3BED} = {F4923692-D343-4318-AECA-96F580B1A563}
{ABD89F39-62D9-439E-8662-BE4F36BFA04F} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
@ -1407,7 +1421,7 @@ Global
{4711320B-F98D-4CB0-BFEB-B9685B6CBCB7} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{130F8ED1-A64F-48DE-BF43-18EAD19CAF63} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{A53FE09E-6B1C-46C0-9422-C313D14AE9E4} = {ABD89F39-62D9-439E-8662-BE4F36BFA04F}
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61} = {8AC72641-30D3-4ACF-89FA-808FADC55C2E}
{0CE035CF-2D8A-4559-93EC-ADBEC4237C61} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{995DB1CE-A2FC-4468-A521-4207FD587EC5} = {90E88EAC-4291-4406-8D88-EFDF61B11292}
{AFFBE8EE-1B92-4CDF-8A4F-4000B78A0154} = {9E72FEB9-A626-4312-892B-CDD043879758}
{63FCC71F-1CEF-44D3-B95B-23EE58DE8C95} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
@ -1426,6 +1440,9 @@ Global
{82CB7E17-ED5A-4D26-B116-BA7B4226E43C} = {A8F1C9FA-4F16-43F9-8CC6-CCD124154440}
{102C3711-135E-446D-9A35-AEFB79993CAA} = {A8F1C9FA-4F16-43F9-8CC6-CCD124154440}
{2B7C1441-8801-4121-ABFB-03771E9DFE46} = {A8F1C9FA-4F16-43F9-8CC6-CCD124154440}
{ECC8B9A9-9E92-4493-984D-2E350A49189D} = {C5CAD011-DF84-4914-939C-0C029DCEF26F}
{62971DAE-CE71-4E9C-B6F5-514C8E2B915C} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
{3E9D07D8-963C-4A61-B720-BD47593BE752} = {ECC8B9A9-9E92-4493-984D-2E350A49189D}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C95FDF91-16F2-4A8B-A4BE-0E62D1B66718}

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

@ -264,12 +264,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.WxPusher.Settin
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.PushPlus.SettingManagement", "modules\pushplus\LINGYUN.Abp.PushPlus.SettingManagement\LINGYUN.Abp.PushPlus.SettingManagement.csproj", "{4CBB4A0C-6D23-44DD-BAF4-49D69ED35839}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Notifications.WxPusher.Tests", "tests\LINGYUN.Abp.Notifications.WxPusher.Tests\LINGYUN.Abp.Notifications.WxPusher.Tests.csproj", "{C2801414-550F-4A25-AD8D-68AC508211DC}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WxPusher.Tests", "tests\LINGYUN.Abp.Notifications.WxPusher.Tests\LINGYUN.Abp.Notifications.WxPusher.Tests.csproj", "{C2801414-550F-4A25-AD8D-68AC508211DC}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Tests", "tests\LINGYUN.Abp.Notifications.Tests\LINGYUN.Abp.Notifications.Tests.csproj", "{868A1718-4970-48D2-A256-08EF468302D8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests", "tests\LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests\LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests.csproj", "{B78E53AC-6BB8-402D-90CF-BEF1BD9558EB}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Core", "modules\common\LINGYUN.Abp.Notifications.Core\LINGYUN.Abp.Notifications.Core.csproj", "{AA039B4E-CE12-43AC-8340-3D52463E971E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -696,6 +698,10 @@ Global
{B78E53AC-6BB8-402D-90CF-BEF1BD9558EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B78E53AC-6BB8-402D-90CF-BEF1BD9558EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B78E53AC-6BB8-402D-90CF-BEF1BD9558EB}.Release|Any CPU.Build.0 = Release|Any CPU
{AA039B4E-CE12-43AC-8340-3D52463E971E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AA039B4E-CE12-43AC-8340-3D52463E971E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AA039B4E-CE12-43AC-8340-3D52463E971E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AA039B4E-CE12-43AC-8340-3D52463E971E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -830,6 +836,7 @@ Global
{C2801414-550F-4A25-AD8D-68AC508211DC} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{868A1718-4970-48D2-A256-08EF468302D8} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{B78E53AC-6BB8-402D-90CF-BEF1BD9558EB} = {B86C21A4-73B7-471E-B73A-B4B905EC9435}
{AA039B4E-CE12-43AC-8340-3D52463E971E} = {B91F26C5-B148-4094-B5F1-71E5F945DBED}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {06C707C6-02C0-411A-AD3B-2D0E13787CB8}

9
aspnet-core/LINGYUN.MicroService.TaskManagement.sln

@ -54,7 +54,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "extend-jobs", "extend-jobs"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Jobs", "modules\common\LINGYUN.Abp.Notifications.Jobs\LINGYUN.Abp.Notifications.Jobs.csproj", "{17D7ED0F-E789-4637-9B06-57DF693C6E1E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.BackgroundTasks.Notifications", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Notifications\LINGYUN.Abp.BackgroundTasks.Notifications.csproj", "{1978B64C-B2F5-4F68-9E5C-B45F948E7155}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.BackgroundTasks.Notifications", "modules\task-management\LINGYUN.Abp.BackgroundTasks.Notifications\LINGYUN.Abp.BackgroundTasks.Notifications.csproj", "{1978B64C-B2F5-4F68-9E5C-B45F948E7155}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "realtime", "realtime", "{18918B94-BB48-48F3-874D-B91B0252440A}"
EndProject
@ -68,6 +68,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dapr", "modules
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Dapr.Client", "modules\dapr\LINGYUN.Abp.Dapr.Client\LINGYUN.Abp.Dapr.Client.csproj", "{194DAB61-BC3C-4003-BFF0-C87763E7B8B0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Core", "modules\common\LINGYUN.Abp.Notifications.Core\LINGYUN.Abp.Notifications.Core.csproj", "{DD51A1AE-830F-4909-A729-7EBC398B17AD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -166,6 +168,10 @@ Global
{194DAB61-BC3C-4003-BFF0-C87763E7B8B0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{194DAB61-BC3C-4003-BFF0-C87763E7B8B0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{194DAB61-BC3C-4003-BFF0-C87763E7B8B0}.Release|Any CPU.Build.0 = Release|Any CPU
{DD51A1AE-830F-4909-A729-7EBC398B17AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD51A1AE-830F-4909-A729-7EBC398B17AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD51A1AE-830F-4909-A729-7EBC398B17AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD51A1AE-830F-4909-A729-7EBC398B17AD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -194,6 +200,7 @@ Global
{09F7171C-6DA1-4466-AB4A-DC92E93368EC} = {18918B94-BB48-48F3-874D-B91B0252440A}
{2FA23894-E598-4896-A336-3E7C682699D9} = {FA5E30C9-05E3-4E35-AEDD-7DC5534E3A01}
{194DAB61-BC3C-4003-BFF0-C87763E7B8B0} = {FA5E30C9-05E3-4E35-AEDD-7DC5534E3A01}
{DD51A1AE-830F-4909-A729-7EBC398B17AD} = {18918B94-BB48-48F3-874D-B91B0252440A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E1FD1F4C-D344-408B-97CF-B6F1F6D7D293}

11
aspnet-core/LINGYUN.MicroService.Workflow.sln

@ -73,9 +73,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.IM", "modules\common\LINGYUN.Abp.IM\LINGYUN.Abp.IM.csproj", "{8BE6BA3E-048E-4FC7-81DD-7FCD29AE2126}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Activities.Emailing", "modules\elsa\LINGYUN.Abp.Elsa.Activities.Emailing\LINGYUN.Abp.Elsa.Activities.Emailing.csproj", "{9E213E6F-77CB-4068-93EB-465C47FDA8FA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Elsa.Activities.Emailing", "modules\elsa\LINGYUN.Abp.Elsa.Activities.Emailing\LINGYUN.Abp.Elsa.Activities.Emailing.csproj", "{9E213E6F-77CB-4068-93EB-465C47FDA8FA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.Elsa.Activities", "modules\elsa\LINGYUN.Abp.Elsa.Activities\LINGYUN.Abp.Elsa.Activities.csproj", "{EEE9DF30-1901-4070-8E03-A8D8A0E10E34}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Elsa.Activities", "modules\elsa\LINGYUN.Abp.Elsa.Activities\LINGYUN.Abp.Elsa.Activities.csproj", "{EEE9DF30-1901-4070-8E03-A8D8A0E10E34}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.Notifications.Core", "modules\common\LINGYUN.Abp.Notifications.Core\LINGYUN.Abp.Notifications.Core.csproj", "{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -199,6 +201,10 @@ Global
{EEE9DF30-1901-4070-8E03-A8D8A0E10E34}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EEE9DF30-1901-4070-8E03-A8D8A0E10E34}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EEE9DF30-1901-4070-8E03-A8D8A0E10E34}.Release|Any CPU.Build.0 = Release|Any CPU
{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -236,6 +242,7 @@ Global
{8BE6BA3E-048E-4FC7-81DD-7FCD29AE2126} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
{9E213E6F-77CB-4068-93EB-465C47FDA8FA} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
{EEE9DF30-1901-4070-8E03-A8D8A0E10E34} = {F1CCBEC7-ACAB-4DC5-909E-D8CC2E1B7EEC}
{CE1B9AD0-7CDA-4459-86A3-A3162C1095D9} = {6DA78E72-BA55-4ECF-97DB-6258174D3E2A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {6BB7A5DE-DA12-44DC-BC9B-0F6CA524346F}

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/AbpNotificationsCommonModule.cs

@ -6,7 +6,7 @@ using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Notifications.Common;
[DependsOn(
typeof(AbpNotificationModule))]
typeof(AbpNotificationsModule))]
public class AbpNotificationsCommonModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

16
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN.Abp.Notifications.Core.csproj

@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\configureawait.props" />
<Import Project="..\..\..\common.props" />
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Volo.Abp.Localization.Abstractions" Version="$(VoloAbpPackageVersion)" />
<PackageReference Include="Volo.Abp.TextTemplating.Core" Version="$(VoloAbpPackageVersion)" />
</ItemGroup>
</Project>

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationTemplateDefinitionProvider.cs

44
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsCoreModule.cs

@ -0,0 +1,44 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using Volo.Abp.Modularity;
using Volo.Abp.TextTemplating;
namespace LINGYUN.Abp.Notifications;
[DependsOn(
typeof(AbpTextTemplatingCoreModule))]
public class AbpNotificationsCoreModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
AutoAddDefinitionProviders(context.Services);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
var preActions = context.Services.GetPreConfigureActions<AbpNotificationsOptions>();
Configure<AbpNotificationsOptions>(options =>
{
preActions.Configure(options);
});
}
private void AutoAddDefinitionProviders(IServiceCollection services)
{
var definitionProviders = new List<Type>();
services.OnRegistred(context =>
{
if (typeof(INotificationDefinitionProvider).IsAssignableFrom(context.ImplementationType))
{
definitionProviders.Add(context.ImplementationType);
}
});
Configure<AbpNotificationsOptions>(options =>
{
options.DefinitionProviders.AddIfNotContains(definitionProviders);
});
}
}

17
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/AbpNotificationsOptions.cs

@ -0,0 +1,17 @@
using Volo.Abp.Collections;
namespace LINGYUN.Abp.Notifications
{
public class AbpNotificationsOptions
{
/// <summary>
/// 自定义通知集合
/// </summary>
public ITypeList<INotificationDefinitionProvider> DefinitionProviders { get; }
public AbpNotificationsOptions()
{
DefinitionProviders = new TypeList<INotificationDefinitionProvider>();
}
}
}

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/DefaultNotifications.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/DefaultNotifications.cs

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionContext.cs

@ -1,6 +1,5 @@
using JetBrains.Annotations;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Notifications
{

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionManager.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/INotificationDefinitionProvider.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinition.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinition.cs

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionContext.cs

@ -2,7 +2,6 @@
using System.Collections.Generic;
using Volo.Abp;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Notifications
{

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionManager.cs

@ -11,7 +11,7 @@ namespace LINGYUN.Abp.Notifications
{
public class NotificationDefinitionManager : INotificationDefinitionManager, ISingletonDependency
{
protected AbpNotificationOptions Options { get; }
protected AbpNotificationsOptions Options { get; }
protected IDictionary<string, NotificationGroupDefinition> NotificationGroupDefinitions => _lazyNotificationGroupDefinitions.Value;
private readonly Lazy<Dictionary<string, NotificationGroupDefinition>> _lazyNotificationGroupDefinitions;
@ -22,7 +22,7 @@ namespace LINGYUN.Abp.Notifications
private readonly IServiceScopeFactory _serviceScopeFactory;
public NotificationDefinitionManager(
IOptions<AbpNotificationOptions> options,
IOptions<AbpNotificationsOptions> options,
IServiceScopeFactory serviceScopeFactory)
{
_serviceScopeFactory = serviceScopeFactory;

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationDefinitionProvider.cs

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationGroupDefinition.cs

@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Collections.Immutable;
using Volo.Abp;
using Volo.Abp.Localization;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.Notifications
{

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationLifetime.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationLifetime.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationProviderNames.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationProviderNames.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationReadState.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationReadState.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationSeverity.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationSeverity.cs

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationType.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Core/LINGYUN/Abp/Notifications/NotificationType.cs

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Emailing/LINGYUN/Abp/Notifications/Emailing/AbpNotificationsEmailingModule.cs

@ -5,14 +5,14 @@ using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.Emailing;
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpEmailingModule),
typeof(AbpIdentityDomainModule))]
public class AbpNotificationsEmailingModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<EmailingNotificationPublishProvider>();
options.NotificationDataMappings

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Jobs/LINGYUN/Abp/Notifications/Jobs/AbpNotificationsJobsModule.cs

@ -6,7 +6,7 @@ using Volo.Abp.VirtualFileSystem;
namespace LINGYUN.Abp.Notifications.Jobs;
[DependsOn(typeof(AbpNotificationModule))]
[DependsOn(typeof(AbpNotificationsModule))]
[DependsOn(typeof(AbpBackgroundTasksAbstractionsModule))]
public class AbpNotificationsJobsModule : AbpModule
{

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications.SignalR/LINGYUN/Abp/Notifications/SignalR/AbpNotificationsSignalRModule.cs

@ -4,13 +4,13 @@ using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.SignalR
{
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpAspNetCoreSignalRModule))]
public class AbpNotificationsSignalRModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<SignalRNotificationPublishProvider>();
options.NotificationDataMappings

4
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Sms/LINGYUN/Abp/Notifications/Sms/AbpNotificationsSmsModule.cs

@ -5,7 +5,7 @@ using Volo.Abp.Sms;
namespace LINGYUN.Abp.Notifications.Sms
{
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpSmsModule))]
public class AbpNotificationsSmsModule : AbpModule
{
@ -17,7 +17,7 @@ namespace LINGYUN.Abp.Notifications.Sms
preSmsActions.Configure(options);
});
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<SmsNotificationPublishProvider>();

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

@ -25,6 +25,7 @@
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.IdGenerator\LINGYUN.Abp.IdGenerator.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.Notifications.Core\LINGYUN.Abp.Notifications.Core.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.RealTime\LINGYUN.Abp.RealTime.csproj" />
</ItemGroup>

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

@ -1,35 +0,0 @@
using System;
using Volo.Abp.Collections;
namespace LINGYUN.Abp.Notifications
{
// TODO: 需要重命名 AbpNotificationsOptions
public class AbpNotificationOptions
{
/// <summary>
/// 自定义通知集合
/// </summary>
public ITypeList<INotificationDefinitionProvider> DefinitionProviders { get; }
/// <summary>
/// 发布者集合
/// </summary>
public ITypeList<INotificationPublishProvider> PublishProviders { get; }
/// <summary>
/// 可以自定义某个通知的格式
/// </summary>
public NotificationDataMappingDictionary NotificationDataMappings { get; }
/// <summary>
/// 过期时间
/// 默认60天
/// </summary>
public TimeSpan ExpirationTime { get; set; }
public AbpNotificationOptions()
{
PublishProviders = new TypeList<INotificationPublishProvider>();
DefinitionProviders = new TypeList<INotificationDefinitionProvider>();
NotificationDataMappings = new NotificationDataMappingDictionary();
ExpirationTime = TimeSpan.FromDays(60);
}
}
}

37
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationModule.cs → aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsModule.cs

@ -1,9 +1,6 @@
using LINGYUN.Abp.IdGenerator;
using LINGYUN.Abp.Notifications.Localization;
using LINGYUN.Abp.RealTime;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using Volo.Abp.BackgroundJobs;
using Volo.Abp.BackgroundWorkers;
using Volo.Abp.EventBus;
@ -18,6 +15,7 @@ namespace LINGYUN.Abp.Notifications
{
// TODO: 需要重命名 AbpNotificationsModule
[DependsOn(
typeof(AbpNotificationsCoreModule),
typeof(AbpBackgroundWorkersModule),
typeof(AbpBackgroundJobsAbstractionsModule),
typeof(AbpIdGeneratorModule),
@ -26,18 +24,13 @@ namespace LINGYUN.Abp.Notifications
typeof(AbpRealTimeModule),
typeof(AbpEventBusModule),
typeof(AbpTextTemplatingCoreModule))]
public class AbpNotificationModule : AbpModule
public class AbpNotificationsModule : AbpModule
{
public override void PreConfigureServices(ServiceConfigurationContext context)
{
AutoAddDefinitionProviders(context.Services);
}
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<AbpNotificationModule>();
options.FileSets.AddEmbedded<AbpNotificationsModule>();
});
Configure<AbpLocalizationOptions>(options =>
@ -51,30 +44,6 @@ namespace LINGYUN.Abp.Notifications
{
options.UnsupportedTypes.Add<NotificationInfo>();
});
var preActions = context.Services.GetPreConfigureActions<AbpNotificationOptions>();
Configure<AbpNotificationOptions>(options =>
{
preActions.Configure(options);
});
}
private void AutoAddDefinitionProviders(IServiceCollection services)
{
var definitionProviders = new List<Type>();
services.OnRegistred(context =>
{
if (typeof(INotificationDefinitionProvider).IsAssignableFrom(context.ImplementationType))
{
definitionProviders.Add(context.ImplementationType);
}
});
Configure<AbpNotificationOptions>(options =>
{
options.DefinitionProviders.AddIfNotContains(definitionProviders);
});
}
}
}

28
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/AbpNotificationsPublishOptions.cs

@ -0,0 +1,28 @@
using System;
using Volo.Abp.Collections;
namespace LINGYUN.Abp.Notifications;
public class AbpNotificationsPublishOptions
{
/// <summary>
/// 自定义通知发布提供者集合
/// </summary>
public ITypeList<INotificationPublishProvider> PublishProviders { get; }
/// <summary>
/// 可以自定义某个通知的格式
/// </summary>
public NotificationDataMappingDictionary NotificationDataMappings { get; }
/// <summary>
/// 过期时间
/// 默认60天
/// </summary>
public TimeSpan ExpirationTime { get; set; }
public AbpNotificationsPublishOptions()
{
PublishProviders = new TypeList<INotificationPublishProvider>();
NotificationDataMappings = new NotificationDataMappingDictionary();
ExpirationTime = TimeSpan.FromDays(60);
}
}

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/INotificationPublishProvider.cs

@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.Notifications

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

@ -40,13 +40,13 @@ namespace LINGYUN.Abp.Notifications
/// </summary>
protected IUnitOfWorkManager UnitOfWorkManager { get; }
protected AbpNotificationOptions Options { get; }
protected AbpNotificationsPublishOptions Options { get; }
public NotificationSender(
IClock clock,
IDistributedEventBus distributedEventBus,
IDistributedIdGenerator distributedIdGenerator,
IUnitOfWorkManager unitOfWorkManager,
IOptions<AbpNotificationOptions> options)
IOptions<AbpNotificationsPublishOptions> options)
{
Clock = clock;
Options = options.Value;

24
aspnet-core/modules/common/LINGYUN.Abp.Notifications/LINGYUN/Abp/Notifications/NotificationPublishProviderManager.cs

@ -1,5 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Options;
using System;
using System.Collections.Generic;
using System.Linq;
@ -11,23 +11,19 @@ namespace LINGYUN.Abp.Notifications
{
public List<INotificationPublishProvider> Providers => _lazyProviders.Value;
protected AbpNotificationOptions Options { get; }
private readonly Lazy<List<INotificationPublishProvider>> _lazyProviders;
public NotificationPublishProviderManager(
IServiceProvider serviceProvider,
IOptions<AbpNotificationOptions> options)
{
Options = options.Value;
_lazyProviders = new Lazy<List<INotificationPublishProvider>>(
() => Options
.PublishProviders
.Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider)
.ToList(),
true
);
IOptions<AbpNotificationsPublishOptions> options)
{
_lazyProviders = new Lazy<List<INotificationPublishProvider>>(
() => options.Value
.PublishProviders
.Select(type => serviceProvider.GetRequiredService(type) as INotificationPublishProvider)
.ToList(),
true
);
}
}
}

6
aspnet-core/modules/common/LINGYUN.Abp.Notifications/README.md

@ -3,12 +3,6 @@
实时通知基础模块
#### 注意
* 当前的通知数据模型 NotificationData 设计极度不合理
将在框架升级为4.0版本之后变更,将与现有通知数据不兼容(这可能就是敏捷开发的避免吧 ;) )
## 配置使用
```csharp

2
aspnet-core/modules/elsa/LINGYUN.Abp.Elsa.Activities.Notifications/LINGYUN/Abp/Elsa/Activities/Notifications/AbpElsaActivitiesNotificationsModule.cs

@ -5,7 +5,7 @@ namespace LINGYUN.Abp.Elsa.Activities.Notifications;
[DependsOn(
typeof(AbpElsaModule),
typeof(AbpNotificationModule))]
typeof(AbpNotificationsModule))]
public class AbpElsaActivitiesNotificationsModule : AbpModule
{
}

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

@ -33,7 +33,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
private readonly IUserSubscribeRepository _userSubscribeRepository;
private readonly AbpNotificationOptions _options;
private readonly AbpNotificationsPublishOptions _options;
public NotificationStore(
IClock clock,
@ -43,7 +43,7 @@ namespace LINGYUN.Abp.MessageService.Notifications
INotificationRepository notificationRepository,
IUserSubscribeRepository userSubscribeRepository,
IUserNotificationRepository userNotificationRepository,
IOptions<AbpNotificationOptions> options
IOptions<AbpNotificationsPublishOptions> options
)
{
_clock = clock;

4
aspnet-core/modules/pushplus/LINGYUN.Abp.Notifications.PushPlus/LINGYUN/Abp/Notifications/PushPlus/AbpNotificationsPushPlusModule.cs

@ -4,13 +4,13 @@ using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.PushPlus;
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpPushPlusModule))]
public class AbpNotificationsPushPlusModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<PushPlusNotificationPublishProvider>();
});

2
aspnet-core/modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN/Abp/BackgroundTasks/Notifications/AbpBackgroundTasksNotificationsModule.cs

@ -9,7 +9,7 @@ namespace LINGYUN.Abp.BackgroundTasks.Notifications;
[DependsOn(
typeof(AbpBackgroundTasksActivitiesModule),
typeof(AbpNotificationModule))]
typeof(AbpNotificationsModule))]
public class AbpBackgroundTasksNotificationsModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)

4
aspnet-core/modules/wechat/LINGYUN.Abp.Notifications.WeChat.MiniProgram/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramModule.cs

@ -6,7 +6,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
{
[DependsOn(
typeof(AbpWeChatMiniProgramModule),
typeof(AbpNotificationModule))]
typeof(AbpNotificationsModule))]
public class AbpNotificationsWeChatMiniProgramModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
@ -18,7 +18,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
preActions.Configure(options);
});
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<WeChatMiniProgramNotificationPublishProvider>();

4
aspnet-core/modules/wx-pusher/LINGYUN.Abp.Notifications.WxPusher/LINGYUN/Abp/Notifications/WxPusher/AbpNotificationsWxPusherModule.cs

@ -4,13 +4,13 @@ using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications.WxPusher;
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpWxPusherModule))]
public class AbpNotificationsWxPusherModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
options.PublishProviders.Add<WxPusherNotificationPublishProvider>();
});

2
aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/PlatformManagementHttpApiHostModule.cs

@ -70,7 +70,7 @@ namespace LY.MicroService.PlatformManagement;
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpAuthorizationOrganizationUnitsModule),
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpEmailingExceptionHandlingModule),
typeof(AbpCAPEventBusModule),
typeof(AbpFeaturesValidationRedisModule),

4
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/BackgroundJobs/NotificationPublishJob.cs

@ -10,11 +10,11 @@ namespace LY.MicroService.RealtimeMessage.BackgroundJobs;
public class NotificationPublishJob : AsyncBackgroundJob<NotificationPublishJobArgs>, ITransientDependency
{
protected AbpNotificationOptions Options { get; }
protected AbpNotificationsPublishOptions Options { get; }
protected IServiceScopeFactory ServiceScopeFactory { get; }
public NotificationPublishJob(
IOptions<AbpNotificationOptions> options,
IOptions<AbpNotificationsPublishOptions> options,
IServiceScopeFactory serviceScopeFactory)
{
Options = options.Value;

6
aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/EventBus/Distributed/NotificationEventHandler.cs

@ -35,9 +35,9 @@ namespace LY.MicroService.RealtimeMessage.EventBus.Distributed
/// </summary>
public ILogger<NotificationEventHandler> Logger { get; set; }
/// <summary>
/// Reference to <see cref="AbpNotificationOptions"/>.
/// Reference to <see cref="AbpNotificationsPublishOptions"/>.
/// </summary>
protected AbpNotificationOptions Options { get; }
protected AbpNotificationsPublishOptions Options { get; }
/// <summary>
/// Reference to <see cref="ICurrentTenant"/>.
/// </summary>
@ -84,7 +84,7 @@ namespace LY.MicroService.RealtimeMessage.EventBus.Distributed
ITemplateRenderer templateRenderer,
IBackgroundJobManager backgroundJobManager,
IStringLocalizerFactory stringLocalizerFactory,
IOptions<AbpNotificationOptions> options,
IOptions<AbpNotificationsPublishOptions> options,
INotificationStore notificationStore,
INotificationDefinitionManager notificationDefinitionManager,
INotificationSubscriptionManager notificationSubscriptionManager,

2
aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/AbpNotificationsTestsModule.cs

@ -4,7 +4,7 @@ using Volo.Abp.Modularity;
namespace LINGYUN.Abp.Notifications
{
[DependsOn(
typeof(AbpNotificationModule),
typeof(AbpNotificationsModule),
typeof(AbpTestsBaseModule))]
public class AbpNotificationsTestsModule : AbpModule
{

4
aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/FakeNotificationSender.cs

@ -17,7 +17,7 @@ public class FakeNotificationSender : INotificationSender, ITransientDependency
{
public ILogger<FakeNotificationSender> Logger { get; set; }
protected AbpNotificationOptions Options { get; }
protected AbpNotificationsPublishOptions Options { get; }
protected IJsonSerializer JsonSerializer { get; }
@ -37,7 +37,7 @@ public class FakeNotificationSender : INotificationSender, ITransientDependency
IJsonSerializer jsonSerializer,
ITemplateRenderer templateRenderer,
IStringLocalizerFactory stringLocalizerFactory,
IOptions<AbpNotificationOptions> options,
IOptions<AbpNotificationsPublishOptions> options,
INotificationStore notificationStore,
INotificationDefinitionManager notificationDefinitionManager,
INotificationSubscriptionManager notificationSubscriptionManager,

4
aspnet-core/tests/LINGYUN.Abp.Notifications.Tests/LINGYUN/Abp/Notifications/NotificationsTestsDefinitionProvider_Tests.cs

@ -17,14 +17,14 @@ namespace LINGYUN.Abp.Notifications
public void GetGroups_Test()
{
var groups = NotificationDefinitionManager.GetGroups();
groups.Count.ShouldBe(1);
groups.Count.ShouldBe(2);
}
[Fact]
public void GetAll_Test()
{
var notifications = NotificationDefinitionManager.GetAll();
notifications.Count.ShouldBe(3);
notifications.Count.ShouldBe(6);
}
[Fact]

2
aspnet-core/tests/LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests/LINGYUN/Abp/Notifications/WeChat/MiniProgram/AbpNotificationsWeChatMiniProgramTestsModule.cs

@ -20,7 +20,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
public override void ConfigureServices(ServiceConfigurationContext context)
{
// 自定义数据处理方法
Configure<AbpNotificationOptions>(options =>
Configure<AbpNotificationsPublishOptions>(options =>
{
// 这条通知返回标准化的通知
options.NotificationDataMappings

10
aspnet-core/tests/LINGYUN.Abp.Notifications.WeChat.MiniProgram.Tests/LINGYUN/Abp/Notifications/WeChat/WeChatMiniProgramNotificationDataMapping_Tests.cs

@ -8,11 +8,11 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
public class WeChatMiniProgramNotificationDataMapping_Tests : AbpNotificationsWeChatMiniProgramTestsBase
{
private readonly NotificationData _notificationData;
protected AbpNotificationOptions NotificationOptions { get; }
protected AbpNotificationsPublishOptions NotificationsPublishOptions { get; }
protected AbpNotificationsWeChatMiniProgramOptions NotificationWeChatMiniProgramOptions { get; }
public WeChatMiniProgramNotificationDataMapping_Tests()
{
NotificationOptions = GetRequiredService<IOptions<AbpNotificationOptions>>().Value;
NotificationsPublishOptions = GetRequiredService<IOptions<AbpNotificationsPublishOptions>>().Value;
NotificationWeChatMiniProgramOptions = GetRequiredService<IOptions<AbpNotificationsWeChatMiniProgramOptions>>().Value;
_notificationData = new NotificationData();
@ -30,7 +30,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
[Fact]
public void Mapping_WeChatMiniProgram_Notification_Data_Test()
{
var mappingOpenIdItem = NotificationOptions
var mappingOpenIdItem = NotificationsPublishOptions
.NotificationDataMappings
.GetMapItemOrDefault(WeChatMiniProgramNotificationPublishProvider.ProviderName, NotificationsTestsNames.Test1);
@ -47,7 +47,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
[Fact]
public void Mapping_Standard_Notification_Data_Test()
{
var mappingStandardItem = NotificationOptions
var mappingStandardItem = NotificationsPublishOptions
.NotificationDataMappings
.GetMapItemOrDefault(WeChatMiniProgramNotificationPublishProvider.ProviderName, NotificationsTestsNames.Test2);
@ -62,7 +62,7 @@ namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram
[Fact]
public void Mapping_Origin_Notification_Data_Test()
{
var mappingOriginItem = NotificationOptions
var mappingOriginItem = NotificationsPublishOptions
.NotificationDataMappings
.GetMapItemOrDefault(WeChatMiniProgramNotificationPublishProvider.ProviderName, NotificationsTestsNames.Test3);

Loading…
Cancel
Save