From 91c9ed413b633f4422ff346cde55097234684eca Mon Sep 17 00:00:00 2001
From: MSuMshk <2039814060@qq.com>
Date: Sun, 14 Dec 2025 18:02:17 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20tenant=20detail=20=E8=BF=94=E5=9B=9E?=
=?UTF-8?q?=E5=AE=9E=E5=90=8D=E4=B8=8E=E5=A5=97=E9=A4=90=E8=AF=A6=E6=83=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../App/Tenants/Dto/TenantDetailDto.cs | 5 +++
.../App/Tenants/Dto/TenantVerificationDto.cs | 31 +++++++++++++++++++
.../Handlers/GetTenantByIdQueryHandler.cs | 14 +++++++--
.../App/Tenants/TenantMapping.cs | 6 ++++
4 files changed, 53 insertions(+), 3 deletions(-)
diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantDetailDto.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantDetailDto.cs
index 9035d93..4b642ff 100644
--- a/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantDetailDto.cs
+++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantDetailDto.cs
@@ -19,4 +19,9 @@ public sealed class TenantDetailDto
/// 当前订阅。
///
public TenantSubscriptionDto? Subscription { get; init; }
+
+ ///
+ /// 当前套餐详情。
+ ///
+ public TenantPackageDto? Package { get; init; }
}
diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantVerificationDto.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantVerificationDto.cs
index 7f39c8f..f925008 100644
--- a/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantVerificationDto.cs
+++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Dto/TenantVerificationDto.cs
@@ -46,6 +46,21 @@ public sealed class TenantVerificationDto
///
public string? LegalPersonIdNumber { get; init; }
+ ///
+ /// 法人身份证正面。
+ ///
+ public string? LegalPersonIdFrontUrl { get; init; }
+
+ ///
+ /// 法人身份证反面。
+ ///
+ public string? LegalPersonIdBackUrl { get; init; }
+
+ ///
+ /// 开户名。
+ ///
+ public string? BankAccountName { get; init; }
+
///
/// 银行账号。
///
@@ -56,6 +71,22 @@ public sealed class TenantVerificationDto
///
public string? BankName { get; init; }
+ ///
+ /// 附加资料(JSON)。
+ ///
+ public string? AdditionalDataJson { get; init; }
+
+ ///
+ /// 提交时间。
+ ///
+ public DateTime? SubmittedAt { get; init; }
+
+ ///
+ /// 审核人 ID。
+ ///
+ [JsonConverter(typeof(NullableSnowflakeIdJsonConverter))]
+ public long? ReviewedBy { get; init; }
+
///
/// 审核备注。
///
diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantByIdQueryHandler.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantByIdQueryHandler.cs
index c4f89f9..694158f 100644
--- a/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantByIdQueryHandler.cs
+++ b/src/Application/TakeoutSaaS.Application/App/Tenants/Handlers/GetTenantByIdQueryHandler.cs
@@ -10,7 +10,9 @@ namespace TakeoutSaaS.Application.App.Tenants.Handlers;
///
/// 租户详情查询处理器。
///
-public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository)
+public sealed class GetTenantByIdQueryHandler(
+ ITenantRepository tenantRepository,
+ ITenantPackageRepository tenantPackageRepository)
: IRequestHandler
{
///
@@ -24,12 +26,18 @@ public sealed class GetTenantByIdQueryHandler(ITenantRepository tenantRepository
var subscription = await tenantRepository.GetActiveSubscriptionAsync(request.TenantId, cancellationToken);
var verification = await tenantRepository.GetVerificationProfileAsync(request.TenantId, cancellationToken);
- // 3. 组装返回
+ // 3. (空行后) 查询当前套餐
+ var package = subscription == null
+ ? null
+ : await tenantPackageRepository.FindByIdAsync(subscription.TenantPackageId, cancellationToken);
+
+ // 4. (空行后) 组装返回
return new TenantDetailDto
{
Tenant = TenantMapping.ToDto(tenant, subscription, verification),
Verification = verification.ToVerificationDto(),
- Subscription = subscription.ToSubscriptionDto()
+ Subscription = subscription.ToSubscriptionDto(),
+ Package = package?.ToDto()
};
}
}
diff --git a/src/Application/TakeoutSaaS.Application/App/Tenants/TenantMapping.cs b/src/Application/TakeoutSaaS.Application/App/Tenants/TenantMapping.cs
index 667d68e..6cf0ef0 100644
--- a/src/Application/TakeoutSaaS.Application/App/Tenants/TenantMapping.cs
+++ b/src/Application/TakeoutSaaS.Application/App/Tenants/TenantMapping.cs
@@ -50,9 +50,15 @@ internal static class TenantMapping
BusinessLicenseUrl = profile.BusinessLicenseUrl,
LegalPersonName = profile.LegalPersonName,
LegalPersonIdNumber = profile.LegalPersonIdNumber,
+ LegalPersonIdFrontUrl = profile.LegalPersonIdFrontUrl,
+ LegalPersonIdBackUrl = profile.LegalPersonIdBackUrl,
+ BankAccountName = profile.BankAccountName,
BankAccountNumber = profile.BankAccountNumber,
BankName = profile.BankName,
+ AdditionalDataJson = profile.AdditionalDataJson,
+ SubmittedAt = profile.SubmittedAt,
ReviewRemarks = profile.ReviewRemarks,
+ ReviewedBy = profile.ReviewedBy,
ReviewedByName = profile.ReviewedByName,
ReviewedAt = profile.ReviewedAt
};