18 lines
606 B
C#
18 lines
606 B
C#
using FluentValidation;
|
|
using IM.Application.Chat.Commands;
|
|
|
|
namespace IM.Application.Chat.Validators;
|
|
|
|
/// <summary>
|
|
/// 标记已读命令校验器。校验会话 ID 与消息 ID。
|
|
/// </summary>
|
|
public class MarkMessagesReadCommandValidator : AbstractValidator<MarkMessagesReadCommand>
|
|
{
|
|
public MarkMessagesReadCommandValidator()
|
|
{
|
|
RuleFor(x => x.ConversationId).NotEmpty().WithMessage("会话 ID 不能为空");
|
|
RuleFor(x => x.UserId).NotEmpty().WithMessage("用户 ID 不能为空");
|
|
RuleFor(x => x.MessageId).NotEmpty().WithMessage("消息 ID 不能为空");
|
|
}
|
|
}
|