添加项目文件。

This commit is contained in:
2026-05-09 17:06:30 +08:00
parent c60f5fe117
commit 720ef957d4
378 changed files with 14843 additions and 0 deletions
@@ -0,0 +1,14 @@
namespace IM.Commons.IntegrationEvents
{
public class FriendAddedEvent : BaseEvent
{
public Guid OwnerId { get; set; }
public string OwnerNickName { get; set; }
public string? OwnerAvatar { get; set; }
public Guid TargetId { get; set; }
public string TargetNickName { get; set; }
public string? TargetAvatar { get; set; }
public string? RemarkName { get; set; }
public string Status { get; set; }
}
}
@@ -0,0 +1,31 @@
namespace IM.Commons.IntegrationEvents
{
public class FriendRequestStateUpdateEvent : BaseEvent
{
/// <summary>
/// 申请人
/// </summary>
public Guid OwnerId { get; set; }
/// <summary>
/// 被申请人
/// </summary>
public Guid TargetId { get; set; }
/// <summary>
/// 申请附言
/// </summary>
public string Description { get; set; }
/// <summary>
/// 申请状态(0:待通过,1:拒绝,2:同意,3:拉黑)
/// </summary>
public string State { get; set; }
/// <summary>
/// 备注
/// </summary>
public string? RemarkName { get; set; }
}
}
@@ -0,0 +1,20 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupBlockEvent : BaseEvent
{
public Guid GroupId { get; private set; }
public string GroupName { get; private set; }
public Guid GroupMaster { get; private set; }
public string Status { get; private set; }
public string? Avatar { get; private set; }
public GroupBlockEvent(Guid groupId, string groupName, Guid groupMaster, string status, string? avatar)
{
GroupId = groupId;
GroupName = groupName;
GroupMaster = groupMaster;
Status = status;
Avatar = avatar;
}
}
}
@@ -0,0 +1,18 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupCreateEvent
{
public Guid GroupId { get; private set; }
public string GroupName { get; private set; }
public Guid GroupMaster { get; private set; }
public string? Avatar { get; private set; }
public GroupCreateEvent(Guid groupId, string groupName, Guid groupMaster, string? avatar)
{
GroupId = groupId;
GroupName = groupName;
GroupMaster = groupMaster;
Avatar = avatar;
}
}
}
@@ -0,0 +1,9 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupInvitationAcceptEvent : GroupInvitationCreateEvent
{
public GroupInvitationAcceptEvent(Guid invitationId, Guid userId, string userNickName, string? userAvatar, Guid groupId, string groupName, string groupAvatar, Guid operatorId, string operatorName, string operatorAvatar) : base(invitationId, userId, userNickName, userAvatar, groupId, groupName, groupAvatar, operatorId, operatorName, operatorAvatar)
{
}
}
}
@@ -0,0 +1,30 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupInvitationCreateEvent : BaseEvent
{
public Guid InvitationId { get; private set; }
public Guid UserId { get; private set; }
public string UserNickName { get; private set; }
public string? UserAvatar { get; private set; }
public Guid GroupId { get; private set; }
public string GroupName { get; private set; }
public string GroupAvatar { get; private set; }
public Guid OperatorId { get; private set; }
public string OperatorName { get; private set; }
public string OperatorAvatar { get; private set; }
public GroupInvitationCreateEvent(Guid invitationId, Guid userId, string userNickName, string? userAvatar, Guid groupId, string groupName, string groupAvatar, Guid operatorId, string operatorName, string operatorAvatar)
{
InvitationId = invitationId;
UserId = userId;
UserNickName = userNickName;
UserAvatar = userAvatar;
GroupId = groupId;
GroupName = groupName;
GroupAvatar = groupAvatar;
OperatorId = operatorId;
OperatorName = operatorName;
OperatorAvatar = operatorAvatar;
}
}
}
@@ -0,0 +1,22 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupMemberJoinedEvent
{
public Guid Id { get; private set; }
public Guid UserId { get; private set; }
public Guid GroupId { get; private set; }
public string GroupNickName { get; private set; }
public string? Avatar { get; private set; }
public string Role { get; private set; }
public GroupMemberJoinedEvent(Guid id, Guid userId, Guid groupId, string groupNickName, string? avatar, string role)
{
Id = id;
UserId = userId;
GroupId = groupId;
GroupNickName = groupNickName;
Avatar = avatar;
Role = role;
}
}
}
@@ -0,0 +1,9 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupRequestDeclinedEvent : GroupRequestPassedEvent
{
public GroupRequestDeclinedEvent(Guid requestId, Guid groupId, string groupName, string groupAvatar, Guid userId, string userNickName, string? userAvatar, Guid operatorId, string operatorName, string operatorAvatar, string description, DateTimeOffset created, DateTimeOffset updated) : base(requestId, groupId, groupName, groupAvatar, userId, userNickName, userAvatar, operatorId, operatorName, operatorAvatar, description, created, updated)
{
}
}
}
@@ -0,0 +1,36 @@
namespace IM.Commons.IntegrationEvents
{
public class GroupRequestPassedEvent
{
public Guid RequestId { get; private set; }
public Guid GroupId { get; private set; }
public string GroupName { get; private set; }
public string GroupAvatar { get; private set; }
public Guid UserId { get; private set; }
public string UserNickName { get; private set; }
public string? UserAvatar { get; private set; }
public Guid OperatorId { get; private set; }
public string OperatorName { get; private set; }
public string OperatorAvatar { get; private set; }
public string Description { get; private set; }
public DateTimeOffset Created { get; private set; }
public DateTimeOffset Updated { get; private set; }
public GroupRequestPassedEvent(Guid requestId, Guid groupId, string groupName, string groupAvatar, Guid userId, string userNickName, string? userAvatar, Guid operatorId, string operatorName, string operatorAvatar, string description, DateTimeOffset created, DateTimeOffset updated)
{
RequestId = requestId;
GroupId = groupId;
GroupName = groupName;
GroupAvatar = groupAvatar;
UserId = userId;
UserNickName = userNickName;
UserAvatar = userAvatar;
OperatorId = operatorId;
OperatorName = operatorName;
OperatorAvatar = operatorAvatar;
Description = description;
Created = created;
Updated = updated;
}
}
}
@@ -0,0 +1,45 @@
namespace IM.Commons.IntegrationEvents
{
public class MsgCreatedEvent
{
public Guid Id { get; set; }
public Guid ClientId { get; set; }
public string ChatType { get; set; }
/// <summary>
/// 消息类型
/// (0:文本,1:图片,2:语音,3:视频,4:文件,5:语音聊天,6:视频聊天)
/// </summary>
public string MsgType { get; set; }
/// <summary>
/// 发送者
/// </summary>
public Guid SenderId { get; set; }
/// <summary>
/// 接收者(私聊为用户ID,群聊为群聊ID)
/// </summary>
public Guid TargetId { get; set; }
/// <summary>
/// 消息状态(0:已发送,1:已撤回)
/// </summary>
public string State { get; set; }
/// <summary>
/// 消息推送唯一标识符
/// </summary>
public string StreamKey { get; set; }
/// <summary>
/// 消息排序标识
/// </summary>
public long SequenceId { get; set; }
public MsgContent Content { get; set; }
}
public record MsgContent(string Fallback, object Body, Dictionary<string, string> Ext, QuoteInfoDto Quote);
public record QuoteInfoDto(Guid MessageId, Guid SenderId, string SenderName, string MessageType, string Preview);
}
@@ -0,0 +1,16 @@
namespace IM.Commons.IntegrationEvents
{
public class MsgWithdrawEvent
{
public Guid MsgId { get; private set; }
public string State { get; private set; }
public string StreamKey { get; private set; }
public MsgWithdrawEvent(Guid msgId, string state, string streamKey)
{
MsgId = msgId;
State = state;
StreamKey = streamKey;
}
}
}
@@ -0,0 +1,14 @@
namespace IM.Commons.IntegrationEvents
{
public class UserProfileUpdateEvent : BaseEvent
{
public Guid UserId { get; set; }
public string NickName { get; set; }
public string? Avatar { get; set; }
public string Description { get; set; }
public string? Email { get; set; }
public string? Phone { get; set; }
public string Status { get; set; }
}
}