You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
625 B

using FluentValidation;
namespace CellularManagement.Application.Features.RolePermissions.Commands.AddRolePermissions;
/// <summary>
/// 添加角色权限命令验证器
/// </summary>
public class AddRolePermissionsCommandValidator : AbstractValidator<AddRolePermissionsCommand>
{
public AddRolePermissionsCommandValidator()
{
RuleFor(x => x.RoleId)
.NotEmpty().WithMessage("角色ID不能为空");
RuleFor(x => x.PermissionIds)
.NotEmpty().WithMessage("权限ID列表不能为空")
.Must(x => x.Any()).WithMessage("至少需要指定一个权限ID");
}
}