feat(api): separate private endpoints from public API versioning

This commit is contained in:
spiral
2022-01-19 19:29:51 -05:00
parent eb4f53c69e
commit 9f7c47b78e
3 changed files with 35 additions and 59 deletions

View File

@@ -1,25 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace PluralKit.API;
[ApiController]
[Route("v2")]
public class PrivateControllerV2: PKControllerBase
{
public PrivateControllerV2(IServiceProvider svc) : base(svc) { }
[HttpGet("meta")]
public async Task<ActionResult<JObject>> Meta()
{
var shards = await _repo.GetShards();
var stats = await _repo.GetStats();
var o = new JObject();
o.Add("shards", shards.ToJSON());
o.Add("stats", stats.ToJson());
return Ok(o);
}
}