mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 07:40:13 +01:00
Add NotificationUrgency.cs
This commit is contained in:
parent
99ddb06d6d
commit
e6f8853b49
@ -120,7 +120,7 @@ using (var scope = app.Services.CreateScope())
|
|||||||
context.Jobs.RemoveRange(context.Jobs.Where(j => j.state == JobState.Completed && j.RecurrenceMs < 1));
|
context.Jobs.RemoveRange(context.Jobs.Where(j => j.state == JobState.Completed && j.RecurrenceMs < 1));
|
||||||
|
|
||||||
string[] emojis = { "(•‿•)", "(づ \u25d5‿\u25d5 )づ", "( \u02d8\u25bd\u02d8)っ\u2668", "=\uff3e\u25cf \u22cf \u25cf\uff3e=", "(ΦωΦ)", "(\u272a\u3268\u272a)", "( ノ・o・ )ノ", "(〜^\u2207^ )〜", "~(\u2267ω\u2266)~","૮ \u00b4• ﻌ \u00b4• ა", "(\u02c3ᆺ\u02c2)", "(=\ud83d\udf66 \u0f1d \ud83d\udf66=)"};
|
string[] emojis = { "(•‿•)", "(づ \u25d5‿\u25d5 )づ", "( \u02d8\u25bd\u02d8)っ\u2668", "=\uff3e\u25cf \u22cf \u25cf\uff3e=", "(ΦωΦ)", "(\u272a\u3268\u272a)", "( ノ・o・ )ノ", "(〜^\u2207^ )〜", "~(\u2267ω\u2266)~","૮ \u00b4• ﻌ \u00b4• ა", "(\u02c3ᆺ\u02c2)", "(=\ud83d\udf66 \u0f1d \ud83d\udf66=)"};
|
||||||
context.Notifications.Add(new Notification("Tranga Started", emojis[Random.Shared.Next(0, emojis.Length - 1)], 2));
|
context.Notifications.Add(new Notification("Tranga Started", emojis[Random.Shared.Next(0, emojis.Length - 1)], NotificationUrgency.High));
|
||||||
|
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
|
|
||||||
|
@ -4,12 +4,12 @@ using Microsoft.EntityFrameworkCore;
|
|||||||
namespace API.Schema;
|
namespace API.Schema;
|
||||||
|
|
||||||
[PrimaryKey("NotificationId")]
|
[PrimaryKey("NotificationId")]
|
||||||
public class Notification(string title, string message = "", byte urgency = 2, DateTime? date = null)
|
public class Notification(string title, string message = "", NotificationUrgency urgency = NotificationUrgency.Normal, DateTime? date = null)
|
||||||
{
|
{
|
||||||
[MaxLength(64)]
|
[MaxLength(64)]
|
||||||
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification", 64);
|
public string NotificationId { get; init; } = TokenGen.CreateToken("Notification", 64);
|
||||||
|
|
||||||
public byte Urgency { get; init; } = urgency;
|
public NotificationUrgency Urgency { get; init; } = urgency;
|
||||||
|
|
||||||
public string Title { get; init; } = title;
|
public string Title { get; init; } = title;
|
||||||
|
|
||||||
|
8
API/Schema/NotificationUrgency.cs
Normal file
8
API/Schema/NotificationUrgency.cs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
namespace API.Schema;
|
||||||
|
|
||||||
|
public enum NotificationUrgency : byte
|
||||||
|
{
|
||||||
|
Low = 1,
|
||||||
|
Normal = 3,
|
||||||
|
High = 5
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user