refactor: 移除平台侧能力并收紧租户隔离
This commit is contained in:
@@ -9,32 +9,6 @@ namespace TakeoutSaaS.Application.App.Tenants;
|
||||
/// </summary>
|
||||
internal static class TenantMapping
|
||||
{
|
||||
/// <summary>
|
||||
/// 将租户实体与订阅、认证信息映射为租户 DTO。
|
||||
/// </summary>
|
||||
/// <param name="tenant">租户实体。</param>
|
||||
/// <param name="subscription">订阅信息。</param>
|
||||
/// <param name="verification">认证信息。</param>
|
||||
/// <returns>租户 DTO。</returns>
|
||||
public static TenantDto ToDto(Tenant tenant, TenantSubscription? subscription, TenantVerificationProfile? verification)
|
||||
=> new()
|
||||
{
|
||||
Id = tenant.Id,
|
||||
Code = tenant.Code,
|
||||
Name = tenant.Name,
|
||||
ShortName = tenant.ShortName,
|
||||
ContactName = tenant.ContactName,
|
||||
ContactPhone = tenant.ContactPhone,
|
||||
ContactEmail = tenant.ContactEmail,
|
||||
Status = tenant.Status,
|
||||
VerificationStatus = verification?.Status ?? Domain.Tenants.Enums.TenantVerificationStatus.Draft,
|
||||
OperatingMode = tenant.OperatingMode,
|
||||
CurrentPackageId = subscription?.TenantPackageId,
|
||||
EffectiveFrom = subscription?.EffectiveFrom ?? tenant.EffectiveFrom,
|
||||
EffectiveTo = subscription?.EffectiveTo ?? tenant.EffectiveTo,
|
||||
AutoRenew = subscription?.AutoRenew ?? false
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将租户认证实体映射为 DTO。
|
||||
/// </summary>
|
||||
@@ -65,60 +39,6 @@ internal static class TenantMapping
|
||||
ReviewedAt = profile.ReviewedAt
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将订阅实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="subscription">订阅实体。</param>
|
||||
/// <returns>订阅 DTO 或 null。</returns>
|
||||
public static TenantSubscriptionDto? ToSubscriptionDto(this TenantSubscription? subscription)
|
||||
=> subscription == null
|
||||
? null
|
||||
: new TenantSubscriptionDto
|
||||
{
|
||||
Id = subscription.Id,
|
||||
TenantId = subscription.TenantId,
|
||||
TenantPackageId = subscription.TenantPackageId,
|
||||
Status = subscription.Status,
|
||||
EffectiveFrom = subscription.EffectiveFrom,
|
||||
EffectiveTo = subscription.EffectiveTo,
|
||||
NextBillingDate = subscription.NextBillingDate,
|
||||
AutoRenew = subscription.AutoRenew
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将审计日志实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="log">审计日志实体。</param>
|
||||
/// <returns>审计日志 DTO。</returns>
|
||||
public static TenantAuditLogDto ToDto(this TenantAuditLog log)
|
||||
=> new()
|
||||
{
|
||||
Id = log.Id,
|
||||
TenantId = log.TenantId,
|
||||
Action = log.Action,
|
||||
Title = log.Title,
|
||||
Description = log.Description,
|
||||
OperatorName = log.OperatorName,
|
||||
PreviousStatus = log.PreviousStatus,
|
||||
CurrentStatus = log.CurrentStatus,
|
||||
CreatedAt = log.CreatedAt
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将审核领取实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="claim">领取实体。</param>
|
||||
/// <returns>领取 DTO。</returns>
|
||||
public static TenantReviewClaimDto ToDto(this TenantReviewClaim claim)
|
||||
=> new()
|
||||
{
|
||||
Id = claim.Id,
|
||||
TenantId = claim.TenantId,
|
||||
ClaimedBy = claim.ClaimedBy,
|
||||
ClaimedByName = claim.ClaimedByName,
|
||||
ClaimedAt = claim.ClaimedAt
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将套餐实体映射为 DTO。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user