feat: upgrade to .NET 6, refactor everything

This commit is contained in:
spiral
2021-11-26 21:10:56 -05:00
parent d28e99ba43
commit 1918c56937
314 changed files with 27954 additions and 27966 deletions

View File

@@ -1,40 +1,35 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using PluralKit.Core;
namespace PluralKit.API
namespace PluralKit.API;
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}")]
public class MetaController: ControllerBase
{
[ApiController]
[ApiVersion("1.0")]
[Route("v{version:apiVersion}")]
public class MetaController: ControllerBase
private readonly IDatabase _db;
private readonly ModelRepository _repo;
public MetaController(IDatabase db, ModelRepository repo)
{
private readonly IDatabase _db;
private readonly ModelRepository _repo;
public MetaController(IDatabase db, ModelRepository repo)
{
_db = db;
_repo = repo;
}
_db = db;
_repo = repo;
}
[HttpGet("meta")]
public async Task<ActionResult<JObject>> GetMeta()
{
await using var conn = await _db.Obtain();
var shards = await _repo.GetShards();
[HttpGet("meta")]
public async Task<ActionResult<JObject>> GetMeta()
{
await using var conn = await _db.Obtain();
var shards = await _repo.GetShards();
var o = new JObject();
o.Add("shards", shards.ToJSON());
o.Add("version", BuildInfoService.Version);
var o = new JObject();
o.Add("shards", shards.ToJSON());
o.Add("version", BuildInfoService.Version);
return Ok(o);
}
return Ok(o);
}
}