refactor: remove asp.net versioning

This commit is contained in:
spiral
2022-01-19 19:25:04 -05:00
parent 1626e0f548
commit eb4f53c69e
14 changed files with 119 additions and 36 deletions

View File

@@ -7,8 +7,7 @@ using PluralKit.Core;
namespace PluralKit.API;
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/a")]
[Route("v1/a")]
public class AccountController: ControllerBase
{
private readonly IDatabase _db;

View File

@@ -10,8 +10,7 @@ using PluralKit.Core;
namespace PluralKit.API;
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/m")]
[Route("v1/m")]
public class MemberController: ControllerBase
{
private readonly IDatabase _db;

View File

@@ -7,8 +7,7 @@ using PluralKit.Core;
namespace PluralKit.API;
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/msg")]
[Route("v1")]
public class MessageController: ControllerBase
{
private readonly IDatabase _db;
@@ -20,7 +19,7 @@ public class MessageController: ControllerBase
_db = db;
}
[HttpGet("{mid}")]
[HttpGet("msg/{mid}")]
public async Task<ActionResult<JObject>> GetMessage(ulong mid)
{
var msg = await _db.Execute(c => _repo.GetMessage(c, mid));

View File

@@ -7,8 +7,7 @@ using PluralKit.Core;
namespace PluralKit.API;
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}")]
[Route("v1")]
public class MetaController: ControllerBase
{
private readonly IDatabase _db;

View File

@@ -31,8 +31,7 @@ public struct PostSwitchParams
}
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}/s")]
[Route("v1/s")]
public class SystemController: ControllerBase
{
private readonly IDatabase _db;