♻️ Refactor the notification service to use gorush as push service

This commit is contained in:
2025-06-01 01:04:20 +08:00
parent 7fa0dfdcad
commit a78e92a23a
14 changed files with 121 additions and 191 deletions

View File

@ -9,8 +9,6 @@ using SystemClock = NodaTime.SystemClock;
namespace DysonNetwork.Sphere.Connection.Handlers;
public class MessageReadHandler(
AppDatabase db,
ICacheService cache,
ChatRoomService crs,
FlushBufferService buffer
)

View File

@ -5,7 +5,7 @@ using Microsoft.EntityFrameworkCore;
namespace DysonNetwork.Sphere.Connection.Handlers;
public class MessageTypingHandler(AppDatabase db, ChatRoomService crs, ICacheService cache) : IWebSocketPacketHandler
public class MessageTypingHandler(ChatRoomService crs) : IWebSocketPacketHandler
{
public string PacketType => "messages.typing";

View File

@ -91,8 +91,7 @@ public class WebSocketController(WebSocketService ws, ILogger<WebSocketContext>
);
var packet = WebSocketPacket.FromBytes(buffer[..receiveResult.Count]);
if (packet is null) continue;
ws.HandlePacket(currentUser, connectionKey.DeviceId, packet, webSocket);
_ = ws.HandlePacket(currentUser, connectionKey.DeviceId, packet, webSocket);
}
}
catch (OperationCanceledException)

View File

@ -14,7 +14,7 @@ public class WebSocketPacketType
public class WebSocketPacket
{
public string Type { get; set; } = null!;
public object Data { get; set; }
public object Data { get; set; } = null!;
public string? ErrorMessage { get; set; }
/// <summary>