Commit f1a00bac authored by gdlcf88's avatar gdlcf88

Make storeId required. close #7

parent 89055787
......@@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Orders.Orders
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CustomerUserId { get; protected set; }
......
......@@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payment.PaymentRecordOrders
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }
......
......@@ -10,7 +10,7 @@ namespace EasyAbp.EShop.Payment.RefundRecords
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid OrderId { get; protected set; }
......
......@@ -7,7 +7,7 @@ namespace EasyAbp.EShop.Products.ProductCategories.Dtos
public class CreateUpdateProductCategoryDto
{
[DisplayName("ProductCategoryStoreId")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[DisplayName("ProductCategoryCategoryId")]
......
......@@ -5,7 +5,7 @@ namespace EasyAbp.EShop.Products.ProductCategories.Dtos
{
public class ProductCategoryDto : AuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid CategoryId { get; set; }
......
......@@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
public class CreateUpdateProductDto : IValidatableObject
{
[DisplayName("ProductStoreId")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[DisplayName("ProductProductTypeId")]
......
......@@ -5,7 +5,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
{
public class GetProductListDto : PagedAndSortedResultRequestDto
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid? CategoryId { get; set; }
}
......
......@@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Products.Products.Dtos
{
public class ProductDto : FullAuditedEntityDto<Guid>
{
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
public Guid ProductTypeId { get; set; }
......
......@@ -43,10 +43,8 @@ namespace EasyAbp.EShop.Products.Products
query = query.Where(p => productIds.Contains(p.Id));
}
else if (input.StoreId.HasValue)
{
query = query.Where(p => p.StoreId == input.StoreId);
}
return query;
}
......@@ -141,7 +139,7 @@ namespace EasyAbp.EShop.Products.Products
return dto;
}
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, Guid? storeId, IEnumerable<Guid> categoryIds)
protected virtual async Task UpdateProductCategoriesAsync(Guid productId, Guid storeId, IEnumerable<Guid> categoryIds)
{
await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId));
......
......@@ -8,8 +8,8 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
public interface IProductCategoryRepository : IRepository<ProductCategory, Guid>
{
Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId, CancellationToken cancellationToken = default);
Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid storeId, CancellationToken cancellationToken = default);
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid CategoryId { get; protected set; }
......@@ -24,7 +24,7 @@ namespace EasyAbp.EShop.Products.ProductCategories
public ProductCategory(
Guid id,
Guid? tenantId,
Guid? storeId,
Guid storeId,
Guid categoryId,
Guid productId,
int displayOrder = 0
......
......@@ -11,7 +11,7 @@ namespace EasyAbp.EShop.Products.Products
{
public virtual Guid? TenantId { get; protected set; }
public virtual Guid? StoreId { get; protected set; }
public virtual Guid StoreId { get; protected set; }
public virtual Guid ProductTypeId { get; protected set; }
......@@ -42,7 +42,7 @@ namespace EasyAbp.EShop.Products.Products
public Product(
Guid id,
Guid? tenantId,
Guid? storeId,
Guid storeId,
Guid productTypeId,
string displayName,
InventoryStrategy inventoryStrategy,
......
......@@ -16,14 +16,14 @@ namespace EasyAbp.EShop.Products.ProductCategories
{
}
public virtual async Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid? storeId,
public virtual async Task<List<ProductCategory>> GetListByCategoryId(Guid categoryId, Guid storeId,
CancellationToken cancellationToken = default)
{
return await GetQueryable().Where(pc => pc.CategoryId == categoryId && pc.StoreId == storeId)
.ToListAsync(cancellationToken);
}
public virtual async Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid? storeId,
public virtual async Task<List<ProductCategory>> GetListByProductId(Guid productId, Guid storeId,
CancellationToken cancellationToken = default)
{
return await GetQueryable().Where(pc => pc.ProductId == productId && pc.StoreId == storeId)
......
......@@ -37,7 +37,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product
_service = service;
}
public async Task OnGetAsync(Guid? storeId)
public async Task OnGetAsync(Guid storeId)
{
ProductTypes =
(await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto
......
......@@ -13,7 +13,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM
{
[HiddenInput]
[Display(Name = "ProductStore")]
public Guid? StoreId { get; set; }
public Guid StoreId { get; set; }
[Required]
[SelectItems("ProductTypes")]
......
......@@ -4,6 +4,6 @@ namespace EasyAbp.EShop.Stores.Stores
{
public interface IMultiStore
{
Guid? StoreId { get; }
Guid StoreId { get; }
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment