Tranga/API/Schema/NotificationConnectors/NotificationConnector.cs

20 lines
760 B
C#
Raw Normal View History

2024-12-14 21:53:29 +01:00
using System.ComponentModel.DataAnnotations;
2024-12-16 17:42:16 +01:00
using System.ComponentModel.DataAnnotations.Schema;
2024-12-14 21:53:29 +01:00
using Microsoft.EntityFrameworkCore;
2024-12-16 17:42:16 +01:00
using Newtonsoft.Json;
2024-12-14 21:53:29 +01:00
namespace API.Schema.NotificationConnectors;
[PrimaryKey("NotificationConnectorId")]
public abstract class NotificationConnector(string notificationConnectorId, NotificationConnectorType notificationConnectorType)
2024-12-14 21:53:29 +01:00
{
[MaxLength(64)]
public string NotificationConnectorId { get; } = notificationConnectorId;
public NotificationConnectorType NotificationConnectorType { get; init; } = notificationConnectorType;
2024-12-16 17:42:16 +01:00
[JsonIgnore]
[NotMapped]
protected readonly HttpClient _client = new();
public abstract void SendNotification(string title, string notificationText);
2024-12-14 21:53:29 +01:00
}