From 6eea61264b9c1da3cf9799b021bbdbb687507d2f Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Mon, 5 Jan 2026 10:43:04 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E9=87=8D=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E5=95=86=E6=88=B7=E9=97=A8=E5=BA=97DTO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../App/Merchants/Dto/MerchantDetailDto.cs | 2 +- .../App/Merchants/Dto/{StoreDto.cs => MerchantStoreDto.cs} | 2 +- .../App/Merchants/MerchantMapping.cs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) rename src/Application/TakeoutSaaS.Application/App/Merchants/Dto/{StoreDto.cs => MerchantStoreDto.cs} (96%) diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs index 35aa22c..1a10909 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantDetailDto.cs @@ -96,7 +96,7 @@ public sealed class MerchantDetailDto /// /// 门店列表。 /// - public IReadOnlyList Stores { get; init; } = []; + public IReadOnlyList Stores { get; init; } = []; /// /// 并发控制版本。 diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/StoreDto.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantStoreDto.cs similarity index 96% rename from src/Application/TakeoutSaaS.Application/App/Merchants/Dto/StoreDto.cs rename to src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantStoreDto.cs index ebd7f04..a3eacbb 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/StoreDto.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/Dto/MerchantStoreDto.cs @@ -7,7 +7,7 @@ namespace TakeoutSaaS.Application.App.Merchants.Dto; /// /// 商户详情门店 DTO。 /// -public sealed class StoreDto +public sealed class MerchantStoreDto { /// /// 门店 ID。 diff --git a/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs b/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs index 29e181b..41298a8 100644 --- a/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs +++ b/src/Application/TakeoutSaaS.Application/App/Merchants/MerchantMapping.cs @@ -50,7 +50,7 @@ internal static class MerchantMapping /// /// 将商户实体映射为详情 DTO。 /// - public static MerchantDetailDto ToDetailDto(Merchant merchant, string? tenantName, IReadOnlyList stores) => new() + public static MerchantDetailDto ToDetailDto(Merchant merchant, string? tenantName, IReadOnlyList stores) => new() { Id = merchant.Id, TenantId = merchant.TenantId, @@ -150,7 +150,7 @@ internal static class MerchantMapping /// /// 将门店实体映射为 DTO。 /// - public static StoreDto ToStoreDto(Store store) => new() + public static MerchantStoreDto ToStoreDto(Store store) => new() { Id = store.Id, Name = store.Name, @@ -201,6 +201,6 @@ internal static class MerchantMapping /// /// 将门店集合映射为 DTO 集合。 /// - public static IReadOnlyList ToStoreDtos(IEnumerable stores) + public static IReadOnlyList ToStoreDtos(IEnumerable stores) => stores.Select(ToStoreDto).ToList(); }