18 lines
586 B
C#
18 lines
586 B
C#
using IM_API.Models;
|
|
|
|
namespace IM_API.Dtos
|
|
{
|
|
public record MessageBaseDto
|
|
{
|
|
// 使用 { get; init; } 确保对象创建后不可修改,且支持无参构造
|
|
public MessageMsgType Type { get; init; } = default!;
|
|
public ChatType ChatType { get; init; } = default!;
|
|
public Guid MsgId { get; init; }
|
|
public int SenderId { get; init; }
|
|
public int ReceiverId { get; init; }
|
|
public string Content { get; init; } = default!;
|
|
public DateTimeOffset TimeStamp { get; init; }
|
|
public MessageBaseDto() { }
|
|
}
|
|
}
|