Started refactoring to be compatible with the changed nuget packages and the mooncore changes

This commit is contained in:
2025-07-15 19:21:44 +02:00
parent b53140e633
commit 514f862a9d
71 changed files with 616 additions and 247 deletions

View File

@@ -0,0 +1,25 @@
using MoonlightServers.ApiServer.Database.Entities;
using MoonlightServers.Shared.Http.Requests.Admin.Servers;
using MoonlightServers.Shared.Http.Responses.Admin.Servers;
using Riok.Mapperly.Abstractions;
namespace MoonlightServers.ApiServer.Mappers;
[Mapper(AllowNullPropertyAssignment = false)]
public static partial class ServerMapper
{
[UserMapping(Default = true)]
public static ServerResponse ToAdminServerResponse(Server server)
{
var response = ToAdminServerResponse_Internal(server);
response.AllocationIds = server.Allocations.Select(x => x.Id).ToArray();
return response;
}
private static partial ServerResponse ToAdminServerResponse_Internal(Server server);
public static partial Server ToServer(CreateServerRequest request);
public static partial Server Merge(UpdateServerRequest request, Server server);
}