Version API endpoints

This commit is contained in:
Ske 2019-07-10 00:23:41 +02:00
parent 204404bd8d
commit 802eeb8d39
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ namespace PluralKit.API.Controllers
{ {
[ApiController] [ApiController]
[Route("m")] [Route("m")]
[Route("v1/m")]
public class MemberController: ControllerBase public class MemberController: ControllerBase
{ {
private MemberStore _members; private MemberStore _members;

View File

@ -30,6 +30,7 @@ namespace PluralKit.API.Controllers
[ApiController] [ApiController]
[Route("s")] [Route("s")]
[Route("v1/s")]
public class SystemController : ControllerBase public class SystemController : ControllerBase
{ {
private SystemStore _systems; private SystemStore _systems;
@ -68,7 +69,7 @@ namespace PluralKit.API.Controllers
[HttpGet("{hid}/switches")] [HttpGet("{hid}/switches")]
public async Task<ActionResult<IEnumerable<SwitchesReturn>>> GetSwitches(string hid, [FromQuery(Name = "before")] Instant? before) public async Task<ActionResult<IEnumerable<SwitchesReturn>>> GetSwitches(string hid, [FromQuery(Name = "before")] Instant? before)
{ {
if (before == default(Instant)) before = SystemClock.Instance.GetCurrentInstant(); if (before == null) before = SystemClock.Instance.GetCurrentInstant();
var system = await _systems.GetByHid(hid); var system = await _systems.GetByHid(hid);
if (system == null) return NotFound("System not found."); if (system == null) return NotFound("System not found.");