37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
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
|
|
);
|
|
}
|