diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj index a1cf305d7..d1bba1c0c 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj @@ -9,18 +9,18 @@ - - - - + + + + - - - - + + + + diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/en.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/en.tpl deleted file mode 100644 index 7dc4cf5a8..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/en.tpl +++ /dev/null @@ -1 +0,0 @@ -

A new tenant {{model.name}} has been created.

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/zh-Hans.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/zh-Hans.tpl deleted file mode 100644 index b00146366..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/zh-Hans.tpl +++ /dev/null @@ -1 +0,0 @@ -

一个新的租户 {{model.name}} 已建立,切换租户开始!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/en.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/en.tpl deleted file mode 100644 index 5ef5dc0e7..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/en.tpl +++ /dev/null @@ -1 +0,0 @@ -

{{model.name}}, Welcome to my application!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/zh-Hans.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/zh-Hans.tpl deleted file mode 100644 index 78c40dc93..000000000 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/zh-Hans.tpl +++ /dev/null @@ -1 +0,0 @@ -

{{model.name}}, 欢迎您的加入!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs index fd60c0863..05b27cc00 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs @@ -22,14 +22,12 @@ public class NotificationsCommonNotificationDefinitionProvider : NotificationDef lifetime: NotificationLifetime.Persistent, allowSubscriptionToClients: false) // 指定通知提供程序 - .WithProviders( - NotificationProviderNames.SignalR, - NotificationProviderNames.Emailing) + .WithProviders(NotificationProviderNames.Emailing) // 设定为模板通知 .WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout") .WithTemplate(template => { - template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier", isInlineLocalized: false); + template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier", isInlineLocalized: false); }); var tenantsGroup = context.AddGroup( @@ -48,10 +46,10 @@ public class NotificationsCommonNotificationDefinitionProvider : NotificationDef .WithProviders( NotificationProviderNames.SignalR, NotificationProviderNames.Emailing) - .WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout") + .WithTemplate(typeof(NotificationsResource)) .WithTemplate(template => { - template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd", isInlineLocalized: false); + template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd", isInlineLocalized: false); }); var usersGroup = context.AddGroup( @@ -68,10 +66,10 @@ public class NotificationsCommonNotificationDefinitionProvider : NotificationDef .WithProviders( NotificationProviderNames.SignalR, NotificationProviderNames.Emailing) - .WithTemplate(typeof(NotificationsResource), layout: "EmailNotifierLayout") + .WithTemplate(typeof(NotificationsResource)) .WithTemplate(template => { - template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication", isInlineLocalized: false); + template.WithVirtualFilePath("/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication", isInlineLocalized: false); }); } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/en.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/en.tpl similarity index 100% rename from aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/en.tpl rename to aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/en.tpl diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/zh-Hans.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/zh-Hans.tpl similarity index 100% rename from aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/zh-Hans.tpl rename to aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/zh-Hans.tpl diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/en.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/en.tpl new file mode 100644 index 000000000..2a54a7a0b --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/en.tpl @@ -0,0 +1,3 @@ +

{{title}}

+ +

A new tenant {{model.name}} has been created.

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/zh-Hans.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/zh-Hans.tpl new file mode 100644 index 000000000..1bde1e133 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/zh-Hans.tpl @@ -0,0 +1,3 @@ +

{{title}}

+ +

一个新的租户 {{model.name}} 已建立,切换租户开始!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NotificationsCommonTemplateProvider.cs similarity index 88% rename from aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs rename to aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NotificationsCommonTemplateProvider.cs index 2678d777a..8e6cdcfbb 100644 --- a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NotificationsCommonTemplateProvider.cs @@ -17,7 +17,7 @@ public class NotificationsCommonTemplateProvider : TemplateDefinitionProvider name: "EmailNotifierLayout", defaultCultureName: "en", isLayout: true) - .WithVirtualFilePath( "/LINGYUN/Abp/Notifications/Emailing/Templates/layout.tpl", isInlineLocalized: true) + .WithVirtualFilePath( "/LINGYUN/Abp/Notifications/Templates/layout.tpl", isInlineLocalized: true) }; } } diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/en.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/en.tpl new file mode 100644 index 000000000..5b7379d8a --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/en.tpl @@ -0,0 +1,3 @@ +

{{title}}

+ +

{{model.name}}, Welcome to my application!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/zh-Hans.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/zh-Hans.tpl new file mode 100644 index 000000000..84ddabd92 --- /dev/null +++ b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/zh-Hans.tpl @@ -0,0 +1,3 @@ +

{{title}}

+ +

{{model.name}}, 欢迎您的加入!

\ No newline at end of file diff --git a/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/layout.tpl b/aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/layout.tpl similarity index 100% rename from aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/layout.tpl rename to aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/layout.tpl diff --git a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs index ff3f6440d..de724f3aa 100644 --- a/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs +++ b/aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs @@ -46,7 +46,7 @@ namespace LINGYUN.Abp.MessageService.Notifications var notifilerQuery = from un in userNotifilerQuery join n in dbContext.Set() on un.NotificationId equals n.NotificationId - where n.Id.Equals(notificationId) + where n.NotificationId.Equals(notificationId) select new UserNotificationInfo { Id = n.NotificationId, @@ -70,7 +70,7 @@ namespace LINGYUN.Abp.MessageService.Notifications CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) - .Where(x => x.UserId.Equals(userId) && notificationIds.Contains(x.Id)) + .Where(x => x.UserId.Equals(userId) && notificationIds.Contains(x.NotificationId)) .ToListAsync(GetCancellationToken(cancellationToken)); }