mirror of https://github.com/EasyAbp/EShop.git
Browse Source
add product tag plugin and store approval plugin. add store owner and store owner permission check.pull/81/head
449 changed files with 8657 additions and 454 deletions
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs
0
modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs → modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs
@ -1,30 +1,56 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Stores.StoreOwners; |
|||
using EasyAbp.EShop.Stores.StoreOwners.Dtos; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product |
|||
{ |
|||
public class IndexModel : ProductsPageModel |
|||
{ |
|||
private readonly IStoreAppService _storeAppService; |
|||
private readonly IStoreOwnerAppService _storeOwnerAppService; |
|||
|
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid? StoreId { get; set; } |
|||
|
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid? CategoryId { get; set; } |
|||
|
|||
|
|||
[BindProperty(SupportsGet = true)] |
|||
public Guid? TagId { get; set; } |
|||
|
|||
public string StoreName { get; set; } |
|||
|
|||
public IndexModel(IStoreAppService storeAppService) |
|||
|
|||
public IndexModel(IStoreAppService storeAppService, |
|||
IStoreOwnerAppService storeOwnerAppService) |
|||
{ |
|||
_storeAppService = storeAppService; |
|||
_storeOwnerAppService = storeOwnerAppService; |
|||
} |
|||
|
|||
|
|||
public virtual async Task OnGetAsync() |
|||
{ |
|||
StoreName = (await _storeAppService.GetAsync(StoreId)).Name; |
|||
//TODO: Need to handle: when StoreId is empty, and current user owns multiple store
|
|||
if (!StoreId.HasValue && CurrentUser.Id.HasValue) |
|||
{ |
|||
var storeOwners = await _storeOwnerAppService.GetListAsync(new GetStoreOwnerListDto |
|||
{ |
|||
OwnerId = CurrentUser.Id.Value, |
|||
}); |
|||
|
|||
StoreId = storeOwners.Items.FirstOrDefault()?.StoreId; |
|||
} |
|||
|
|||
if (!StoreId.HasValue) |
|||
{ |
|||
var defaultStore = await _storeAppService.GetDefaultAsync(); |
|||
StoreId = defaultStore.Id; |
|||
} |
|||
|
|||
StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name; |
|||
} |
|||
} |
|||
} |
|||
|
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue