21 lines
598 B
C#
21 lines
598 B
C#
using FluentValidation;
|
|
using TakeoutSaaS.Application.App.Deliveries.Queries;
|
|
|
|
namespace TakeoutSaaS.Application.App.Deliveries.Validators;
|
|
|
|
/// <summary>
|
|
/// 配送单列表查询验证器。
|
|
/// </summary>
|
|
public sealed class SearchDeliveryOrdersQueryValidator : AbstractValidator<SearchDeliveryOrdersQuery>
|
|
{
|
|
/// <summary>
|
|
/// 初始化验证规则。
|
|
/// </summary>
|
|
public SearchDeliveryOrdersQueryValidator()
|
|
{
|
|
RuleFor(x => x.Page).GreaterThan(0);
|
|
RuleFor(x => x.PageSize).InclusiveBetween(1, 200);
|
|
RuleFor(x => x.SortBy).MaximumLength(64);
|
|
}
|
|
}
|