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