mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 22:07:55 +00:00
feat(apiv2): stubs
This commit is contained in:
parent
f785fa1204
commit
8a88b23021
10 changed files with 355 additions and 28 deletions
40
PluralKit.API/Controllers/v2/MiscControllerV2.cs
Normal file
40
PluralKit.API/Controllers/v2/MiscControllerV2.cs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
using PluralKit.Core;
|
||||
|
||||
namespace PluralKit.API
|
||||
{
|
||||
[ApiController]
|
||||
[ApiVersion("2.0")]
|
||||
[Route("v{version:apiVersion}")]
|
||||
public class MetaControllerV2: PKControllerBase
|
||||
{
|
||||
public MetaControllerV2(IServiceProvider svc) : base(svc) { }
|
||||
|
||||
[HttpGet("meta")]
|
||||
public async Task<ActionResult<JObject>> Meta()
|
||||
{
|
||||
await using var conn = await _db.Obtain();
|
||||
var shards = await _repo.GetShards(conn);
|
||||
|
||||
var o = new JObject();
|
||||
o.Add("shards", shards.ToJSON());
|
||||
|
||||
return Ok(o);
|
||||
}
|
||||
|
||||
[HttpGet("messages/{message_id}")]
|
||||
public async Task<IActionResult> MessageGet(ulong message_id)
|
||||
{
|
||||
return new ObjectResult("Unimplemented")
|
||||
{
|
||||
StatusCode = 501
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue