39 lines
1.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace BuildFlow.IM.Integration.Tests;
/// <summary>
/// ChatHub 客户端事件的强类型载荷。
/// 使用强类型而非 dynamic 解析,避免 JSON 序列化命名差异(PascalCase/CamelCase)与
/// Guid↔字符串类型转换在 dynamic 下抛 InvalidCastException(SignalR 客户端回调吞异常,难定位)。
/// 字段使用可空类型,配合缺省构造,容忍服务端载荷字段增减。
/// </summary>
public static class HubEvents
{
/// <summary>已读回执事件:OnMessageRead。</summary>
public sealed class MessageReadEvent
{
public string? MessageId { get; set; }
public Guid? UserId { get; set; }
}
/// <summary>消息撤回事件:OnMessageRecalled。</summary>
public sealed class MessageRecalledEvent
{
public Guid? ConversationId { get; set; }
public string? MessageId { get; set; }
public Guid? UserId { get; set; }
}
/// <summary>输入状态事件:OnUserTyping。</summary>
public sealed class UserTypingEvent
{
public Guid? ConversationId { get; set; }
public Guid? UserId { get; set; }
}
/// <summary>上下线事件:OnUserOnline / OnUserOffline。</summary>
public sealed class UserPresenceEvent
{
public Guid? UserId { get; set; }
}
}