From 1f23110f3a33b1079af22d6062277818bbd7f173 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E5=86=9B?= <510423039@qq.com>
Date: Fri, 27 Aug 2021 23:53:39 +0800
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E5=8D=87=E7=BA=A7abp=E5=88=B04.4.0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
aspnet-core/CompanyName.ProjectName.sln | 13 +
aspnet-core/Directory.Build.props | 2 +-
aspnet-core/common.props | 2 +-
.../AbpCapConsumerServiceSelector.cs | 129 ++
.../AbpCapDistributedEventBus.cs | 156 ++
.../AbpCapModule.cs | 10 +
.../AbpCapServiceCollectionExtensions.cs | 22 +
.../CompanyName.ProjectName.CAP.csproj | 13 +
...taDictionaryManagement.HttpApi.Host.csproj | 18 +-
.../Logs/logs.txt | 4 +-
...aryManagement.Application.Contracts.csproj | 6 +-
...ataDictionaryManagement.Application.csproj | 6 +-
...aDictionaryManagement.Domain.Shared.csproj | 4 +-
...ame.DataDictionaryManagement.Domain.csproj | 4 +-
...onaryManagement.EntityFrameworkCore.csproj | 4 +-
...DictionaryManagement.HttpApi.Client.csproj | 4 +-
...me.DataDictionaryManagement.HttpApi.csproj | 2 +-
...me.DataDictionaryManagement.MongoDB.csproj | 4 +-
...anagement.EntityFrameworkCore.Tests.csproj | 2 +-
...e.DataDictionaryManagement.TestBase.csproj | 6 +-
...ionManagement.Application.Contracts.csproj | 2 +-
.../Hubs/INotificationHub.cs | 22 +
.../Dtos/CreateNotificationInput.cs | 44 +
.../Notifications/Dtos/SendNotificationDto.cs | 23 +
.../Notifications/INotificationAppService.cs | 36 +
....NotificationManagement.Application.csproj | 4 +-
.../Hubs/NotificationHub.cs | 14 +
...NotificationManagementApplicationModule.cs | 22 +-
.../Notifications/NotificationAppService.cs | 80 +
...otificationManagement.Domain.Shared.csproj | 2 +-
...tName.NotificationManagement.Domain.csproj | 2 +-
...ationManagement.EntityFrameworkCore.csproj | 2 +-
...tificationManagement.HttpApi.Client.csproj | 2 +-
...Name.NotificationManagement.MongoDB.csproj | 2 +-
...eryManagement.Application.Contracts.csproj | 6 +-
...ectName.QueryManagement.Application.csproj | 6 +-
...tName.QueryManagement.Domain.Shared.csproj | 4 +-
....ProjectName.QueryManagement.Domain.csproj | 4 +-
...QueryManagement.EntityFrameworkCore.csproj | 4 +-
...ctName.QueryManagement.FreeSqlMySql.csproj | 2 +-
.../Systems/Users/UserFreeSqlRepository.cs | 3 +-
...Name.QueryManagement.HttpApi.Client.csproj | 4 +-
...ProjectName.QueryManagement.HttpApi.csproj | 2 +-
...ProjectName.QueryManagement.MongoDB.csproj | 4 +-
...anagement.EntityFrameworkCore.Tests.csproj | 2 +-
...rojectName.QueryManagement.TestBase.csproj | 6 +-
...e.ProjectName.Application.Contracts.csproj | 2 +-
.../AuditLogs/AuditLogAppService.cs | 2 +
...mpanyName.ProjectName.Domain.Shared.csproj | 2 +-
...panyName.ProjectName.HttpApi.Client.csproj | 2 +-
...ompanyName.ProjectName.HttpApi.Host.csproj | 2 +-
.../Logs/logs.txt | 1897 ++++++++++-------
.../Logs/logs.txt | 4 +-
.../package.json | 2 +-
.../yarn.lock | 190 +-
55 files changed, 1824 insertions(+), 994 deletions(-)
create mode 100644 aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapConsumerServiceSelector.cs
create mode 100644 aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapDistributedEventBus.cs
create mode 100644 aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapModule.cs
create mode 100644 aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapServiceCollectionExtensions.cs
create mode 100644 aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/CompanyName.ProjectName.CAP.csproj
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Hubs/INotificationHub.cs
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/Dtos/CreateNotificationInput.cs
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/Dtos/SendNotificationDto.cs
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application.Contracts/Notifications/INotificationAppService.cs
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Hubs/NotificationHub.cs
create mode 100644 aspnet-core/modules/NotificationManagement/src/CompanyName.ProjectName.NotificationManagement.Application/Notifications/NotificationAppService.cs
diff --git a/aspnet-core/CompanyName.ProjectName.sln b/aspnet-core/CompanyName.ProjectName.sln
index 1b079abd..134d9a42 100644
--- a/aspnet-core/CompanyName.ProjectName.sln
+++ b/aspnet-core/CompanyName.ProjectName.sln
@@ -163,6 +163,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.Dat
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{8C1B8C6C-C518-4290-B070-622CCA6004DA}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CAP", "CAP", "{2C09EED0-5AF6-4F1E-B05A-FB3272EDF6E8}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompanyName.ProjectName.CAP", "frameworks\CAP\src\CompanyName.ProjectName.CAP\CompanyName.ProjectName.CAP.csproj", "{F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -401,6 +407,10 @@ Global
{8D196E3D-6F95-4793-B948-79669AF09017}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8D196E3D-6F95-4793-B948-79669AF09017}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8D196E3D-6F95-4793-B948-79669AF09017}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -479,6 +489,9 @@ Global
{8C1B8C6C-C518-4290-B070-622CCA6004DA} = {2C861ADD-76E9-4B3B-8A3C-638EBB67D683}
{E6D5BF0E-DE92-4D82-A352-EF04B37CB11C} = {8C1B8C6C-C518-4290-B070-622CCA6004DA}
{073C361E-B8F4-49F5-93CC-72A3FF49C026} = {8C1B8C6C-C518-4290-B070-622CCA6004DA}
+ {2C09EED0-5AF6-4F1E-B05A-FB3272EDF6E8} = {CC2EBB07-A070-4158-AB37-A0C0BBAEA9F5}
+ {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6} = {2C09EED0-5AF6-4F1E-B05A-FB3272EDF6E8}
+ {F59B3C43-0B54-4A3A-AA28-1A50F59D2FC3} = {11ED8435-B5AE-4BF3-9D4B-51FA1E4A18A6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F}
diff --git a/aspnet-core/Directory.Build.props b/aspnet-core/Directory.Build.props
index 8bd32743..e0590569 100644
--- a/aspnet-core/Directory.Build.props
+++ b/aspnet-core/Directory.Build.props
@@ -1,7 +1,7 @@
- 4.3.3
+ 4.4.0
\ No newline at end of file
diff --git a/aspnet-core/common.props b/aspnet-core/common.props
index c94b49d6..9ea0f671 100644
--- a/aspnet-core/common.props
+++ b/aspnet-core/common.props
@@ -5,6 +5,6 @@
$(NoWarn);CS1591;CS0436
app
true
- 4.3.3
+ 4.4.0
\ No newline at end of file
diff --git a/aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapConsumerServiceSelector.cs b/aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapConsumerServiceSelector.cs
new file mode 100644
index 00000000..edac83d6
--- /dev/null
+++ b/aspnet-core/frameworks/CAP/src/CompanyName.ProjectName.CAP/AbpCapConsumerServiceSelector.cs
@@ -0,0 +1,129 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection;
+using DotNetCore.CAP;
+using DotNetCore.CAP.Internal;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Options;
+using Volo.Abp.DependencyInjection;
+using Volo.Abp.EventBus;
+using Volo.Abp.EventBus.Distributed;
+
+namespace CompanyName.ProjectName.CAP
+{
+ [Dependency(ServiceLifetime.Singleton, ReplaceServices = true)]
+ [ExposeServices(typeof(IConsumerServiceSelector))]
+ public class BeeAbpCapConsumerServiceSelector : ConsumerServiceSelector
+ {
+ protected AbpDistributedEventBusOptions AbpDistributedEventBusOptions { get; }
+ protected IServiceProvider ServiceProvider { get; }
+
+ ///
+ /// Creates a new .
+ ///
+ public BeeAbpCapConsumerServiceSelector(
+ IServiceProvider serviceProvider,
+ IOptions distributedEventBusOptions)
+ : base(serviceProvider)
+ {
+ ServiceProvider = serviceProvider;
+ AbpDistributedEventBusOptions = distributedEventBusOptions.Value;
+ }
+
+ protected override IEnumerable FindConsumersFromInterfaceTypes(IServiceProvider provider)
+ {
+ var executorDescriptorList = base.FindConsumersFromInterfaceTypes(provider).ToList();
+
+ //handlers
+ var handlers = AbpDistributedEventBusOptions.Handlers;
+
+ foreach (var handler in handlers)
+ {
+ var interfaces = handler.GetInterfaces();
+ foreach (var @interface in interfaces)
+ {
+ if (!typeof(IEventHandler).GetTypeInfo().IsAssignableFrom(@interface))
+ {
+ continue;
+ }
+ var genericArgs = @interface.GetGenericArguments();
+
+ if (genericArgs.Length != 1)
+ {
+ continue;
+ }
+
+ var descriptors = GetHandlerDescription(genericArgs[0], handler);
+
+ foreach (var descriptor in descriptors)
+ {
+ var count = executorDescriptorList.Count(x =>
+ x.Attribute.Name == descriptor.Attribute.Name);
+
+ descriptor.Attribute.Group = descriptor.Attribute.Group.Insert(
+ descriptor.Attribute.Group.LastIndexOf(".", StringComparison.Ordinal), $".{count}");
+
+ executorDescriptorList.Add(descriptor);
+ }
+
+ //Subscribe(genericArgs[0], new IocEventHandlerFactory(ServiceScopeFactory, handler));
+ }
+ }
+ return executorDescriptorList;
+ }
+
+ protected virtual IEnumerable GetHandlerDescription(Type eventType,Type typeInfo)
+ {
+ var serviceTypeInfo = typeof(IDistributedEventHandler<>)
+ .MakeGenericType(eventType);
+ var method = typeInfo
+ .GetMethod(
+ nameof(IDistributedEventHandler