@@ -1,13 +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 DateTimeOffset OccurredAt { get; init; } = DateTime.Now;
|
||||
public long OperatorId { get; init; }
|
||||
public string AggregateId { get; init; } = "";
|
||||
public abstract string EventType { get; }
|
||||
}
|
||||
}
|
||||
using IM_API.Domain.Interfaces;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public abstract record DomainEvent: IEvent
|
||||
{
|
||||
public Guid EventId { get; init; } = Guid.NewGuid();
|
||||
public DateTimeOffset OccurredAt { get; init; } = DateTime.Now;
|
||||
public long OperatorId { get; init; }
|
||||
public string AggregateId { get; init; } = "";
|
||||
public abstract string EventType { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
using IM_API.Dtos.Friend;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record FriendAddEvent:DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.FRIENDS_FRIEND_ADD";
|
||||
/// <summary>
|
||||
/// 发起请求用户
|
||||
/// </summary>
|
||||
public int RequestUserId { get; init; }
|
||||
public string? requestUserRemarkname { get; init; }
|
||||
/// <summary>
|
||||
/// 接受请求用户
|
||||
/// </summary>
|
||||
public int ResponseUserId { get; init; }
|
||||
|
||||
public FriendRequestDto RequestInfo { get; init; }
|
||||
/// <summary>
|
||||
/// 好友关系创建时间
|
||||
/// </summary>
|
||||
public DateTimeOffset Created { get; init; }
|
||||
|
||||
}
|
||||
}
|
||||
using IM_API.Dtos.Friend;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record FriendAddEvent:DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.FRIENDS_FRIEND_ADD";
|
||||
/// <summary>
|
||||
/// 发起请求用户
|
||||
/// </summary>
|
||||
public int RequestUserId { get; init; }
|
||||
public string? requestUserRemarkname { get; init; }
|
||||
/// <summary>
|
||||
/// 接受请求用户
|
||||
/// </summary>
|
||||
public int ResponseUserId { get; init; }
|
||||
|
||||
public FriendRequestDto RequestInfo { get; init; }
|
||||
/// <summary>
|
||||
/// 好友关系创建时间
|
||||
/// </summary>
|
||||
public DateTimeOffset Created { get; init; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupInviteActionUpdateEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_INVITE_UPDATE";
|
||||
public int UserId { get; set; }
|
||||
public int InviteUserId { get; set; }
|
||||
public int InviteId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public GroupInviteState Action { get; set; }
|
||||
}
|
||||
}
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupInviteActionUpdateEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_INVITE_UPDATE";
|
||||
public int UserId { get; set; }
|
||||
public int InviteUserId { get; set; }
|
||||
public int InviteId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public GroupInviteState Action { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupInviteEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_INVITE_ADD";
|
||||
public required List<int> Ids { get; init; }
|
||||
public int GroupId { get; init; }
|
||||
public int UserId { get; init; }
|
||||
}
|
||||
}
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupInviteEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_INVITE_ADD";
|
||||
public required List<int> Ids { get; init; }
|
||||
public int GroupId { get; init; }
|
||||
public int UserId { get; init; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupJoinEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_MEMBER_ADD";
|
||||
public int UserId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public bool IsCreated { get; set; } = false;
|
||||
}
|
||||
}
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupJoinEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_MEMBER_ADD";
|
||||
public int UserId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public bool IsCreated { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
using IM_API.Dtos.Group;
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupRequestEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_GROUP_REQUEST";
|
||||
public int GroupId { get; init; }
|
||||
public int UserId { get; set; }
|
||||
public string Description { get; set; }
|
||||
public GroupRequestState Action { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
using IM_API.Dtos.Group;
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupRequestEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_GROUP_REQUEST";
|
||||
public int GroupId { get; init; }
|
||||
public int UserId { get; set; }
|
||||
public string Description { get; set; }
|
||||
public GroupRequestState Action { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupRequestUpdateEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_REQUEST_UPDATE";
|
||||
public int UserId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public int AdminUserId { get; set; }
|
||||
public int RequestId { get; set; }
|
||||
public GroupRequestState Action { get; set; }
|
||||
}
|
||||
}
|
||||
using IM_API.Models;
|
||||
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record GroupRequestUpdateEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.GROUPS_REQUEST_UPDATE";
|
||||
public int UserId { get; set; }
|
||||
public int GroupId { get; set; }
|
||||
public int AdminUserId { get; set; }
|
||||
public int RequestId { get; set; }
|
||||
public GroupRequestState Action { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
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 long SequenceId { get; set; }
|
||||
public string MessageContent { get; set; }
|
||||
public int MsgSenderId { get; set; }
|
||||
public int MsgRecipientId { get; set; }
|
||||
public MessageState State { get; set; }
|
||||
public DateTimeOffset MessageCreated { get; set; }
|
||||
public string StreamKey { get; set; }
|
||||
public Guid ClientMsgId { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
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 long SequenceId { get; set; }
|
||||
public string MessageContent { get; set; }
|
||||
public int MsgSenderId { get; set; }
|
||||
public int MsgRecipientId { get; set; }
|
||||
public MessageState State { get; set; }
|
||||
public DateTimeOffset MessageCreated { get; set; }
|
||||
public string StreamKey { get; set; }
|
||||
public Guid ClientMsgId { get; set; }
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record RequestFriendEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.FRIENDS_FRIEND_REQUEST";
|
||||
public int FromUserId { get; init; }
|
||||
public int ToUserId { get; init; }
|
||||
public string Description { get; init; }
|
||||
}
|
||||
}
|
||||
namespace IM_API.Domain.Events
|
||||
{
|
||||
public record RequestFriendEvent : DomainEvent
|
||||
{
|
||||
public override string EventType => "IM.FRIENDS_FRIEND_REQUEST";
|
||||
public int FromUserId { get; init; }
|
||||
public int ToUserId { get; init; }
|
||||
public string Description { get; init; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user