refactor: 移除门店跨租户访问入口

This commit is contained in:
root
2026-01-29 14:50:49 +00:00
parent 52fb4fde72
commit f9053356c2
25 changed files with 98 additions and 282 deletions

View File

@@ -1,6 +1,4 @@
using MediatR;
using Microsoft.AspNetCore.Http;
using TakeoutSaaS.Application.App.Stores;
using TakeoutSaaS.Application.App.Stores.Dto;
using TakeoutSaaS.Application.App.Stores.Queries;
using TakeoutSaaS.Application.App.Stores.Services;
@@ -17,7 +15,6 @@ namespace TakeoutSaaS.Application.App.Stores.Handlers;
public sealed class CheckStoreDeliveryZoneQueryHandler(
IStoreRepository storeRepository,
ITenantProvider tenantProvider,
IHttpContextAccessor httpContextAccessor,
IDeliveryZoneService deliveryZoneService)
: IRequestHandler<CheckStoreDeliveryZoneQuery, StoreDeliveryCheckResultDto>
{
@@ -25,8 +22,7 @@ public sealed class CheckStoreDeliveryZoneQueryHandler(
public async Task<StoreDeliveryCheckResultDto> Handle(CheckStoreDeliveryZoneQuery request, CancellationToken cancellationToken)
{
// 1. 校验门店存在
var ignoreTenantFilter = StoreTenantAccess.ShouldIgnoreTenantFilter(httpContextAccessor);
var tenantId = ignoreTenantFilter ? 0 : tenantProvider.GetCurrentTenantId();
var tenantId = tenantProvider.GetCurrentTenantId();
var store = await storeRepository.FindByIdAsync(request.StoreId, tenantId, cancellationToken);
if (store is null)
{