mirror of
https://github.com/CyberL1/MyMcRealms.git
synced 2024-11-24 06:58:22 -05:00
feat: notifications
This commit is contained in:
parent
70d3e0d686
commit
eb5a402cde
76
MyMcRealms/Controllers/NotificationsController.cs
Normal file
76
MyMcRealms/Controllers/NotificationsController.cs
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MyMcRealms.Attributes;
|
||||||
|
|
||||||
|
// TODO: Add Notification typing class
|
||||||
|
namespace MyMcRealms.Controllers
|
||||||
|
{
|
||||||
|
[Route("[controller]")]
|
||||||
|
[ApiController]
|
||||||
|
[RequireMinecraftCookie]
|
||||||
|
public class NotificationsController : ControllerBase
|
||||||
|
{
|
||||||
|
[HttpGet]
|
||||||
|
public Object GetNotifications()
|
||||||
|
{
|
||||||
|
var n1 = new
|
||||||
|
{
|
||||||
|
NotificationUuid = "8e19f84925bf4efbacec9bed53d74696",
|
||||||
|
Dismissable = true,
|
||||||
|
Seen = false,
|
||||||
|
Type = "visitUrl",
|
||||||
|
Url = "https://my-mc.link/",
|
||||||
|
ButtonText = new
|
||||||
|
{
|
||||||
|
TranslationKey = "mco.notification.visitUrl.message.default",
|
||||||
|
Args = new List<object> { }
|
||||||
|
},
|
||||||
|
Message = new {
|
||||||
|
TranslationKey = "mco.notification.visitUrl.message.default",
|
||||||
|
Args = new List <object> { }
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var n2 = new {
|
||||||
|
NotificationUuid = "8e116d026aa643b394a2dfbcaaabb7ff",
|
||||||
|
Dismissable = true,
|
||||||
|
Seen = false,
|
||||||
|
Type = "infoPopup",
|
||||||
|
Title = new {
|
||||||
|
TranslationKey = "mco.notification.visitUrl.message.default",
|
||||||
|
Args = new List<object> { }
|
||||||
|
},
|
||||||
|
Message = new {
|
||||||
|
TranslationKey = "mco.notification.visitUrl.message.default",
|
||||||
|
Args = new List<Object> { }
|
||||||
|
},
|
||||||
|
Image = "notification/1",
|
||||||
|
UrlButton = new {
|
||||||
|
Url = "https://my-mc.link/",
|
||||||
|
UrlText = new {
|
||||||
|
TranslationKey = "mco.notification.visitUrl.message.default",
|
||||||
|
Args = new List<Object> { }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var notifs = new
|
||||||
|
{
|
||||||
|
Notifications = /* new List<Object> { n1, n2 } */ new List<Object> { }
|
||||||
|
};
|
||||||
|
|
||||||
|
return notifs;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("seen")]
|
||||||
|
public List<object> MarkAsSeenNotifications()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost("dissmiss")]
|
||||||
|
public List<object> DissmissNotifications()
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -52,7 +52,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasIndex("WorldId");
|
b.HasIndex("WorldId");
|
||||||
|
|
||||||
b.ToTable("Backups");
|
b.ToTable("Backups", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Configuration", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Configuration", b =>
|
||||||
@ -66,7 +66,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasKey("Key");
|
b.HasKey("Key");
|
||||||
|
|
||||||
b.ToTable("Configuration");
|
b.ToTable("Configuration", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Connection", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Connection", b =>
|
||||||
@ -91,7 +91,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasIndex("WorldId");
|
b.HasIndex("WorldId");
|
||||||
|
|
||||||
b.ToTable("Connections");
|
b.ToTable("Connections", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Invite", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Invite", b =>
|
||||||
@ -120,7 +120,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasIndex("WorldId");
|
b.HasIndex("WorldId");
|
||||||
|
|
||||||
b.ToTable("Invites");
|
b.ToTable("Invites", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Player", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Player", b =>
|
||||||
@ -159,7 +159,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasIndex("WorldId");
|
b.HasIndex("WorldId");
|
||||||
|
|
||||||
b.ToTable("Players");
|
b.ToTable("Players", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Subscription", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Subscription", b =>
|
||||||
@ -185,7 +185,7 @@ namespace MyMcRealms.Migrations
|
|||||||
b.HasIndex("WorldId")
|
b.HasIndex("WorldId")
|
||||||
.IsUnique();
|
.IsUnique();
|
||||||
|
|
||||||
b.ToTable("Subscriptions");
|
b.ToTable("Subscriptions", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.World", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.World", b =>
|
||||||
@ -240,7 +240,7 @@ namespace MyMcRealms.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.ToTable("Worlds");
|
b.ToTable("Worlds", (string)null);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("MyMcRealms.Entities.Backup", b =>
|
modelBuilder.Entity("MyMcRealms.Entities.Backup", b =>
|
||||||
|
Loading…
Reference in New Issue
Block a user