mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Merge branch 'master' into patch-2
This commit is contained in:
commit
af4da8fd72
51 changed files with 2838 additions and 1518 deletions
|
|
@ -48,9 +48,9 @@ namespace PluralKit.API.Controllers
|
|||
|
||||
[HttpGet]
|
||||
[RequiresSystem]
|
||||
public async Task<ActionResult<PKSystem>> GetOwnSystem()
|
||||
public Task<ActionResult<PKSystem>> GetOwnSystem()
|
||||
{
|
||||
return Ok(_auth.CurrentSystem);
|
||||
return Task.FromResult<ActionResult<PKSystem>>(Ok(_auth.CurrentSystem));
|
||||
}
|
||||
|
||||
[HttpGet("{hid}")]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Microsoft.AspNetCore.Builder;
|
||||
using App.Metrics;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
|
|
@ -28,12 +29,16 @@ namespace PluralKit.API
|
|||
.AddTransient<MemberStore>()
|
||||
.AddTransient<SwitchStore>()
|
||||
.AddTransient<MessageStore>()
|
||||
|
||||
.AddSingleton(svc => InitUtils.InitMetrics(svc.GetRequiredService<CoreConfig>(), "API"))
|
||||
|
||||
.AddScoped<TokenAuthService>()
|
||||
|
||||
.AddTransient(_ => Configuration.GetSection("PluralKit").Get<CoreConfig>() ?? new CoreConfig())
|
||||
.AddSingleton(svc => InitUtils.InitLogger(svc.GetRequiredService<CoreConfig>(), "api"))
|
||||
.AddSingleton(svc => new DbConnectionFactory(svc.GetRequiredService<CoreConfig>().Database));
|
||||
|
||||
.AddTransient<DbConnectionCountHolder>()
|
||||
.AddTransient<DbConnectionFactory>();
|
||||
}
|
||||
|
||||
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue