committed by
GitHub
10 changed files with 192 additions and 56 deletions
@ -0,0 +1,18 @@ |
|||
namespace LINGYUN.Abp.Notifications; |
|||
|
|||
public static class DefaultNotifications |
|||
{ |
|||
public const string GroupName = "Abp.Notifications"; |
|||
/// <summary>
|
|||
/// 站内通知
|
|||
/// </summary>
|
|||
public const string OnsideNotice = GroupName + ".OnsideNotice"; |
|||
/// <summary>
|
|||
/// 活动通知
|
|||
/// </summary>
|
|||
public const string ActivityNotice = GroupName + ".ActivityNotice"; |
|||
/// <summary>
|
|||
/// 系统通知
|
|||
/// </summary>
|
|||
public const string SystemNotice = GroupName + ".SystemNotice"; |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
using LINGYUN.Abp.Notifications.Localization; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Notifications.Internal; |
|||
|
|||
internal class DefaultNotificationDefinitionProvider : NotificationDefinitionProvider |
|||
{ |
|||
public override void Define(INotificationDefinitionContext context) |
|||
{ |
|||
var internalGroup = context.AddGroup( |
|||
DefaultNotifications.GroupName, |
|||
L("Notifications:Internal")); |
|||
|
|||
internalGroup.AddNotification( |
|||
DefaultNotifications.OnsideNotice, |
|||
L("Notifications:OnsideNotice"), |
|||
L("Notifications:OnsideNoticeDesc"), |
|||
notificationType: NotificationType.Application, |
|||
lifetime: NotificationLifetime.Persistent, |
|||
allowSubscriptionToClients: true) |
|||
.WithProviders(NotificationProviderNames.SignalR); |
|||
internalGroup.AddNotification( |
|||
DefaultNotifications.ActivityNotice, |
|||
L("Notifications:ActivityNotice"), |
|||
L("Notifications:ActivityNoticeDesc"), |
|||
notificationType: NotificationType.Application, |
|||
lifetime: NotificationLifetime.Persistent, |
|||
allowSubscriptionToClients: true) |
|||
.WithProviders(NotificationProviderNames.SignalR); |
|||
internalGroup.AddNotification( |
|||
DefaultNotifications.SystemNotice, |
|||
L("Notifications:SystemNotice"), |
|||
L("Notifications:SystemNoticeDesc"), |
|||
notificationType: NotificationType.System, |
|||
lifetime: NotificationLifetime.Persistent, |
|||
allowSubscriptionToClients: true) |
|||
.WithProviders(NotificationProviderNames.SignalR); |
|||
} |
|||
|
|||
protected LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<NotificationsResource>(name); |
|||
} |
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace LINGYUN.Abp.Notifications.Localization; |
|||
|
|||
[LocalizationResourceName("Notifications")] |
|||
public class NotificationsResource |
|||
{ |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Notifications:Internal": "Internal", |
|||
"Notifications:OnsideNotice": "Onside", |
|||
"Notifications:OnsideNoticeDesc": "In-app notification push", |
|||
"Notifications:ActivityNotice": "Activity", |
|||
"Notifications:ActivityNoticeDesc": "The administrator delivers an event notification push", |
|||
"Notifications:SystemNotice": "System", |
|||
"Notifications:SystemNoticeDesc": "System global notification push" |
|||
} |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Notifications:Internal": "内置通知", |
|||
"Notifications:OnsideNotice": "站内通知", |
|||
"Notifications:OnsideNoticeDesc": "应用内部通知推送", |
|||
"Notifications:ActivityNotice": "活动通知", |
|||
"Notifications:ActivityNoticeDesc": "管理员下发活动通知推送", |
|||
"Notifications:SystemNotice": "系统通知", |
|||
"Notifications:SystemNoticeDesc": "系统全局消息推送" |
|||
} |
|||
} |
|||
Loading…
Reference in new issue