Rename Subscription response to SubscriptionResponse

This commit is contained in:
CyberL1 2024-03-18 11:07:04 +01:00
parent 007132bab3
commit 08b698f099
2 changed files with 3 additions and 3 deletions

View File

@ -16,13 +16,13 @@ namespace Minecraft_Realms_Emulator.Controllers
_context = context;
}
[HttpGet("{id}")]
public async Task<ActionResult<Subscription>> Get(int id)
public async Task<ActionResult<SubscriptionResponse>> 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,

View File

@ -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; }