feat: implement tenant product category management APIs
All checks were successful
Build and Deploy TenantApi / build-and-deploy (push) Successful in 44s

This commit is contained in:
2026-02-20 18:45:48 +08:00
parent eea8a53da3
commit 1b3525862a
41 changed files with 9951 additions and 2 deletions

View File

@@ -31,4 +31,14 @@ public sealed class ProductCategory : MultiTenantEntityBase
/// 是否启用。
/// </summary>
public bool IsEnabled { get; set; } = true;
/// <summary>
/// 分类图标。
/// </summary>
public string? Icon { get; set; }
/// <summary>
/// 分类可见渠道 JSON。
/// </summary>
public string ChannelsJson { get; set; } = "[\"wm\"]";
}

View File

@@ -28,6 +28,36 @@ public interface IProductRepository
/// </summary>
Task<IReadOnlyList<ProductCategory>> GetCategoriesByStoreAsync(long tenantId, long storeId, bool onlyEnabled = true, CancellationToken cancellationToken = default);
/// <summary>
/// 依据标识读取分类。
/// </summary>
Task<ProductCategory?> FindCategoryByIdAsync(long categoryId, long tenantId, CancellationToken cancellationToken = default);
/// <summary>
/// 判断门店内分类名称是否已存在。
/// </summary>
Task<bool> ExistsCategoryNameAsync(long tenantId, long storeId, string name, long? excludeCategoryId = null, CancellationToken cancellationToken = default);
/// <summary>
/// 统计分类下商品数量。
/// </summary>
Task<Dictionary<long, int>> CountProductsByCategoryIdsAsync(long tenantId, long storeId, IReadOnlyCollection<long> categoryIds, CancellationToken cancellationToken = default);
/// <summary>
/// 查询商品选择器列表。
/// </summary>
Task<IReadOnlyList<Product>> SearchPickerAsync(long tenantId, long storeId, long? categoryId, string? keyword, int limit, CancellationToken cancellationToken = default);
/// <summary>
/// 批量更新商品分类。
/// </summary>
Task<int> BatchUpdateProductCategoryAsync(long tenantId, long storeId, long categoryId, IReadOnlyCollection<long> productIds, CancellationToken cancellationToken = default);
/// <summary>
/// 单商品换绑分类。
/// </summary>
Task<bool> MoveProductToCategoryAsync(long tenantId, long storeId, long fromCategoryId, long toCategoryId, long productId, CancellationToken cancellationToken = default);
/// <summary>
/// 获取商品 SKU。
/// </summary>