mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:26:31 +00:00
consolidate CommonSecurity to Common.dll
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
using MessagePack;
|
||||
|
||||
namespace Azaion.Common.DTO;
|
||||
|
||||
[MessagePackObject]
|
||||
public class RemoteCommand(CommandType commandType, byte[]? data = null, string? message = null)
|
||||
{
|
||||
[Key("CommandType")]
|
||||
public CommandType CommandType { get; set; } = commandType;
|
||||
|
||||
[Key("Data")]
|
||||
public byte[]? Data { get; set; } = data;
|
||||
|
||||
[Key("Message")]
|
||||
public string? Message { get; set; } = message;
|
||||
|
||||
public static RemoteCommand Create(CommandType commandType) =>
|
||||
new(commandType);
|
||||
|
||||
public static RemoteCommand Create<T>(CommandType commandType, T data, string? message = null) where T : class =>
|
||||
new(commandType, MessagePackSerializer.Serialize(data), message);
|
||||
|
||||
public override string ToString() => $"({CommandType.ToString().ToUpper()}: Data: {Data?.Length ?? 0} bytes. Message: {Message})";
|
||||
}
|
||||
|
||||
[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,
|
||||
Ok = 3,
|
||||
Login = 10,
|
||||
ListRequest = 15,
|
||||
ListFiles = 18,
|
||||
Load = 20,
|
||||
LoadBigSmall = 22,
|
||||
UploadBigSmall = 24,
|
||||
DataBytes = 25,
|
||||
Inference = 30,
|
||||
InferenceData = 35,
|
||||
StopInference = 40,
|
||||
AIAvailabilityCheck = 80,
|
||||
AIAvailabilityResult = 85,
|
||||
Error = 90,
|
||||
Exit = 100,
|
||||
}
|
||||
Reference in New Issue
Block a user