mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-03-13 11:35:51 +01:00
Providing overridable NotificationType property, direct mapping
This commit is contained in:
parent
294dad01c3
commit
1f35534dfb
1 changed files with 3 additions and 5 deletions
|
@ -1,8 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using BTCPayServer.Data;
|
||||
using BTCPayServer.Models.NotificationViewModels;
|
||||
using ExchangeSharp;
|
||||
|
@ -12,6 +8,8 @@ namespace BTCPayServer.Events.Notifications
|
|||
{
|
||||
public abstract class NotificationEventBase
|
||||
{
|
||||
public virtual string NotificationType { get { return GetType().Name; } }
|
||||
|
||||
public NotificationData ToData()
|
||||
{
|
||||
var obj = JsonConvert.SerializeObject(this);
|
||||
|
@ -19,7 +17,7 @@ namespace BTCPayServer.Events.Notifications
|
|||
var data = new NotificationData
|
||||
{
|
||||
Created = DateTimeOffset.UtcNow,
|
||||
NotificationType = GetType().Name,
|
||||
NotificationType = NotificationType,
|
||||
Blob = obj.ToBytesUTF8(),
|
||||
Seen = false
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue