mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 14:50:50 +01:00
This allows plugins to create custom dbcontexts, which would be namespaced in the scheme with a prefix. Migrations are supported too and the table would be prefixed too
38 lines
1.3 KiB
C#
38 lines
1.3 KiB
C#
using BTCPayServer.Abstractions.Contracts;
|
|
using BTCPayServer.Models.NotificationViewModels;
|
|
|
|
namespace BTCPayServer.Services.Notifications.Blobs
|
|
{
|
|
internal class NewVersionNotification:BaseNotification
|
|
{
|
|
private const string TYPE = "newversion";
|
|
internal class Handler : NotificationHandler<NewVersionNotification>
|
|
{
|
|
public override string NotificationType => TYPE;
|
|
public override (string identifier, string name)[] Meta
|
|
{
|
|
get
|
|
{
|
|
return new (string identifier, string name)[] {(TYPE, "New version")};
|
|
}
|
|
}
|
|
|
|
protected override void FillViewModel(NewVersionNotification notification, NotificationViewModel vm)
|
|
{
|
|
vm.Body = $"New version {notification.Version} released!";
|
|
vm.ActionLink = $"https://github.com/btcpayserver/btcpayserver/releases/tag/v{notification.Version}";
|
|
}
|
|
}
|
|
public NewVersionNotification()
|
|
{
|
|
|
|
}
|
|
public NewVersionNotification(string version)
|
|
{
|
|
Version = version;
|
|
}
|
|
public string Version { get; set; }
|
|
public override string Identifier => TYPE;
|
|
public override string NotificationType => TYPE;
|
|
}
|
|
}
|