Cleaned up interfaces. Extracted server state machine trigger handler to seperated classes. Removed legacy code
This commit is contained in:
@@ -11,4 +11,8 @@ public static partial class AllocationMapper
|
||||
public static partial NodeAllocationResponse ToNodeAllocation(Allocation allocation);
|
||||
public static partial Allocation ToAllocation(CreateNodeAllocationRequest request);
|
||||
public static partial void Merge(UpdateNodeAllocationRequest request, Allocation allocation);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<NodeAllocationResponse> ProjectToAdminResponse(this IQueryable<Allocation> allocations);
|
||||
}
|
||||
@@ -8,7 +8,11 @@ namespace MoonlightServers.ApiServer.Mappers;
|
||||
[Mapper(AllowNullPropertyAssignment = false)]
|
||||
public static partial class DockerImageMapper
|
||||
{
|
||||
public static partial StarDockerImageDetailResponse ToAdminResponse(StarDockerImage dockerImage);
|
||||
public static partial StarDockerImageResponse ToAdminResponse(StarDockerImage dockerImage);
|
||||
public static partial StarDockerImage ToDockerImage(CreateStarDockerImageRequest request);
|
||||
public static partial void Merge(UpdateStarDockerImageRequest request, StarDockerImage variable);
|
||||
|
||||
// EF Migrations
|
||||
|
||||
public static partial IQueryable<StarDockerImageResponse> ProjectToAdminResponse(this IQueryable<StarDockerImage> dockerImages);
|
||||
}
|
||||
@@ -11,4 +11,8 @@ public static partial class NodeMapper
|
||||
public static partial NodeResponse ToAdminNodeResponse(Node node);
|
||||
public static partial Node ToNode(CreateNodeRequest request);
|
||||
public static partial void Merge(UpdateNodeRequest request, Node node);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<NodeResponse> ProjectToAdminResponse(this IQueryable<Node> nodes);
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
using MoonlightServers.ApiServer.Database.Entities;
|
||||
using MoonlightServers.Shared.Http.Requests.Admin.Servers;
|
||||
using MoonlightServers.Shared.Http.Responses.Admin.Servers;
|
||||
using MoonlightServers.Shared.Http.Responses.Client.Servers;
|
||||
using Riok.Mapperly.Abstractions;
|
||||
|
||||
namespace MoonlightServers.ApiServer.Mappers;
|
||||
@@ -20,6 +21,11 @@ public static partial class ServerMapper
|
||||
|
||||
private static partial ServerResponse ToAdminServerResponse_Internal(Server server);
|
||||
|
||||
[MapperIgnoreSource(nameof(CreateServerRequest.Variables))]
|
||||
public static partial Server ToServer(CreateServerRequest request);
|
||||
public static partial void Merge(UpdateServerRequest request, Server server);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<ServerResponse> ProjectToAdminResponse(this IQueryable<Server> servers);
|
||||
}
|
||||
@@ -8,4 +8,8 @@ namespace MoonlightServers.ApiServer.Mappers;
|
||||
public static partial class ServerVariableMapper
|
||||
{
|
||||
public static partial ServerVariableResponse ToAdminResponse(ServerVariable serverVariable);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<ServerVariableResponse> ProjectToAdminResponse(this IQueryable<ServerVariable> variables);
|
||||
}
|
||||
@@ -9,7 +9,11 @@ namespace MoonlightServers.ApiServer.Mappers;
|
||||
[Mapper(AllowNullPropertyAssignment = false)]
|
||||
public static partial class StarMapper
|
||||
{
|
||||
public static partial StarDetailResponse ToAdminResponse(Star star);
|
||||
public static partial StarResponse ToAdminResponse(Star star);
|
||||
public static partial Star ToStar(CreateStarRequest request);
|
||||
public static partial void Merge(UpdateStarRequest request, Star star);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<StarResponse> ProjectToAdminResponse(this IQueryable<Star> stars);
|
||||
}
|
||||
@@ -8,7 +8,11 @@ namespace MoonlightServers.ApiServer.Mappers;
|
||||
[Mapper(AllowNullPropertyAssignment = false)]
|
||||
public static partial class StarVariableMapper
|
||||
{
|
||||
public static partial StarVariableDetailResponse ToAdminResponse(StarVariable variable);
|
||||
public static partial StarVariableResponse ToAdminResponse(StarVariable variable);
|
||||
public static partial StarVariable ToStarVariable(CreateStarVariableRequest request);
|
||||
public static partial void Merge(UpdateStarVariableRequest request, StarVariable variable);
|
||||
|
||||
// EF Projections
|
||||
|
||||
public static partial IQueryable<StarVariableResponse> ProjectToAdminResponse(this IQueryable<StarVariable> variables);
|
||||
}
|
||||
Reference in New Issue
Block a user