feat: 增强仓储CRUD与种子配置

This commit is contained in:
2025-12-02 09:46:44 +08:00
parent ffc4f0885f
commit 1a01454266
16 changed files with 587 additions and 56 deletions

View File

@@ -113,4 +113,26 @@ public sealed class EfMerchantRepository : IMerchantRepository
{
return _context.SaveChangesAsync(cancellationToken);
}
/// <inheritdoc />
public Task UpdateMerchantAsync(Merchant merchant, CancellationToken cancellationToken = default)
{
_context.Merchants.Update(merchant);
return Task.CompletedTask;
}
/// <inheritdoc />
public async Task DeleteMerchantAsync(long merchantId, long tenantId, CancellationToken cancellationToken = default)
{
var existing = await _context.Merchants
.Where(x => x.TenantId == tenantId && x.Id == merchantId)
.FirstOrDefaultAsync(cancellationToken);
if (existing == null)
{
return;
}
_context.Merchants.Remove(existing);
}
}