zeroframework/Services/DeviceCenter/ZeroFramework.DeviceCenter.Application/Validations/Devices/DeviceGroupCreateRequestModelValidator.cs
2023-12-05 17:22:48 +08:00

14 lines
465 B
C#

using FluentValidation;
using ZeroFramework.DeviceCenter.Application.Models.Devices;
namespace ZeroFramework.DeviceCenter.Application.Validations.Devices
{
public class DeviceCreateRequestModelValidator : AbstractValidator<DeviceCreateRequestModel>
{
public DeviceCreateRequestModelValidator()
{
RuleFor(m => m.Name).NotNull().NotEmpty().Length(5, 20);
RuleFor(m => m.Remark).MaximumLength(100);
}
}
}