mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 15:26:30 +00:00
make python app load a bit eariler, making startup a bit faster
This commit is contained in:
@@ -3,22 +3,36 @@
|
||||
namespace Azaion.CommonSecurity.DTO.Commands;
|
||||
|
||||
[MessagePackObject]
|
||||
public class RemoteCommand(CommandType commandType, string? filename = null, byte[]? data = null)
|
||||
public class RemoteCommand(CommandType commandType, byte[]? data = null)
|
||||
{
|
||||
[Key("CommandType")]
|
||||
public CommandType CommandType { get; set; } = commandType;
|
||||
|
||||
[Key("Filename")]
|
||||
public string? Filename { get; set; } = filename;
|
||||
|
||||
[Key("Data")]
|
||||
public byte[]? Data { get; set; } = data;
|
||||
|
||||
public static byte[] Serialize<T>(CommandType commandType, T data) where T : class
|
||||
{
|
||||
var dataBytes = MessagePackSerializer.Serialize(data);
|
||||
return MessagePackSerializer.Serialize(new RemoteCommand(commandType, dataBytes ));
|
||||
}
|
||||
}
|
||||
|
||||
[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,
|
||||
GetUser = 10,
|
||||
Login = 10,
|
||||
Load = 20,
|
||||
Inference = 30,
|
||||
StopInference = 40,
|
||||
|
||||
Reference in New Issue
Block a user