mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-01-18 21:32:27 +01:00
Renaming to BaseNotification
This commit is contained in:
parent
0dab96f0a6
commit
113869bd08
@ -5,6 +5,6 @@ namespace BTCPayServer.Events
|
||||
internal class NotificationEvent
|
||||
{
|
||||
internal string[] ApplicationUserIds { get; set; }
|
||||
internal NotificationBase Notification { get; set; }
|
||||
internal BaseNotification Notification { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,11 @@ namespace BTCPayServer.Models.NotificationViewModels
|
||||
{
|
||||
public static NotificationViewModel ViewModel(this NotificationData data)
|
||||
{
|
||||
var baseType = typeof(NotificationBase);
|
||||
var baseType = typeof(BaseNotification);
|
||||
|
||||
var fullTypeName = baseType.FullName.Replace(nameof(NotificationBase), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
||||
var fullTypeName = baseType.FullName.Replace(nameof(BaseNotification), data.NotificationType, StringComparison.OrdinalIgnoreCase);
|
||||
var parsedType = baseType.Assembly.GetType(fullTypeName);
|
||||
var instance = Activator.CreateInstance(parsedType) as NotificationBase;
|
||||
var instance = Activator.CreateInstance(parsedType) as BaseNotification;
|
||||
|
||||
var casted = JsonConvert.DeserializeObject(ZipUtils.Unzip(data.Blob), parsedType);
|
||||
var obj = new NotificationViewModel
|
||||
|
@ -5,10 +5,10 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace BTCPayServer.Services.Notifications.Blobs
|
||||
{
|
||||
// Make sure to keep all NotificationEventBase classes in same namespace
|
||||
// Make sure to keep all Blob Notification classes in same namespace
|
||||
// because of dependent initialization and parsing to view models logic
|
||||
// IndexViewModel.cs#32
|
||||
internal abstract class NotificationBase
|
||||
internal abstract class BaseNotification
|
||||
{
|
||||
internal virtual string NotificationType { get { return GetType().Name; } }
|
||||
|
@ -4,7 +4,7 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace BTCPayServer.Services.Notifications.Blobs
|
||||
{
|
||||
internal class NewVersionNotification : NotificationBase
|
||||
internal class NewVersionNotification : BaseNotification
|
||||
{
|
||||
internal override string NotificationType => "NewVersionNotification";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user