Files
IM_NEW/MessageService.WebApi/Application/Message/SendMsgCommand.cs
T

52 lines
1.9 KiB
C#

using MessageService.Domain.Enums;
namespace MessageService.WebApi.Application.Message
{
public record SendMsgCommand
{
// 核心区别:Command 必须包含 SenderId,这是从后端 Token 解析出来的
public Guid SenderId { get; init; }
public Guid TargetId { get; init; }
public ChatType ChatType { get; init; }
public MessageType MsgType { get; init; }
public Guid ClientMsgId { get; init; }
public Guid? QuoteMessageId { get; init; }
public Dictionary<string, string>? Ext { get; init; }
// 拍扁后的参数,方便 Service 直接调用工厂方法
public string? Text { get; init; }
public string? Url { get; init; }
public int? Width { get; init; }
public int? Height { get; init; }
public string? Thumb { get; init; }
public int? Duration { get; init; }
public Guid? FileId { get; init; }
public string? FileName { get; init; }
public long? FileSize { get; init; }
public string? FileFormat { get; init; }
public SendMsgCommand(Guid senderId, Guid targetId, ChatType chatType, MessageType msgType, Guid clientMsgId, Guid? quoteMessageId, Dictionary<string, string>? ext, string? text, string? url, int? width, int? height, string? thumb, int? duration, Guid? fileId, string? fileName, long? fileSize, string? fileFormat)
{
SenderId = senderId;
TargetId = targetId;
ChatType = chatType;
MsgType = msgType;
ClientMsgId = clientMsgId;
QuoteMessageId = quoteMessageId;
Ext = ext;
Text = text;
Url = url;
Width = width;
Height = height;
Thumb = thumb;
Duration = duration;
FileId = fileId;
FileName = fileName;
FileSize = fileSize;
FileFormat = fileFormat;
}
}
}