Create runtime variables and remove MessagePack.
This commit is contained in:
+6
-5
@@ -31,8 +31,8 @@ progressApi.MapGet("/", () =>
|
||||
{
|
||||
Command = CommunicationCommand.GetScanningProgress
|
||||
};
|
||||
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
|
||||
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
@@ -40,7 +40,7 @@ progressApi.MapGet("/", () =>
|
||||
byte[] msg = client.ReceiveFrameBytes();
|
||||
client.Close();
|
||||
|
||||
return MessagePackSerializer.Deserialize<ScanningStatus>(msg, MessagePackSerializerOptions.Standard.WithCompression(MessagePackCompression.Lz4BlockArray));
|
||||
return JsonSerializer.Deserialize<ScanningStatus>(msg);
|
||||
});
|
||||
|
||||
RouteGroupBuilder searchApi = app.MapGroup("/search");
|
||||
@@ -50,8 +50,8 @@ searchApi.MapGet("/{term}", (string term) =>
|
||||
CommunicationObject communicationObject = new();
|
||||
communicationObject.Command = CommunicationCommand.GetSearches;
|
||||
communicationObject.SearchTerm = term;
|
||||
|
||||
byte[] bytes = MessagePackSerializer.Serialize(communicationObject);
|
||||
|
||||
byte[] bytes = JsonSerializer.SerializeToUtf8Bytes(communicationObject);
|
||||
|
||||
using RequestSocket client = new();
|
||||
client.Connect("tcp://127.0.0.1:5556");
|
||||
@@ -66,6 +66,7 @@ app.Run();
|
||||
|
||||
[JsonSerializable(typeof(ScanningStatus))]
|
||||
[JsonSerializable(typeof(SearchResults))]
|
||||
[JsonSerializable(typeof(CommunicationObject))]
|
||||
internal partial class AppJsonSerializerContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
+1
-7
@@ -5,16 +5,10 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<InvariantGlobalization>true</InvariantGlobalization>
|
||||
<PublishAot>true</PublishAot>
|
||||
<PublishAot>false</PublishAot>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MessagePack" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePack.Annotations" Version="3.0.238-rc.1" />
|
||||
<PackageReference Include="MessagePackAnalyzer" Version="3.0.238-rc.1">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="NetMQ" Version="4.0.1.13" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user