From a995d3c64d66d6d0c79687f243e6186f44b35c91 Mon Sep 17 00:00:00 2001 From: MSuMshk <173331402+msumshk@users.noreply.github.com> Date: Mon, 2 Feb 2026 21:14:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=88=A0=E9=99=A4=E5=AE=A1?= =?UTF-8?q?=E6=A0=B8=E6=8E=A5=E5=8F=A3=E7=9A=84=20renewMonths=20=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 4.5 --- .../Tenants/Commands/ReviewTenantCommand.cs | 5 ----- .../Handlers/ReviewTenantCommandHandler.cs | 18 ++++-------------- 2 files changed, 4 insertions(+), 19 deletions(-) diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Commands/ReviewTenantCommand.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Commands/ReviewTenantCommand.cs index 5d1b31f..d00735f 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Commands/ReviewTenantCommand.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Commands/ReviewTenantCommand.cs @@ -23,11 +23,6 @@ public sealed record ReviewTenantCommand : IRequest /// public string? Reason { get; init; } - /// - /// 续费时长(月)(仅当 Approve=true 时有效)。 - /// - public int? RenewMonths { get; init; } - /// /// 经营模式(仅当 Approve=true 时有效)。 /// diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/ReviewTenantCommandHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/ReviewTenantCommandHandler.cs index 3a2a0ab..2dcba0c 100644 --- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/ReviewTenantCommandHandler.cs +++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/ReviewTenantCommandHandler.cs @@ -109,33 +109,23 @@ public sealed class ReviewTenantCommandHandler( tenant.OperatingMode = request.OperatingMode.Value; } - // 3. 更新订阅有效期(如果指定了续费时长) - if (request.RenewMonths.HasValue && request.RenewMonths.Value > 0) - { - var now = DateTime.UtcNow; - var effectiveFrom = tenant.EffectiveFrom ?? now; - var effectiveTo = effectiveFrom.AddMonths(request.RenewMonths.Value); - tenant.EffectiveFrom = effectiveFrom; - tenant.EffectiveTo = effectiveTo; - } - - // 4. 更新认证资料状态 + // 3. 更新认证资料状态 verification.Status = TenantVerificationStatus.Approved; verification.ReviewedAt = DateTime.UtcNow; verification.ReviewedBy = currentUserAccessor.UserId; verification.ReviewedByName = actorName; - // 5. 释放领取 + // 4. 释放领取 claim.ReleasedAt = DateTime.UtcNow; - // 6. 添加审核日志 + // 5. 添加审核日志 await tenantRepository.AddAuditLogAsync(new TenantAuditLog { Id = idGenerator.NextId(), TenantId = tenant.Id, Action = TenantAuditAction.Approved, Title = "审核通过", - Description = $"审核人:{actorName},续费时长:{request.RenewMonths ?? 0}个月", + Description = $"审核人:{actorName}", OperatorId = currentUserAccessor.UserId, OperatorName = actorName, PreviousStatus = TenantStatus.PendingReview,