2025-07-27 17:51:50 -05:00
|
|
|
using AutoMapper;
|
|
|
|
|
using LANCommander.SDK.Enums;
|
|
|
|
|
using LANCommander.SDK.Models.Manifest;
|
|
|
|
|
using LANCommander.Server.ImportExport.Models;
|
|
|
|
|
using LANCommander.Server.Services;
|
|
|
|
|
|
|
|
|
|
namespace LANCommander.Server.ImportExport.Exporters;
|
|
|
|
|
|
|
|
|
|
public class ServerConsoleExporter(ServerConsoleService serverConsoleService) : BaseExporter<ServerConsole, Data.Models.ServerConsole>
|
|
|
|
|
{
|
|
|
|
|
public override async Task<ExportItemInfo> GetExportInfoAsync(Data.Models.ServerConsole record)
|
|
|
|
|
{
|
|
|
|
|
return new ExportItemInfo
|
|
|
|
|
{
|
|
|
|
|
Id = record.Id,
|
2025-08-01 02:27:06 -05:00
|
|
|
Type = ImportExportRecordType.ServerConsole,
|
2025-07-27 17:51:50 -05:00
|
|
|
Name = record.Name,
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override bool CanExport(ServerConsole record) => ExportContext.DataRecord is Data.Models.ServerConsole;
|
|
|
|
|
|
|
|
|
|
public override async Task<ServerConsole> ExportAsync(Guid id)
|
|
|
|
|
{
|
|
|
|
|
return await serverConsoleService.GetAsync<ServerConsole>(id);
|
|
|
|
|
}
|
|
|
|
|
}
|