Files
annotations/Azaion.CommonSecurity/DTO/Commands/RemoteCommand.cs
T
Alex Bezdieniezhnykh 73c2ab5374 stop inference on stop pressed
small fixes
2025-03-24 10:52:32 +02:00

40 lines
958 B
C#

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<T>(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
}