添加项目文件。

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,35 @@
using MessageService.Domain.Enums;
namespace MessageService.WebApi.Application.Dtos
{
public class ConversationResponse
{
public Guid Id { get; set; }
public Guid UserId { get; set; }
/// <summary>
/// 对方ID(群聊为群聊ID,单聊为单聊ID)
/// </summary>
public Guid TargetId { get; set; }
public string TargetAvatar { get; set; }
public string TargetName { get; set; }
/// <summary>
/// 最后一条未读消息ID
/// </summary>
public long? LastReadSequenceId { get; set; }
/// <summary>
/// 未读消息数
/// </summary>
public int UnreadCount { get; set; }
public ChatType ChatType { get; set; }
/// <summary>
/// 最后一条最新消息
/// </summary>
public string LastMessage { get; set; }
}
}
@@ -0,0 +1,14 @@
namespace MessageService.WebApi.Application.Dtos
{
public class GetMessagesResponse
{
public List<MessageResponse> Messages { get; init; }
public bool Hasmore { get; init; }
public GetMessagesResponse(List<MessageResponse> messages, bool hasmore)
{
Messages = messages;
Hasmore = hasmore;
}
}
}
@@ -0,0 +1,36 @@
using MessageService.Domain.Enums;
namespace MessageService.WebApi.Application.Dtos
{
public record MessageResponse
{
public Guid Id { get; init; }
public Guid ClientMsgId { get; init; }
public ChatType ChatType { get; init; }
public MessageType MsgType { get; init; }
public Guid SenderId { get; init; }
public Guid TargetId { get; init; }
public MessageState State { get; init; }
public string StreamKey { get; init; }
public long SequenceId { get; init; }
public DateTimeOffset CreationTime { get; init; }
// 关键:展开 Content
public MessageContentResponse Content { get; init; }
}
public record MessageContentResponse(
string Fallback,
object Body, // 已经是反序列化后的具体对象
Dictionary<string, string> Ext,
QuoteInfoResponse? Quote
);
public record QuoteInfoResponse(
Guid MessageId,
Guid SenderId,
string SenderName,
MessageType MessageType,
string Preview
);
}