mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 14:36:31 +00:00
make python app load a bit eariler, making startup a bit faster
This commit is contained in:
@@ -1,7 +1,16 @@
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
using MessagePack;
|
||||
|
||||
namespace Azaion.CommonSecurity.DTO;
|
||||
|
||||
[MessagePackObject]
|
||||
public class ApiCredentials(string email, string password) : EventArgs
|
||||
{
|
||||
[Key(nameof(Email))]
|
||||
public string Email { get; set; } = email;
|
||||
|
||||
[Key(nameof(Password))]
|
||||
public string Password { get; set; } = password;
|
||||
|
||||
[Key(nameof(Folder))]
|
||||
public string Folder { get; set; } = null!;
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -6,8 +6,8 @@ namespace Azaion.CommonSecurity.DTO;
|
||||
[MessagePackObject]
|
||||
public class User
|
||||
{
|
||||
[Key("i")]public string Id { get; set; }
|
||||
[Key("e")]public string Email { get; set; }
|
||||
[Key("i")] public string Id { get; set; } = "";
|
||||
[Key("e")] public string Email { get; set; } = "";
|
||||
[Key("r")]public RoleEnum Role { get; set; }
|
||||
|
||||
//For deserializing
|
||||
|
||||
Reference in New Issue
Block a user