refactor: 引入管理端 DbContext 禁用租户过滤
This commit is contained in:
@@ -12,7 +12,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfDeliveryRepository(TakeoutAppDbContext context) : IDeliveryRepository
|
||||
public sealed class EfDeliveryRepository(TakeoutAdminDbContext context) : IDeliveryRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<DeliveryOrder?> FindByIdAsync(long deliveryOrderId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 提供库存与批次的读写能力。
|
||||
/// </remarks>
|
||||
public sealed class EfInventoryRepository(TakeoutAppDbContext context) : IInventoryRepository
|
||||
public sealed class EfInventoryRepository(TakeoutAdminDbContext context) : IInventoryRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<InventoryItem?> FindByIdAsync(long inventoryItemId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 商户类目的 EF Core 仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfMerchantCategoryRepository(TakeoutAppDbContext context)
|
||||
public sealed class EfMerchantCategoryRepository(TakeoutAdminDbContext context)
|
||||
: IMerchantCategoryRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfMerchantRepository(TakeoutAppDbContext context, TakeoutLogsDbContext logsContext) : IMerchantRepository
|
||||
public sealed class EfMerchantRepository(TakeoutAdminDbContext context, TakeoutLogsDbContext logsContext) : IMerchantRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Merchant?> FindByIdAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfOrderRepository(TakeoutAppDbContext context) : IOrderRepository
|
||||
public sealed class EfOrderRepository(TakeoutAdminDbContext context) : IOrderRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Order?> FindByIdAsync(long orderId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfPaymentRepository(TakeoutAppDbContext context) : IPaymentRepository
|
||||
public sealed class EfPaymentRepository(TakeoutAdminDbContext context) : IPaymentRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<PaymentRecord?> FindByIdAsync(long paymentId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfProductRepository(TakeoutAppDbContext context) : IProductRepository
|
||||
public sealed class EfProductRepository(TakeoutAdminDbContext context) : IProductRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Product?> FindByIdAsync(long productId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// EF 配额包仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfQuotaPackageRepository(TakeoutAppDbContext context) : IQuotaPackageRepository
|
||||
public sealed class EfQuotaPackageRepository(TakeoutAdminDbContext context) : IQuotaPackageRepository
|
||||
{
|
||||
#region 配额包定义
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 统计数据仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfStatisticsRepository(TakeoutAppDbContext dbContext) : IStatisticsRepository
|
||||
public sealed class EfStatisticsRepository(TakeoutAdminDbContext dbContext) : IStatisticsRepository
|
||||
{
|
||||
#region 订阅统计
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <remarks>
|
||||
/// 初始化仓储。
|
||||
/// </remarks>
|
||||
public sealed class EfStoreRepository(TakeoutAppDbContext context) : IStoreRepository
|
||||
public sealed class EfStoreRepository(TakeoutAdminDbContext context) : IStoreRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Store?> FindByIdAsync(long storeId, long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 订阅管理仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfSubscriptionRepository(TakeoutAppDbContext dbContext, TakeoutLogsDbContext logsContext) : ISubscriptionRepository
|
||||
public sealed class EfSubscriptionRepository(TakeoutAdminDbContext dbContext, TakeoutLogsDbContext logsContext) : ISubscriptionRepository
|
||||
{
|
||||
#region 订阅查询
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// EF 公告已读仓储。
|
||||
/// </summary>
|
||||
public sealed class EfTenantAnnouncementReadRepository(TakeoutAppDbContext context) : ITenantAnnouncementReadRepository
|
||||
public sealed class EfTenantAnnouncementReadRepository(TakeoutAdminDbContext context) : ITenantAnnouncementReadRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<TenantAnnouncementRead>> GetByAnnouncementAsync(long tenantId, long announcementId, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// EF 租户公告仓储。
|
||||
/// </summary>
|
||||
public sealed class EfTenantAnnouncementRepository(TakeoutAppDbContext context) : ITenantAnnouncementRepository
|
||||
public sealed class EfTenantAnnouncementRepository(TakeoutAdminDbContext context) : ITenantAnnouncementRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public async Task<IReadOnlyList<TenantAnnouncement>> SearchAsync(
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// EF 租户通知仓储。
|
||||
/// </summary>
|
||||
public sealed class EfTenantNotificationRepository(TakeoutAppDbContext context) : ITenantNotificationRepository
|
||||
public sealed class EfTenantNotificationRepository(TakeoutAdminDbContext context) : ITenantNotificationRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<IReadOnlyList<TenantNotification>> SearchAsync(
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 租户套餐仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfTenantPackageRepository(TakeoutAppDbContext context) : ITenantPackageRepository
|
||||
public sealed class EfTenantPackageRepository(TakeoutAdminDbContext context) : ITenantPackageRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<TenantPackage?> FindByIdAsync(long id, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 租户配额使用历史仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfTenantQuotaUsageHistoryRepository(TakeoutAppDbContext context) : ITenantQuotaUsageHistoryRepository
|
||||
public sealed class EfTenantQuotaUsageHistoryRepository(TakeoutAdminDbContext context) : ITenantQuotaUsageHistoryRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task AddAsync(TenantQuotaUsageHistory history, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 租户配额使用仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfTenantQuotaUsageRepository(TakeoutAppDbContext context) : ITenantQuotaUsageRepository
|
||||
public sealed class EfTenantQuotaUsageRepository(TakeoutAdminDbContext context) : ITenantQuotaUsageRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<TenantQuotaUsage?> FindAsync(long tenantId, TenantQuotaType quotaType, CancellationToken cancellationToken = default)
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TakeoutSaaS.Infrastructure.App.Repositories;
|
||||
/// <summary>
|
||||
/// 租户聚合的 EF Core 仓储实现。
|
||||
/// </summary>
|
||||
public sealed class EfTenantRepository(TakeoutAppDbContext context, TakeoutLogsDbContext logsContext) : ITenantRepository
|
||||
public sealed class EfTenantRepository(TakeoutAdminDbContext context, TakeoutLogsDbContext logsContext) : ITenantRepository
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public Task<Tenant?> FindByIdAsync(long tenantId, CancellationToken cancellationToken = default)
|
||||
|
||||
Reference in New Issue
Block a user