Pusher service basis

This commit is contained in:
2025-07-12 22:15:18 +08:00
parent 33f56c4ef5
commit e1b47bc7d1
22 changed files with 1117 additions and 104 deletions

View File

@ -2,7 +2,9 @@ using System.Text.Json;
using NodaTime;
using NodaTime.Serialization.SystemTextJson;
public class WebSocketPacketType
namespace DysonNetwork.Pusher.Connection;
public abstract class WebSocketPacketType
{
public const string Error = "error";
public const string MessageNew = "messages.new";
@ -31,7 +33,7 @@ public class WebSocketPacket
DictionaryKeyPolicy = JsonNamingPolicy.SnakeCaseLower,
};
return JsonSerializer.Deserialize<WebSocketPacket>(json, jsonOpts) ??
throw new JsonException("Failed to deserialize WebSocketPacket");
throw new JsonException("Failed to deserialize WebSocketPacket");
}
/// <summary>