feat(apiv2): group stubs, authentication middleware, /systems/:id endpoint

This commit is contained in:
spiral
2021-10-01 21:50:01 -04:00
parent 8a88b23021
commit 57722e035b
6 changed files with 227 additions and 6 deletions

View File

@@ -16,13 +16,12 @@ namespace PluralKit.API
{
public SystemControllerV2(IServiceProvider svc) : base(svc) { }
[HttpGet("{system}")]
public async Task<IActionResult> SystemGet(string system)
[HttpGet("{systemRef}")]
public async Task<IActionResult> SystemGet(string systemRef)
{
return new ObjectResult("Unimplemented")
{
StatusCode = 501
};
var system = await ResolveSystem(systemRef);
if (system == null) return NotFound();
else return Ok(system.ToJson(LookupContextFor(system)));
}
[HttpPatch("{system}")]