add(conversation):完善私聊好友会话服务

This commit is contained in:
2026-01-03 22:13:28 +08:00
35 changed files with 456 additions and 54 deletions
@@ -0,0 +1,13 @@
using IM_API.Domain.Interfaces;
namespace IM_API.Domain.Events
{
public abstract record DomainEvent: IEvent
{
public Guid EventId { get; init; } = Guid.NewGuid();
public DateTime OccurredAt { get; init; } = DateTime.UtcNow;
public long OperatorId { get; init; }
public string AggregateId { get; init; } = "";
public abstract string EventType { get; }
}
}
@@ -0,0 +1,22 @@
using IM_API.Dtos;
using IM_API.Models;
namespace IM_API.Domain.Events
{
public record MessageCreatedEvent : DomainEvent
{
public override string EventType => "IM.MESSAGE.MESSAGE_CREATED";
public ChatType ChatType { get; set; }
public MessageMsgType MessageMsgType { get; set; }
public int MessageId { get; set; }
public string MessageContent { get; set; }
public int MsgSenderId { get; set; }
public int MsgRecipientId { get; set; }
public MessageState State { get; set; }
public DateTime MessageCreated { get; set; }
public string StreamKey { get; set; }
}
}
@@ -0,0 +1,6 @@
namespace IM_API.Domain.Interfaces
{
public interface IEvent
{
}
}