2021-10-15 11:08:41 +00:00
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
|
|
using Newtonsoft.Json.Linq;
|
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
namespace PluralKit.API;
|
|
|
|
|
|
|
|
[ApiController]
|
|
|
|
[ApiVersion("2.0")]
|
|
|
|
[Route("v{version:apiVersion}")]
|
|
|
|
public class PrivateControllerV2: PKControllerBase
|
2021-10-15 11:08:41 +00:00
|
|
|
{
|
2021-11-27 02:10:56 +00:00
|
|
|
public PrivateControllerV2(IServiceProvider svc) : base(svc) { }
|
2021-10-15 11:08:41 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
[HttpGet("meta")]
|
|
|
|
public async Task<ActionResult<JObject>> Meta()
|
|
|
|
{
|
|
|
|
var shards = await _repo.GetShards();
|
|
|
|
var stats = await _repo.GetStats();
|
2021-10-15 11:08:41 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
var o = new JObject();
|
|
|
|
o.Add("shards", shards.ToJSON());
|
|
|
|
o.Add("stats", stats.ToJson());
|
2021-10-15 11:08:41 +00:00
|
|
|
|
2021-11-27 02:10:56 +00:00
|
|
|
return Ok(o);
|
2021-10-15 11:08:41 +00:00
|
|
|
}
|
|
|
|
}
|