From 08b698f099b2916bd67f38c9df748153c45613b1 Mon Sep 17 00:00:00 2001 From: CyberL1 Date: Mon, 18 Mar 2024 11:07:04 +0100 Subject: [PATCH] Rename `Subscription` response to `SubscriptionResponse` --- .../Controllers/SubscriptionsController.cs | 4 ++-- .../Responses/{Subscription.cs => SubscriptionResponse.cs} | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) rename Minecraft-Realms-Emulator/Responses/{Subscription.cs => SubscriptionResponse.cs} (84%) diff --git a/Minecraft-Realms-Emulator/Controllers/SubscriptionsController.cs b/Minecraft-Realms-Emulator/Controllers/SubscriptionsController.cs index ec6c542..74892a8 100644 --- a/Minecraft-Realms-Emulator/Controllers/SubscriptionsController.cs +++ b/Minecraft-Realms-Emulator/Controllers/SubscriptionsController.cs @@ -16,13 +16,13 @@ namespace Minecraft_Realms_Emulator.Controllers _context = context; } [HttpGet("{id}")] - public async Task> Get(int id) + public async Task> Get(int id) { var world = await _context.Worlds.Include(w => w.Subscription).FirstOrDefaultAsync(w => w.Id == id); if (world?.Subscription == null) return NotFound("Subscription not found"); - var sub = new Subscription + var sub = new SubscriptionResponse { StartDate = ((DateTimeOffset)world.Subscription.StartDate).ToUnixTimeMilliseconds(), DaysLeft = ((DateTimeOffset)world.Subscription.StartDate.AddDays(30) - DateTime.Today).Days, diff --git a/Minecraft-Realms-Emulator/Responses/Subscription.cs b/Minecraft-Realms-Emulator/Responses/SubscriptionResponse.cs similarity index 84% rename from Minecraft-Realms-Emulator/Responses/Subscription.cs rename to Minecraft-Realms-Emulator/Responses/SubscriptionResponse.cs index 3b02630..59fd82f 100644 --- a/Minecraft-Realms-Emulator/Responses/Subscription.cs +++ b/Minecraft-Realms-Emulator/Responses/SubscriptionResponse.cs @@ -1,6 +1,6 @@ namespace Minecraft_Realms_Emulator.Responses { - public class Subscription + public class SubscriptionResponse { public long StartDate { get; set; } public int DaysLeft { get; set; }