feat: 增加分页排序与FluentValidation
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using FluentValidation;
|
||||
using TakeoutSaaS.Application.App.Payments.Commands;
|
||||
|
||||
namespace TakeoutSaaS.Application.App.Payments.Validators;
|
||||
|
||||
/// <summary>
|
||||
/// 创建支付记录命令验证器。
|
||||
/// </summary>
|
||||
public sealed class CreatePaymentCommandValidator : AbstractValidator<CreatePaymentCommand>
|
||||
{
|
||||
/// <summary>
|
||||
/// 初始化验证规则。
|
||||
/// </summary>
|
||||
public CreatePaymentCommandValidator()
|
||||
{
|
||||
RuleFor(x => x.OrderId).GreaterThan(0);
|
||||
RuleFor(x => x.Amount).GreaterThan(0);
|
||||
RuleFor(x => x.TradeNo).MaximumLength(64);
|
||||
RuleFor(x => x.ChannelTransactionId).MaximumLength(64);
|
||||
RuleFor(x => x.Remark).MaximumLength(256);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user