fix: 移除商户中心租户信息兜底返回
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 38s
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 38s
This commit is contained in:
@@ -62,7 +62,8 @@ public sealed class GetCurrentMerchantCenterQueryHandler(
|
|||||||
// 5. 读取商户主体与租户信息
|
// 5. 读取商户主体与租户信息
|
||||||
var merchant = await merchantRepository.FindByIdAsync(merchantId, currentTenantId, cancellationToken)
|
var merchant = await merchantRepository.FindByIdAsync(merchantId, currentTenantId, cancellationToken)
|
||||||
?? throw new BusinessException(ErrorCodes.NotFound, "商户不存在");
|
?? 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. 读取商户关联数据
|
// 6. 读取商户关联数据
|
||||||
var stores = await storeRepository.GetByMerchantIdAsync(merchantId, currentTenantId, cancellationToken);
|
var stores = await storeRepository.GetByMerchantIdAsync(merchantId, currentTenantId, cancellationToken);
|
||||||
@@ -77,7 +78,7 @@ public sealed class GetCurrentMerchantCenterQueryHandler(
|
|||||||
var staffDtos = staffs.Select(StoreMapping.ToDto).ToList();
|
var staffDtos = staffs.Select(StoreMapping.ToDto).ToList();
|
||||||
return new CurrentMerchantCenterDto
|
return new CurrentMerchantCenterDto
|
||||||
{
|
{
|
||||||
Merchant = MerchantMapping.ToDetailDto(merchant, tenant?.Name, storeDtos),
|
Merchant = MerchantMapping.ToDetailDto(merchant, tenant.Name, storeDtos),
|
||||||
Staffs = staffDtos,
|
Staffs = staffDtos,
|
||||||
Documents = MerchantMapping.ToDocumentDtos(documents),
|
Documents = MerchantMapping.ToDocumentDtos(documents),
|
||||||
Contracts = MerchantMapping.ToContractDtos(contracts),
|
Contracts = MerchantMapping.ToContractDtos(contracts),
|
||||||
|
|||||||
Reference in New Issue
Block a user