diff --git a/AyCode.Interfaces/EntityComment/IEntityComment.cs b/AyCode.Interfaces/EntityComment/IEntityComment.cs new file mode 100644 index 0000000..d05bd56 --- /dev/null +++ b/AyCode.Interfaces/EntityComment/IEntityComment.cs @@ -0,0 +1,15 @@ +using AyCode.Interfaces.Entities; +using AyCode.Interfaces.TimeStampInfo; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AyCode.Interfaces.EntityComment +{ + public interface IEntityComment + { + public string Comment { get; set; } + } +} diff --git a/AyCode.Services.Server/SignalRs/AcSignalRSendToClientService.cs b/AyCode.Services.Server/SignalRs/AcSignalRSendToClientService.cs index ef64b3b..f2d3e68 100644 --- a/AyCode.Services.Server/SignalRs/AcSignalRSendToClientService.cs +++ b/AyCode.Services.Server/SignalRs/AcSignalRSendToClientService.cs @@ -1,6 +1,7 @@ using AyCode.Core.Extensions; using AyCode.Core.Helpers; using AyCode.Core.Loggers; +using AyCode.Core.Serializers.Binaries; using AyCode.Core.Serializers.Jsons; using AyCode.Services.SignalRs; using Microsoft.AspNetCore.SignalR; @@ -14,7 +15,7 @@ public abstract class AcSignalRSendToClientService(messageTag)}"); diff --git a/AyCode.Services/SignalRs/IAcSignalRHubClient.cs b/AyCode.Services/SignalRs/IAcSignalRHubClient.cs index ca69c49..bd84283 100644 --- a/AyCode.Services/SignalRs/IAcSignalRHubClient.cs +++ b/AyCode.Services/SignalRs/IAcSignalRHubClient.cs @@ -137,7 +137,7 @@ public enum SignalResponseStatus : byte /// /// Unified signal response message that supports both JSON and Binary serialization. -/// JSON mode uses Brotli compression for reduced payload size. +/// JSON mode uses GZip compression for reduced payload size. /// Optimized: uses pooled buffers for decompression, zero-copy deserialization path. /// public sealed class SignalResponseDataMessage : ISignalResponseMessage, IDisposable @@ -183,28 +183,29 @@ public sealed class SignalResponseDataMessage : ISignalResponseMessage, IDisposa if (_cachedResponseData != null) return (T)_cachedResponseData; if (ResponseData == null) return default; - if (DataSerializerType == AcSerializerType.Binary) + try { - try + if (DataSerializerType == AcSerializerType.Binary) { // Log diagnostics if enabled LogResponseDataDiagnostics(); - + return (T)(_cachedResponseData = ResponseData.BinaryTo()!); } - catch (Exception ex) - { - // Log detailed error diagnostics - LogResponseDataError(ex); - throw; - } - } - // Decompress Brotli to pooled buffer and deserialize directly - EnsureDecompressed(); - var result = AcJsonDeserializer.Deserialize(new ReadOnlySpan(_rentedDecompressedBuffer, 0, _decompressedLength)); - _cachedResponseData = result; - return result; + // Decompress GZip to pooled buffer and deserialize directly + EnsureDecompressed(); + + var result = AcJsonDeserializer.Deserialize(new ReadOnlySpan(_rentedDecompressedBuffer, 0, _decompressedLength)); + _cachedResponseData = result; + return result; + } + catch (Exception ex) + { + // Log detailed error diagnostics + LogResponseDataError(ex); + throw; + } } private void LogResponseDataDiagnostics()