Working on module/plugin system

This commit is contained in:
Masu Baumgartner
2024-11-14 22:30:02 +01:00
parent e5555c815b
commit 072adb5bb1
7 changed files with 94 additions and 156 deletions

View File

@@ -1,37 +0,0 @@
using Microsoft.AspNetCore.Mvc;
using Moonlight.ApiServer.Services;
using Moonlight.Shared.Http.Responses.ClientPlugins;
namespace Moonlight.ApiServer.Http.Controllers.ClientPlugins;
[ApiController]
[Route("api/clientPlugins")]
public class ClientPluginsController : Controller
{
private readonly ModuleService ModuleService;
public ClientPluginsController(ModuleService moduleService)
{
ModuleService = moduleService;
}
[HttpGet]
public async Task<ClientPluginsResponse> Get()
{
var dlls = ModuleService.Modules
.Where(x => x.Modules.ContainsKey("client"))
.SelectMany(x =>
x.Modules
.FirstOrDefault(c => c.Key == "client")
.Value
.Select(y => x.Name + "." + y)
)
.ToArray();
return new()
{
CacheKey = "unset",
Dlls = dlls
};
}
}