mirror of
https://github.com/C9Glax/tranga.git
synced 2025-06-12 06:27:54 +02:00
Schema add Notifications
This commit is contained in:
24
API/Schema/Notification.cs
Normal file
24
API/Schema/Notification.cs
Normal file
@ -0,0 +1,24 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace API.Schema;
|
||||
|
||||
[PrimaryKey("AltTitleId")]
|
||||
public class Notification(string title, string message = "", Notification.NotificationUrgency notificationUrgency = Notification.NotificationUrgency.Normal)
|
||||
{
|
||||
[MaxLength(64)]
|
||||
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification", 64);
|
||||
|
||||
public NotificationUrgency Urgency { get; init; } = notificationUrgency;
|
||||
|
||||
public string Title { get; init; } = title;
|
||||
|
||||
public string Message { get; init; } = message;
|
||||
|
||||
public enum NotificationUrgency : byte
|
||||
{
|
||||
Low = 0,
|
||||
Normal = 1,
|
||||
High = 3
|
||||
}
|
||||
}
|
@ -18,6 +18,7 @@ public class PgsqlContext(DbContextOptions<PgsqlContext> options) : DbContext(op
|
||||
public DbSet<MangaAltTitle> AltTitles { get; set; }
|
||||
public DbSet<LibraryConnector> LibraryConnectors { get; set; }
|
||||
public DbSet<NotificationConnector> NotificationConnectors { get; set; }
|
||||
public DbSet<Notification> Notifications { get; set; }
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
||||
{
|
||||
|
Reference in New Issue
Block a user