mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-12-22 04:18:21 -05:00
Rename Subscription
response to SubscriptionResponse
This commit is contained in:
parent
007132bab3
commit
08b698f099
@ -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,
|
||||
|
@ -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; }
|
Loading…
Reference in New Issue
Block a user