mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 22:06:30 +00:00
73c2ab5374
small fixes
40 lines
958 B
C#
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
|
|
} |