Browse Source

fix: the query notification identifier is incorrect

pull/609/head
cKey 4 years ago
parent
commit
bc2092eafb
  1. 16
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN.Abp.Notifications.Common.csproj
  2. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/en.tpl
  3. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/zh-Hans.tpl
  4. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/en.tpl
  5. 1
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/zh-Hans.tpl
  6. 14
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/NotificationsCommonNotificationDefinitionProvider.cs
  7. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/en.tpl
  8. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/zh-Hans.tpl
  9. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/en.tpl
  10. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/zh-Hans.tpl
  11. 2
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NotificationsCommonTemplateProvider.cs
  12. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/en.tpl
  13. 3
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/zh-Hans.tpl
  14. 0
      aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/layout.tpl
  15. 4
      aspnet-core/modules/message/LINGYUN.Abp.MessageService.EntityFrameworkCore/LINGYUN/Abp/MessageService/Notifications/EfCoreUserNotificationRepository.cs

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

@ -9,18 +9,18 @@
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\ExceptionNotifier\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\layout.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\NewTenantRegisterd\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Emailing\Templates\WelcomeToApplication\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Templates\ExceptionNotifier\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Templates\layout.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Templates\NewTenantRegisterd\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Templates\WelcomeToApplication\*.tpl" />
<None Remove="LINGYUN\Abp\Notifications\Localization\Common\*.json" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\ExceptionNotifier\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\layout.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\NewTenantRegisterd\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Emailing\Templates\WelcomeToApplication\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Templates\ExceptionNotifier\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Templates\layout.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Templates\NewTenantRegisterd\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Templates\WelcomeToApplication\*.tpl" />
<EmbeddedResource Include="LINGYUN\Abp\Notifications\Localization\Common\*.json" />
</ItemGroup>

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/en.tpl

@ -1 +0,0 @@
<h3>A new tenant {{model.name}} has been created.</h3>

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/NewTenantRegisterd/zh-Hans.tpl

@ -1 +0,0 @@
<h3>一个新的租户 {{model.name}} 已建立,切换租户开始! </h3>

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/en.tpl

@ -1 +0,0 @@
<h3>{{model.name}}, Welcome to my application!</h3>

1
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/WelcomeToApplication/zh-Hans.tpl

@ -1 +0,0 @@
<h3>{{model.name}}, 欢迎您的加入!</h3>

14
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);
});
}

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/en.tpl → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/en.tpl

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/ExceptionNotifier/zh-Hans.tpl → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/ExceptionNotifier/zh-Hans.tpl

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/en.tpl

@ -0,0 +1,3 @@
<h1>{{title}}</h1>
<h3>A new tenant {{model.name}} has been created.</h3>

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/NewTenantRegisterd/zh-Hans.tpl

@ -0,0 +1,3 @@
<h1>{{title}}</h1>
<h3>一个新的租户 {{model.name}} 已建立,切换租户开始! </h3>

2
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/NotificationsCommonTemplateProvider.cs → 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)
};
}
}

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/en.tpl

@ -0,0 +1,3 @@
<h1>{{title}}</h1>
<h3>{{model.name}}, Welcome to my application!</h3>

3
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/WelcomeToApplication/zh-Hans.tpl

@ -0,0 +1,3 @@
<h1>{{title}}</h1>
<h3>{{model.name}}, 欢迎您的加入!</h3>

0
aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Emailing/Templates/layout.tpl → aspnet-core/modules/common/LINGYUN.Abp.Notifications.Common/LINGYUN/Abp/Notifications/Templates/layout.tpl

4
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<Notification>()
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));
}

Loading…
Cancel
Save