mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-22 23:30:13 +01:00
NotificationConnector SendNotification public
This commit is contained in:
parent
e6f8853b49
commit
e1bfdd675b
@ -9,7 +9,7 @@ public class Gotify(string endpoint, string appToken)
|
||||
public string Endpoint { get; init; } = endpoint;
|
||||
public string AppToken { get; init; } = appToken;
|
||||
|
||||
protected override void SendNotificationInternal(string title, string notificationText)
|
||||
public override void SendNotification(string title, string notificationText)
|
||||
{
|
||||
MessageData message = new(title, notificationText);
|
||||
HttpRequestMessage request = new(HttpMethod.Post, $"{endpoint}/message");
|
||||
|
@ -7,7 +7,7 @@ public class Lunasea(string id)
|
||||
: NotificationConnector(TokenGen.CreateToken(typeof(Lunasea), 64), NotificationConnectorType.LunaSea)
|
||||
{
|
||||
public string Id { get; init; } = id;
|
||||
protected override void SendNotificationInternal(string title, string notificationText)
|
||||
public override void SendNotification(string title, string notificationText)
|
||||
{
|
||||
MessageData message = new(title, notificationText);
|
||||
HttpRequestMessage request = new(HttpMethod.Post, $"https://notify.lunasea.app/v1/custom/{id}");
|
||||
|
@ -16,5 +16,5 @@ public abstract class NotificationConnector(string notificationConnectorId, Noti
|
||||
[NotMapped]
|
||||
protected readonly HttpClient _client = new();
|
||||
|
||||
protected abstract void SendNotificationInternal(string title, string notificationText);
|
||||
public abstract void SendNotification(string title, string notificationText);
|
||||
}
|
@ -45,7 +45,7 @@ public class Ntfy : NotificationConnector
|
||||
return ret;
|
||||
}
|
||||
|
||||
protected override void SendNotificationInternal(string title, string notificationText)
|
||||
public override void SendNotification(string title, string notificationText)
|
||||
{
|
||||
MessageData message = new(title, Topic, notificationText);
|
||||
HttpRequestMessage request = new(HttpMethod.Post, $"{this.Endpoint}?auth={this.Auth}");
|
||||
|
Loading…
x
Reference in New Issue
Block a user