From 937e5aeb8c44a5cf8f42f016f92fef7a2f27bdeb Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Fri, 23 Feb 2024 14:59:36 +0100 Subject: [PATCH] feat: news --- .../Controllers/McoController.cs | 14 +++++++++++++- .../Responses/NewsResponse.cs | 7 +++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Minecraft-Realms-Emulator/Responses/NewsResponse.cs diff --git a/Minecraft-Realms-Emulator/Controllers/McoController.cs b/Minecraft-Realms-Emulator/Controllers/McoController.cs index bf24600..dbd29bc 100644 --- a/Minecraft-Realms-Emulator/Controllers/McoController.cs +++ b/Minecraft-Realms-Emulator/Controllers/McoController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Minecraft_Realms_Emulator.Responses; namespace Minecraft_Realms_Emulator.Controllers.Mco { @@ -8,7 +9,7 @@ namespace Minecraft_Realms_Emulator.Controllers.Mco { [HttpGet("available")] public bool GetAvailable() - { + { return true; } @@ -17,5 +18,16 @@ namespace Minecraft_Realms_Emulator.Controllers.Mco { return Compatility.COMPATIBLE.ToString(); } + + [HttpGet("v1/news")] + public NewsResponse GetNews() + { + var news = new NewsResponse + { + NewsLink = "https://github.com/CyberL1/Minecraft-Realms-Emulator" + }; + + return news; + } } } \ No newline at end of file diff --git a/Minecraft-Realms-Emulator/Responses/NewsResponse.cs b/Minecraft-Realms-Emulator/Responses/NewsResponse.cs new file mode 100644 index 0000000..ce8deba --- /dev/null +++ b/Minecraft-Realms-Emulator/Responses/NewsResponse.cs @@ -0,0 +1,7 @@ +namespace Minecraft_Realms_Emulator.Responses +{ + public class NewsResponse + { + public string NewsLink { get; set; } = string.Empty; + } +}