mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-09 03:04:20 -04:00
Swagger: Adding every module, not just the core
This commit is contained in:
parent
ba37a7cb9b
commit
340950177e
@ -177,6 +177,7 @@ namespace Kyoo.Authentication.Views
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
|
public async Task GetProfileDataAsync(ProfileDataRequestContext context)
|
||||||
{
|
{
|
||||||
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
||||||
@ -187,6 +188,7 @@ namespace Kyoo.Authentication.Views
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
[ApiExplorerSettings(IgnoreApi = true)]
|
||||||
public async Task IsActiveAsync(IsActiveContext context)
|
public async Task IsActiveAsync(IsActiveContext context)
|
||||||
{
|
{
|
||||||
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
User user = await _users.GetOrDefault(int.Parse(context.Subject.GetSubjectId()));
|
||||||
|
@ -138,7 +138,9 @@ namespace Kyoo.Core
|
|||||||
{
|
{
|
||||||
string publicUrl = _configuration.GetPublicUrl();
|
string publicUrl = _configuration.GetPublicUrl();
|
||||||
|
|
||||||
services.AddMvc().AddControllersAsServices();
|
services.AddMvcCore()
|
||||||
|
.AddControllersAsServices()
|
||||||
|
.AddApiExplorer();
|
||||||
services.AddControllers()
|
services.AddControllers()
|
||||||
.AddNewtonsoftJson(x =>
|
.AddNewtonsoftJson(x =>
|
||||||
{
|
{
|
||||||
|
@ -19,6 +19,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
using Autofac;
|
using Autofac;
|
||||||
using Kyoo.Abstractions;
|
using Kyoo.Abstractions;
|
||||||
using Kyoo.Abstractions.Controllers;
|
using Kyoo.Abstractions.Controllers;
|
||||||
@ -108,6 +109,9 @@ namespace Kyoo.Core
|
|||||||
/// <param name="services">The service collection to fill.</param>
|
/// <param name="services">The service collection to fill.</param>
|
||||||
public void ConfigureServices(IServiceCollection services)
|
public void ConfigureServices(IServiceCollection services)
|
||||||
{
|
{
|
||||||
|
foreach (Assembly assembly in _plugins.GetAllPlugins().Select(x => x.GetType().Assembly))
|
||||||
|
services.AddMvcCore().AddApplicationPart(assembly);
|
||||||
|
|
||||||
foreach (IPlugin plugin in _plugins.GetAllPlugins())
|
foreach (IPlugin plugin in _plugins.GetAllPlugins())
|
||||||
plugin.Configure(services);
|
plugin.Configure(services);
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using Kyoo.Abstractions.Controllers;
|
using Kyoo.Abstractions.Controllers;
|
||||||
using Microsoft.AspNetCore.Builder;
|
using Microsoft.AspNetCore.Builder;
|
||||||
|
using Microsoft.AspNetCore.Mvc.ApiExplorer;
|
||||||
using Microsoft.Extensions.DependencyInjection;
|
using Microsoft.Extensions.DependencyInjection;
|
||||||
using Microsoft.OpenApi.Models;
|
using Microsoft.OpenApi.Models;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user