Add project files.

This commit is contained in:
EugeneTes
2026-01-13 09:06:47 +01:00
parent dd935fe1fa
commit 7390693f50
187 changed files with 83457 additions and 0 deletions

34
TestClient/Program.cs Normal file
View File

@@ -0,0 +1,34 @@
using Microsoft.AspNetCore.SignalR.Client;
using Microsoft.Extensions.Logging;
using System.Text.Json;
using System.Text.Json.Serialization;
using Websocket.Client;
var builder = new HubConnectionBuilder()
.WithUrl("https://api.gastrojames.ch/hubs/internal?access_token=https://api.gastrojames.ch/hubs/internal") // Replace with your SignalR hub URL
.WithAutomaticReconnect()
;
;
var connection = builder.Build();
await connection.StartAsync();
string groupName = "67e534f8e86e816689323023"; // Replace with your actual group name
await connection.InvokeAsync("JoinGroup", groupName);
connection.On<PrintJob>("PrintJob", (args) =>
{
Console.WriteLine($"Received print job for working area: {JsonSerializer.Serialize(args)}");
});
Console.ReadLine();
public class PrintJob
{
[JsonPropertyName("workingAreaId")]
public string WorkingAreaId { get; set; }
[JsonPropertyName("content")]
public string Content { get; set; }
}

View File

@@ -0,0 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Client" Version="10.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="10.0.1" />
<PackageReference Include="Websocket.Client" Version="5.3.0" />
</ItemGroup>
</Project>