feat: 商品上架/下架与全量详情支持

This commit is contained in:
2025-12-04 10:03:42 +08:00
parent 9220e0ca36
commit de5f13ec83
25 changed files with 785 additions and 36 deletions

View File

@@ -27,12 +27,17 @@ public sealed class EfProductRepository(TakeoutAppDbContext context) : IProductR
}
/// <inheritdoc />
public async Task<IReadOnlyList<Product>> SearchAsync(long tenantId, long? categoryId, ProductStatus? status, CancellationToken cancellationToken = default)
public async Task<IReadOnlyList<Product>> SearchAsync(long tenantId, long? storeId, long? categoryId, ProductStatus? status, CancellationToken cancellationToken = default)
{
var query = context.Products
.AsNoTracking()
.Where(x => x.TenantId == tenantId);
if (storeId.HasValue)
{
query = query.Where(x => x.StoreId == storeId.Value);
}
if (categoryId.HasValue)
{
query = query.Where(x => x.CategoryId == categoryId.Value);