feat: 增加分页排序与FluentValidation

This commit is contained in:
2025-12-02 10:50:43 +08:00
parent 93141fbf0c
commit 97bf6cacb0
63 changed files with 904 additions and 49 deletions

View File

@@ -0,0 +1,23 @@
using FluentValidation;
using TakeoutSaaS.Application.App.Payments.Commands;
namespace TakeoutSaaS.Application.App.Payments.Validators;
/// <summary>
/// 更新支付记录命令验证器。
/// </summary>
public sealed class UpdatePaymentCommandValidator : AbstractValidator<UpdatePaymentCommand>
{
/// <summary>
/// 初始化验证规则。
/// </summary>
public UpdatePaymentCommandValidator()
{
RuleFor(x => x.PaymentId).GreaterThan(0);
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);
}
}