Move worlds/v1/{wId}/join/pc under WorldsController.cs

This commit is contained in:
CyberL1 2024-02-23 14:44:50 +01:00
parent 3554314302
commit 8a82279ef2
2 changed files with 8 additions and 27 deletions

View File

@ -1,26 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Minecraft_Realms_Emulator.Data;
using Minecraft_Realms_Emulator.Entities;
namespace Minecraft_Realms_Emulator.Controllers
{
[Route("worlds/v1/{worldId}/join/pc")]
[ApiController]
public class JoinController : ControllerBase
{
private readonly DataContext _context;
public JoinController(DataContext context)
{
_context = context;
}
[HttpGet()]
public ActionResult<Connection> Join(int worldId)
{
var connection = _context.Connections.FirstOrDefault(x => x.World.Id == worldId);
return Ok(connection);
}
}
}

View File

@ -2,7 +2,6 @@
using Microsoft.EntityFrameworkCore;
using Minecraft_Realms_Emulator.Data;
using Minecraft_Realms_Emulator.Entities;
using System.Collections.Immutable;
namespace Minecraft_Realms_Emulator.Controllers
{
@ -191,5 +190,13 @@ namespace Minecraft_Realms_Emulator.Controllers
return Ok(worldBackups);
}
[HttpGet("v1/{wId}/join/pc")]
public ActionResult<Connection> Join(int wId)
{
var connection = _context.Connections.FirstOrDefault(x => x.World.Id == wId);
return Ok(connection);
}
}
}