docs: 补全租户与字典模块注释
This commit is contained in:
@@ -8,6 +8,13 @@ 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()
|
||||
{
|
||||
@@ -26,6 +33,11 @@ internal static class TenantMapping
|
||||
AutoRenew = subscription?.AutoRenew ?? false
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将租户认证实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="profile">认证实体。</param>
|
||||
/// <returns>认证 DTO 或 null。</returns>
|
||||
public static TenantVerificationDto? ToVerificationDto(this TenantVerificationProfile? profile)
|
||||
=> profile == null
|
||||
? null
|
||||
@@ -45,6 +57,11 @@ 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
|
||||
@@ -60,6 +77,11 @@ internal static class TenantMapping
|
||||
AutoRenew = subscription.AutoRenew
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将审计日志实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="log">审计日志实体。</param>
|
||||
/// <returns>审计日志 DTO。</returns>
|
||||
public static TenantAuditLogDto ToDto(this TenantAuditLog log)
|
||||
=> new()
|
||||
{
|
||||
@@ -74,6 +96,11 @@ internal static class TenantMapping
|
||||
CreatedAt = log.CreatedAt
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将套餐实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="package">套餐实体。</param>
|
||||
/// <returns>套餐 DTO。</returns>
|
||||
public static TenantPackageDto ToDto(this TenantPackage package)
|
||||
=> new()
|
||||
{
|
||||
@@ -93,6 +120,11 @@ internal static class TenantMapping
|
||||
SortOrder = package.SortOrder
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将账单实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="bill">账单实体。</param>
|
||||
/// <returns>账单 DTO。</returns>
|
||||
public static TenantBillingDto ToDto(this TenantBillingStatement bill)
|
||||
=> new()
|
||||
{
|
||||
@@ -108,6 +140,13 @@ internal static class TenantMapping
|
||||
LineItemsJson = bill.LineItemsJson
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将公告实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="announcement">公告实体。</param>
|
||||
/// <param name="isRead">是否已读。</param>
|
||||
/// <param name="readAt">阅读时间。</param>
|
||||
/// <returns>公告 DTO。</returns>
|
||||
public static TenantAnnouncementDto ToDto(this TenantAnnouncement announcement, bool isRead, DateTime? readAt)
|
||||
=> new()
|
||||
{
|
||||
@@ -124,6 +163,11 @@ internal static class TenantMapping
|
||||
ReadAt = readAt
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
/// 将通知实体映射为 DTO。
|
||||
/// </summary>
|
||||
/// <param name="notification">通知实体。</param>
|
||||
/// <returns>通知 DTO。</returns>
|
||||
public static TenantNotificationDto ToDto(this TenantNotification notification)
|
||||
=> new()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user