fix: 移除商户中心租户信息兜底返回
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 38s

This commit is contained in:
2026-02-06 14:01:05 +08:00
parent 76ba5a4748
commit f61554fc08

View File

@@ -62,7 +62,8 @@ public sealed class GetCurrentMerchantCenterQueryHandler(
// 5. 读取商户主体与租户信息
var merchant = await merchantRepository.FindByIdAsync(merchantId, currentTenantId, cancellationToken)
?? throw new BusinessException(ErrorCodes.NotFound, "商户不存在");
var tenant = await tenantRepository.FindByIdAsync(currentTenantId, cancellationToken);
var tenant = await tenantRepository.FindByIdAsync(currentTenantId, cancellationToken)
?? throw new BusinessException(ErrorCodes.NotFound, "租户不存在");
// 6. 读取商户关联数据
var stores = await storeRepository.GetByMerchantIdAsync(merchantId, currentTenantId, cancellationToken);
@@ -77,7 +78,7 @@ public sealed class GetCurrentMerchantCenterQueryHandler(
var staffDtos = staffs.Select(StoreMapping.ToDto).ToList();
return new CurrentMerchantCenterDto
{
Merchant = MerchantMapping.ToDetailDto(merchant, tenant?.Name, storeDtos),
Merchant = MerchantMapping.ToDetailDto(merchant, tenant.Name, storeDtos),
Staffs = staffDtos,
Documents = MerchantMapping.ToDocumentDtos(documents),
Contracts = MerchantMapping.ToContractDtos(contracts),