using MessagePack; namespace Azaion.CommonSecurity.DTO.Commands; [MessagePackObject] public class RemoteCommand(CommandType commandType, byte[]? data = null) { [Key("CommandType")] public CommandType CommandType { get; set; } = commandType; [Key("Data")] public byte[]? Data { get; set; } = data; public static RemoteCommand Create(CommandType commandType) => new(commandType); public static RemoteCommand Create(CommandType commandType, T data) where T : class => new(commandType, MessagePackSerializer.Serialize(data)); } [MessagePackObject] public class LoadFileData(string filename, string? folder = null ) { [Key(nameof(Folder))] public string? Folder { get; set; } = folder; [Key(nameof(Filename))] public string Filename { get; set; } = filename; } public enum CommandType { None = 0, Login = 10, Load = 20, Inference = 30, StopInference = 40, Exit = 100 }