From 467f317ec489b7f75bbc41e623c34343406e07aa Mon Sep 17 00:00:00 2001 From: RayMMond Date: Mon, 3 Aug 2020 00:11:10 +0800 Subject: [PATCH 01/24] update abp to 3.0.5. add product tag plugin and store approval plugin. add store owner and store owner permission check. --- common.props | 2 +- ...EasyAbp.EShop.Application.Contracts.csproj | 4 +- .../EasyAbp.EShop.Application.csproj | 4 +- .../EasyAbp.EShop.Domain.Shared.csproj | 2 +- .../EasyAbp.EShop.Domain.csproj | 2 +- .../EasyAbp.EShop.EntityFrameworkCore.csproj | 2 +- .../EasyAbp.EShop.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.HttpApi.csproj | 2 +- .../EasyAbp.EShop.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Web.csproj | 4 +- ...EShop.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.TestBase.csproj | 6 +- ....EShop.Orders.Application.Contracts.csproj | 4 +- .../EasyAbp.EShop.Orders.Application.csproj | 5 +- .../Orders/BasicPurchasableCheckProvider.cs | 3 +- .../EShop/Orders/Orders/INewOrderGenerator.cs | 3 +- .../Orders/IPurchasableCheckProvider.cs | 3 +- .../Orders/Orders/IPurchasableChecker.cs | 3 +- .../EShop/Orders/Orders/NewOrderGenerator.cs | 8 +- .../EShop/Orders/Orders/OrderAppService.cs | 33 +-- .../EShop/Orders/Orders/PurchasableChecker.cs | 5 +- .../OrdersApplicationAutoMapperProfile.cs | 4 +- .../EasyAbp.EShop.Orders.Domain.Shared.csproj | 2 +- .../EasyAbp.EShop.Orders.Domain.csproj | 4 +- .../Orders/Orders/IOrderDiscountProvider.cs | 2 +- .../EShop/Orders/Orders/IOrderManager.cs | 2 +- .../EShop/Orders/Orders/OrderManager.cs | 4 +- ...bp.EShop.Orders.EntityFrameworkCore.csproj | 2 +- ...EasyAbp.EShop.Orders.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.Orders.HttpApi.csproj | 2 +- .../EasyAbp.EShop.Orders.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Orders.Web.csproj | 4 +- .../OrdersWebAutoMapperProfile.cs | 4 +- ...rders.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Orders.TestBase.csproj | 6 +- ...Shop.Payments.Application.Contracts.csproj | 4 +- .../EasyAbp.EShop.Payments.Application.csproj | 5 +- .../Payments/Payments/PaymentAppService.cs | 40 +-- .../Payments/Refunds/RefundAppService.cs | 28 +- ...asyAbp.EShop.Payments.Domain.Shared.csproj | 2 +- .../EasyAbp.EShop.Payments.Domain.csproj | 4 +- ....EShop.Payments.EntityFrameworkCore.csproj | 2 +- ...syAbp.EShop.Payments.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.Payments.HttpApi.csproj | 2 +- .../EasyAbp.EShop.Payments.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Payments.Web.csproj | 4 +- ...ments.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Payments.TestBase.csproj | 6 +- ...EShop.Plugins.Application.Contracts.csproj | 4 +- .../EasyAbp.EShop.Plugins.Application.csproj | 4 +- ...EasyAbp.EShop.Plugins.Domain.Shared.csproj | 2 +- .../EasyAbp.EShop.Plugins.Domain.csproj | 2 +- ...p.EShop.Plugins.EntityFrameworkCore.csproj | 2 +- ...asyAbp.EShop.Plugins.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.Plugins.HttpApi.csproj | 2 +- .../EasyAbp.EShop.Plugins.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Plugins.Web.csproj | 4 +- ...ugins.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Plugins.TestBase.csproj | 6 +- ...Shop.Products.Application.Contracts.csproj | 6 +- .../ProductsPermissionDefinitionProvider.cs | 3 +- .../Permissions/ProductsPermissions.cs | 1 + .../Products/Dtos/GetProductListDto.cs | 2 + .../Products/Products/IProductAppService.cs | 3 +- ...ToGetProductListWithShowHiddenException.cs | 0 ...AttributeOptionsDeletionFailedException.cs | 0 ...ctAttributesModificationFailedException.cs | 0 .../StaticProductCannotBeModifiedException.cs | 0 .../StoreIsNotProductOwnerException.cs | 0 .../EasyAbp.EShop.Products.Application.csproj | 7 +- .../Products/Categories/CategoryAppService.cs | 5 +- .../ProductCategoryAppService.cs | 5 +- .../ProductInventoryAppService.cs | 13 +- .../Products/Products/ProductAppService.cs | 107 ++++---- .../ProductsApplicationAutoMapperProfile.cs | 18 +- ...asyAbp.EShop.Products.Domain.Shared.csproj | 4 +- .../Products/Localization/Products/en.json | 4 +- .../EShop/Products/Products/IProductSku.cs | 2 +- .../EasyAbp.EShop.Products.Domain.csproj | 6 +- .../ProductStores/IProductStoreRepository.cs | 2 +- .../Products/Products/IProductRepository.cs | 11 +- .../EShop/Products/Products/Product.cs | 3 +- .../EShop/Products/Products/ProductManager.cs | 23 +- ....EShop.Products.EntityFrameworkCore.csproj | 4 +- .../ProductStores/ProductStoreRepository.cs | 11 +- .../Products/Products/ProductRepository.cs | 36 ++- ...syAbp.EShop.Products.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.Products.HttpApi.csproj | 2 +- .../Products/Products/ProductController.cs | 7 +- .../EasyAbp.EShop.Products.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Products.Web.csproj | 4 +- .../Menus/ProductsMenuContributor.cs | 15 +- .../Menus/ProductsMenus.cs | 2 +- .../Products/Product/CreateModal.cshtml.cs | 37 ++- .../Products/Product/EditModal.cshtml.cs | 14 +- .../Products/Products/Product/Index.cshtml | 1 + .../Products/Products/Product/Index.cshtml.cs | 44 ++- .../ViewModels/CreateEditProductViewModel.cs | 6 +- .../EShop/Products/Products/Product/index.js | 4 +- .../ProductsWebAutoMapperProfile.cs | 7 +- ...ducts.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Products.TestBase.csproj | 6 +- ....EShop.Stores.Application.Contracts.csproj | 4 +- .../EShopStoresApplicationContractsModule.cs | 10 +- ...asicStorePermissionAuthorizationHandler.cs | 46 ++++ .../StoreOwnerAuthorizationExtensions.cs | 23 ++ ...StorePermissionAuthorizationRequirement.cs | 18 ++ .../StoresPermissionDefinitionProvider.cs | 2 + .../Stores/Permissions/StoresPermissions.cs | 2 + .../StoreOwners/Dtos/GetStoreOwnerListDto.cs | 12 + .../Stores/StoreOwners/Dtos/StoreOwnerDto.cs | 12 + .../StoreOwners/IStoreOwnerAppService.cs | 16 ++ .../Stores/Dtos/CreateUpdateStoreDto.cs | 7 +- .../EShop/Stores/Stores/Dtos/StoreDto.cs | 2 +- .../EasyAbp.EShop.Stores.Application.csproj | 4 +- .../StoreOwners/StoreOwnerAppService.cs | 54 ++++ .../EShop/Stores/Stores/StoreAppService.cs | 34 ++- .../StoresApplicationAutoMapperProfile.cs | 15 +- .../EasyAbp.EShop.Stores.Domain.Shared.csproj | 2 +- .../EasyAbp.EShop.Stores.Domain.csproj | 4 +- .../StoreOwners/IStoreOwnerRepository.cs | 15 + .../EShop/Stores/StoreOwners/StoreOwner.cs | 26 ++ .../EShop/Stores/Stores/IStoreManager.cs | 14 + .../EShop/Stores/Stores/StoreManager.cs | 58 ++++ ...bp.EShop.Stores.EntityFrameworkCore.csproj | 6 +- .../EShopStoresEntityFrameworkCoreModule.cs | 2 + .../EntityFrameworkCore/IStoresDbContext.cs | 3 + .../EntityFrameworkCore/StoresDbContext.cs | 2 + .../StoresDbContextModelCreatingExtensions.cs | 8 + .../StoreOwners/StoreOwnerRepository.cs | 29 ++ ...EasyAbp.EShop.Stores.HttpApi.Client.csproj | 2 +- .../EasyAbp.EShop.Stores.HttpApi.csproj | 2 +- .../StoreOwners/StoreOwnerController.cs | 34 +++ .../EasyAbp.EShop.Stores.MongoDB.csproj | 2 +- .../EShopStoresWebModule.cs | 4 +- .../EasyAbp.EShop.Stores.Web.csproj | 7 +- .../Stores/Stores/Store/CreateModal.cshtml.cs | 24 +- .../Stores/Stores/Store/EditModal.cshtml.cs | 32 ++- .../ViewModels/CreateEditStoreViewModel.cs | 13 +- .../StoresWebAutoMapperProfile.cs | 9 +- ...tores.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EasyAbp.EShop.Stores.TestBase.csproj | 6 +- ...ugins.Baskets.Application.Contracts.csproj | 4 +- ...p.EShop.Plugins.Baskets.Application.csproj | 4 +- ...EShop.Plugins.Baskets.Domain.Shared.csproj | 4 +- ...asyAbp.EShop.Plugins.Baskets.Domain.csproj | 2 +- ...Plugins.Baskets.EntityFrameworkCore.csproj | 2 +- ...Shop.Plugins.Baskets.HttpApi.Client.csproj | 2 +- ...syAbp.EShop.Plugins.Baskets.HttpApi.csproj | 2 +- ...syAbp.EShop.Plugins.Baskets.MongoDB.csproj | 2 +- .../EasyAbp.EShop.Plugins.Baskets.Web.csproj | 4 +- ...s.Baskets.EntityFrameworkCore.Tests.csproj | 2 +- ...skets.HttpApi.Client.ConsoleTestApp.csproj | 2 +- ...yAbp.EShop.Plugins.Baskets.TestBase.csproj | 6 +- plugins/ProductTag/.gitattributes | 1 + plugins/ProductTag/.gitignore | 258 ++++++++++++++++++ .../EasyAbp.EShop.Plugins.ProductTag.sln | 139 ++++++++++ ...p.EShop.Plugins.ProductTag.sln.DotSettings | 23 ++ plugins/ProductTag/common.props | 30 ++ .../ProductTag/docker-compose.migrations.yml | 13 + .../ProductTag/docker-compose.override.yml | 29 ++ plugins/ProductTag/docker-compose.yml | 25 ++ ...Shop.Plugins.ProductTag.Host.Shared.csproj | 10 + .../MultiTenancy/MultiTenancyConsts.cs | 10 + ...ns.ProductTag.Application.Contracts.csproj | 20 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTagPermissionDefinitionProvider.cs | 24 ++ .../Permissions/ProductTagPermissions.cs | 22 ++ .../ProductTagApplicationContractsModule.cs | 18 ++ .../Dtos/CreateUpdateProductTagsDto.cs | 15 + .../ProductTags/Dtos/GetProductTagListDto.cs | 15 + .../ProductTags/Dtos/ProductTagDto.cs | 14 + .../ProductTags/Dtos/UpdateProductTagDto.cs | 14 + .../ProductTags/IProductTagAppService.cs | 17 ++ .../Tags/Dtos/CreateUpdateTagDto.cs | 30 ++ .../Tags/Dtos/GetTagListDto.cs | 15 + .../Tags/Dtos/TagDto.cs | 26 ++ .../Tags/ITagAppService.cs | 15 + ...Shop.Plugins.ProductTag.Application.csproj | 20 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTagAppService.cs | 14 + .../ProductTagApplicationAutoMapperProfile.cs | 25 ++ .../ProductTagApplicationModule.cs | 27 ++ .../ProductTags/ProductTagAppService.cs | 130 +++++++++ .../Tags/TagAppService.cs | 110 ++++++++ ...op.Plugins.ProductTag.Domain.Shared.csproj | 24 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Localization/ProductTag/cs.json | 21 ++ .../Localization/ProductTag/en.json | 22 ++ .../Localization/ProductTag/pl-PL.json | 20 ++ .../Localization/ProductTag/pt-BR.json | 20 ++ .../Localization/ProductTag/sl.json | 21 ++ .../Localization/ProductTag/tr.json | 22 ++ .../Localization/ProductTag/vi.json | 20 ++ .../Localization/ProductTag/zh-Hans.json | 21 ++ .../Localization/ProductTag/zh-Hant.json | 21 ++ .../Localization/ProductTagResource.cs | 10 + .../ProductTagDomainSharedModule.cs | 37 +++ .../ProductTagErrorCodes.cs | 7 + ...Abp.EShop.Plugins.ProductTag.Domain.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTagDbProperties.cs | 11 + .../ProductTagDomainModule.cs | 16 ++ .../ProductTags/IProductTagRepository.cs | 15 + .../ProductTags/ProductTags.cs | 37 +++ .../ProductTagSettingDefinitionProvider.cs | 14 + .../Settings/ProductTagSettings.cs | 11 + .../Tags/ITagRepository.cs | 13 + .../Tags/Tag.cs | 67 +++++ ...gins.ProductTag.EntityFrameworkCore.csproj | 16 ++ .../IProductTagDbContext.cs | 17 ++ .../ProductTagDbContext.cs | 31 +++ ...ductTagDbContextModelCreatingExtensions.cs | 66 +++++ .../ProductTagEntityFrameworkCoreModule.cs | 29 ++ ...ductTagModelBuilderConfigurationOptions.cs | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTags/ProductTagRepository.cs | 43 +++ .../Tags/TagRepository.cs | 32 +++ ...p.Plugins.ProductTag.HttpApi.Client.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTagHttpApiClientModule.cs | 22 ++ ...bp.EShop.Plugins.ProductTag.HttpApi.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ProductTagBaseController.cs | 13 + .../ProductTagHttpApiModule.cs | 33 +++ .../ProductTags/ProductTagController.cs | 48 ++++ .../Tags/TagController.cs | 54 ++++ ...bp.EShop.Plugins.ProductTag.MongoDB.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MongoDB/IProductTagMongoDbContext.cs | 13 + .../MongoDB/ProductTagMongoDbContext.cs | 20 ++ .../ProductTagMongoDbContextExtensions.cs | 22 ++ .../MongoDB/ProductTagMongoDbModule.cs | 23 ++ ...agMongoModelBuilderConfigurationOptions.cs | 14 + ...asyAbp.EShop.Plugins.ProductTag.Web.csproj | 47 ++++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Menus/ProductTagMenuContributor.cs | 39 +++ .../Menus/ProductTagMenus.cs | 13 + .../EShop/Products/ProductTag/Index.cshtml | 9 + .../EShop/Products/ProductTag/Index.cshtml.cs | 9 + .../Products/ProductTag/_ViewImports.cshtml | 4 + .../Products/Tags/Tag/CreateModal.cshtml | 18 ++ .../Products/Tags/Tag/CreateModal.cshtml.cs | 26 ++ .../EShop/Products/Tags/Tag/EditModal.cshtml | 19 ++ .../Products/Tags/Tag/EditModal.cshtml.cs | 37 +++ .../EShop/Products/Tags/Tag/Index.cshtml | 61 +++++ .../EShop/Products/Tags/Tag/Index.cshtml.cs | 51 ++++ .../Pages/EShop/Products/Tags/Tag/index.css | 0 .../Pages/EShop/Products/Tags/Tag/index.js | 80 ++++++ .../Pages/ProductTagPageModel.cs | 16 ++ .../ProductTagWebAutoMapperProfile.cs | 18 ++ .../ProductTagWebModule.cs | 58 ++++ .../Properties/launchSettings.json | 27 ++ ...lugins.ProductTag.Application.Tests.csproj | 16 ++ .../ProductTagApplicationTestBase.cs | 10 + .../ProductTagApplicationTestModule.cs | 13 + .../Samples/SampleAppService_Tests.cs | 30 ++ ...hop.Plugins.ProductTag.Domain.Tests.csproj | 15 + .../ProductTagDomainTestBase.cs | 10 + .../ProductTagDomainTestModule.cs | 17 ++ .../Samples/SampleManager_Tests.cs | 21 ++ ...roductTag.EntityFrameworkCore.Tests.csproj | 18 ++ .../ProductTagEntityFrameworkCoreTestBase.cs | 10 + ...ProductTagEntityFrameworkCoreTestModule.cs | 43 +++ .../Samples/SampleRepository_Tests.cs | 12 + .../ClientDemoService.cs | 156 +++++++++++ .../ConsoleTestAppHostedService.cs | 26 ++ ...ctTag.HttpApi.Client.ConsoleTestApp.csproj | 26 ++ .../ProductTagConsoleApiClientModule.cs | 14 + .../Program.cs | 21 ++ .../appsettings.json | 21 ++ ...op.Plugins.ProductTag.MongoDB.Tests.csproj | 17 ++ .../MongoDB/MongoDbFixture.cs | 22 ++ .../MongoDB/MongoTestCollection.cs | 10 + .../MongoDB/ProductTagMongoDbTestBase.cs | 10 + .../MongoDB/ProductTagMongoDbTestModule.cs | 25 ++ .../MongoDB/Samples/SampleRepository_Tests.cs | 14 + ...p.EShop.Plugins.ProductTag.TestBase.csproj | 23 ++ .../ProductTagDataSeedContributor.cs | 27 ++ .../ProductTagTestBase.cs | 60 ++++ .../ProductTagTestBaseModule.cs | 42 +++ .../Samples/SampleRepository_Tests.cs | 27 ++ .../Security/FakeCurrentPrincipalAccessor.cs | 43 +++ plugins/StoreApproval/.gitattributes | 1 + plugins/StoreApproval/.gitignore | 258 ++++++++++++++++++ .../EasyAbp.EShop.Plugins.StoreApproval.sln | 144 ++++++++++ ...Shop.Plugins.StoreApproval.sln.DotSettings | 25 ++ plugins/StoreApproval/common.props | 30 ++ .../docker-compose.migrations.yml | 13 + .../StoreApproval/docker-compose.override.yml | 29 ++ plugins/StoreApproval/docker-compose.yml | 25 ++ ...p.Plugins.StoreApproval.Host.Shared.csproj | 10 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MultiTenancy/MultiTenancyConsts.cs | 10 + ...StoreApproval.Application.Contracts.csproj | 16 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...oreApprovalPermissionDefinitionProvider.cs | 25 ++ .../Permissions/StoreApprovalPermissions.cs | 23 ++ .../Dtos/CreateUpdateStoreApplicationDto.cs | 64 +++++ .../Dtos/GetStoreApplicationListDto.cs | 20 ++ .../Dtos/StoreApplicationDto.cs | 37 +++ .../IStoreApplicationAppService.cs | 22 ++ ...StoreApprovalApplicationContractsModule.cs | 16 ++ ...p.Plugins.StoreApproval.Application.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApplicationAppService.cs | 118 ++++++++ .../StoreApprovalAppService.cs | 14 + ...oreApprovalApplicationAutoMapperProfile.cs | 19 ++ .../StoreApprovalApplicationModule.cs | 25 ++ ...Plugins.StoreApproval.Domain.Shared.csproj | 24 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Localization/StoreApproval/cs.json | 31 +++ .../Localization/StoreApproval/en.json | 32 +++ .../Localization/StoreApproval/pl-PL.json | 30 ++ .../Localization/StoreApproval/pt-BR.json | 30 ++ .../Localization/StoreApproval/sl.json | 31 +++ .../Localization/StoreApproval/tr.json | 32 +++ .../Localization/StoreApproval/vi.json | 30 ++ .../Localization/StoreApproval/zh-Hans.json | 31 +++ .../Localization/StoreApproval/zh-Hant.json | 31 +++ .../Localization/StoreApprovalResource.cs | 10 + .../StoreApplications/ApprovalStatusType.cs | 13 + .../StoreApplicationConsts.cs | 13 + .../StoreApprovalDomainSharedModule.cs | 37 +++ .../StoreApprovalErrorCodes.cs | 11 + ....EShop.Plugins.StoreApproval.Domain.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApprovalSettingDefinitionProvider.cs | 14 + .../Settings/StoreApprovalSettings.cs | 11 + .../IStoreApplicationRepository.cs | 9 + .../StoreApplications/StoreApplication.cs | 129 +++++++++ ...toreApplicationAlreadyApprovedException.cs | 13 + ...oreApplicationAlreadySubmittedException.cs | 13 + .../StoreApplicationNotSubmittedException.cs | 13 + .../StoreApplicationUpdatedEventHandler.cs | 65 +++++ .../StoreApprovalDbProperties.cs | 11 + .../StoreApprovalDomainModule.cs | 12 + ...s.StoreApproval.EntityFrameworkCore.csproj | 15 + .../IStoreApprovalDbContext.cs | 16 ++ .../StoreApprovalDbContext.cs | 29 ++ ...pprovalDbContextModelCreatingExtensions.cs | 54 ++++ .../StoreApprovalEntityFrameworkCoreModule.cs | 26 ++ ...pprovalModelBuilderConfigurationOptions.cs | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../EfCoreStoreApplicationRepository.cs | 14 + ...lugins.StoreApproval.HttpApi.Client.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApprovalHttpApiClientModule.cs | 22 ++ ...EShop.Plugins.StoreApproval.HttpApi.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApplicationController.cs | 75 +++++ .../StoreApprovalController.cs | 13 + .../StoreApprovalHttpApiModule.cs | 33 +++ ...EShop.Plugins.StoreApproval.MongoDB.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MongoDB/IStoreApprovalMongoDbContext.cs | 13 + .../MongoDB/StoreApprovalMongoDbContext.cs | 20 ++ .../StoreApprovalMongoDbContextExtensions.cs | 22 ++ .../MongoDB/StoreApprovalMongoDbModule.cs | 23 ++ ...alMongoModelBuilderConfigurationOptions.cs | 14 + ...Abp.EShop.Plugins.StoreApproval.Web.csproj | 40 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Menus/StoreApprovalMenuContributor.cs | 31 +++ .../Menus/StoreApprovalMenus.cs | 11 + .../Pages/StoreApproval/Index.cshtml | 9 + .../Pages/StoreApproval/Index.cshtml.cs | 9 + .../StoreApplication/CreateModal.cshtml | 18 ++ .../StoreApplication/CreateModal.cshtml.cs | 28 ++ .../StoreApplication/EditModal.cshtml | 19 ++ .../StoreApplication/EditModal.cshtml.cs | 39 +++ .../StoreApplication/Index.cshtml | 67 +++++ .../StoreApplication/Index.cshtml.cs | 12 + .../CreateEditStoreApplicationViewModel.cs | 54 ++++ .../StoreApplication/index.css | 0 .../StoreApplication/index.js | 76 ++++++ .../Pages/StoreApproval/_ViewImports.cshtml | 4 + .../Pages/StoreApprovalPageModel.cs | 16 ++ .../Properties/launchSettings.json | 27 ++ .../StoreApprovalWebAutoMapperProfile.cs | 19 ++ .../StoreApprovalWebModule.cs | 59 ++++ ...ins.StoreApproval.Application.Tests.csproj | 16 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApplicationAppServiceTests.cs | 26 ++ .../StoreApprovalApplicationTestBase.cs | 10 + .../StoreApprovalApplicationTestModule.cs | 13 + ....Plugins.StoreApproval.Domain.Tests.csproj | 15 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../StoreApplicationDomainTests.cs | 23 ++ .../StoreApprovalDomainTestBase.cs | 10 + .../StoreApprovalDomainTestModule.cs | 17 ++ ...eApproval.EntityFrameworkCore.Tests.csproj | 18 ++ .../StoreApplicationRepositoryTests.cs | 31 +++ ...toreApprovalEntityFrameworkCoreTestBase.cs | 10 + ...reApprovalEntityFrameworkCoreTestModule.cs | 43 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ClientDemoService.cs | 154 +++++++++++ .../ConsoleTestAppHostedService.cs | 26 ++ ...roval.HttpApi.Client.ConsoleTestApp.csproj | 26 ++ .../Program.cs | 21 ++ .../StoreApprovalConsoleApiClientModule.cs | 14 + .../appsettings.json | 21 ++ ...Plugins.StoreApproval.MongoDB.Tests.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MongoDB/MongoDbFixture.cs | 22 ++ .../MongoDB/MongoTestCollection.cs | 10 + .../MongoDB/StoreApprovalMongoDbTestBase.cs | 10 + .../MongoDB/StoreApprovalMongoDbTestModule.cs | 25 ++ ...Shop.Plugins.StoreApproval.TestBase.csproj | 23 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Security/FakeCurrentPrincipalAccessor.cs | 43 +++ .../StoreApprovalDataSeedContributor.cs | 27 ++ .../StoreApprovalTestBase.cs | 60 ++++ .../StoreApprovalTestBaseModule.cs | 42 +++ .../EShopSample.Application.Contracts.csproj | 12 +- .../EShopSample.Application.csproj | 10 +- .../EShopSample.DbMigrator.csproj | 4 +- .../EShopSample.Domain.Shared.csproj | 16 +- .../EShopSample.Domain.csproj | 18 +- .../EShopSample.EntityFrameworkCore.csproj | 18 +- .../EShopSample.HttpApi.Client.csproj | 10 +- .../EShopSample.HttpApi.csproj | 10 +- .../EShopSample.Web/EShopSample.Web.csproj | 16 +- ...ample.HttpApi.Client.ConsoleTestApp.csproj | 2 +- .../EShopSample.TestBase.csproj | 6 +- .../EShopSample.Web.Tests.csproj | 2 +- 449 files changed, 8657 insertions(+), 454 deletions(-) rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application => EasyAbp.EShop.Products.Application.Contracts}/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs (100%) rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application => EasyAbp.EShop.Products.Application.Contracts}/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs (100%) rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application => EasyAbp.EShop.Products.Application.Contracts}/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs (100%) rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application => EasyAbp.EShop.Products.Application.Contracts}/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs (100%) rename modules/EasyAbp.EShop.Products/src/{EasyAbp.EShop.Products.Application => EasyAbp.EShop.Products.Application.Contracts}/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs (100%) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs create mode 100644 plugins/ProductTag/.gitattributes create mode 100644 plugins/ProductTag/.gitignore create mode 100644 plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln create mode 100644 plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings create mode 100644 plugins/ProductTag/common.props create mode 100644 plugins/ProductTag/docker-compose.migrations.yml create mode 100644 plugins/ProductTag/docker-compose.override.yml create mode 100644 plugins/ProductTag/docker-compose.yml create mode 100644 plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj create mode 100644 plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs create mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs create mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs create mode 100644 plugins/StoreApproval/.gitattributes create mode 100644 plugins/StoreApproval/.gitignore create mode 100644 plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln create mode 100644 plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings create mode 100644 plugins/StoreApproval/common.props create mode 100644 plugins/StoreApproval/docker-compose.migrations.yml create mode 100644 plugins/StoreApproval/docker-compose.override.yml create mode 100644 plugins/StoreApproval/docker-compose.yml create mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj create mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml create mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs create mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs create mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs diff --git a/common.props b/common.props index da3e11c8..5ccbc377 100644 --- a/common.props +++ b/common.props @@ -20,7 +20,7 @@ - + all runtime; build; native; contentfiles; analyzers diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj index d5253194..6f73f372 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application.Contracts/EasyAbp.EShop.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj index 9a79af94..fa679b2d 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Application/EasyAbp.EShop.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj index 814100f6..a0178bd8 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain.Shared/EasyAbp.EShop.Domain.Shared.csproj @@ -9,7 +9,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj index 1e306ec2..1b10364c 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Domain/EasyAbp.EShop.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj index 08e9043d..5f270df1 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.EntityFrameworkCore/EasyAbp.EShop.EntityFrameworkCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj index a4a09eb1..16f437b6 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi.Client/EasyAbp.EShop.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj index 231df789..6fe58b8a 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.HttpApi/EasyAbp.EShop.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj index b288ee5b..164e4471 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.MongoDB/EasyAbp.EShop.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj index f2f49fd8..e074ba51 100644 --- a/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj +++ b/integration/EasyAbp.EShop/src/EasyAbp.EShop.Web/EasyAbp.EShop.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj b/integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj index bb0a397e..16b0e57a 100644 --- a/integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj +++ b/integration/EasyAbp.EShop/test/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj b/integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj index ff2fc018..8a2d9790 100644 --- a/integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj +++ b/integration/EasyAbp.EShop/test/EasyAbp.EShop.TestBase/EasyAbp.EShop.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj index 4233e16a..5d19afe1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp.EShop.Orders.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj index e5947cc7..d7268683 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj @@ -8,9 +8,10 @@ - - + + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs index e0da78f4..8c9252d4 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs @@ -11,8 +11,7 @@ namespace EasyAbp.EShop.Orders.Orders { public class BasicPurchasableCheckProvider : IPurchasableCheckProvider, ITransientDependency { - public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict, - Dictionary orderExtraProperties) + public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict) { await CheckProductsPublishedAsync(input, productDict); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs index fe653e10..efbbd6b1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs @@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface INewOrderGenerator { - Task GenerateAsync(CreateOrderDto input, Dictionary productDict, - Dictionary orderExtraProperties); + Task GenerateAsync(CreateOrderDto input, Dictionary productDict); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs index 98b3c1d1..3bdf79d9 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs @@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IPurchasableCheckProvider { - Task CheckAsync(CreateOrderDto input, Dictionary productDict, - Dictionary orderExtraProperties); + Task CheckAsync(CreateOrderDto input, Dictionary productDict); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs index 572cf8a8..f6c92292 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs @@ -8,7 +8,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IPurchasableChecker { - Task CheckAsync(CreateOrderDto input, Dictionary productDict, - Dictionary orderExtraProperties); + Task CheckAsync(CreateOrderDto input, Dictionary productDict); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index 31e97994..1f67cb94 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -12,6 +12,7 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Json; using Volo.Abp.MultiTenancy; +using Volo.Abp.ObjectExtending; using Volo.Abp.Users; namespace EasyAbp.EShop.Orders.Orders @@ -38,7 +39,7 @@ namespace EasyAbp.EShop.Orders.Orders _productSkuDescriptionProvider = productSkuDescriptionProvider; } - public virtual async Task GenerateAsync(CreateOrderDto input, Dictionary productDict, Dictionary orderExtraProperties) + public virtual async Task GenerateAsync(CreateOrderDto input, Dictionary productDict) { var orderLines = new List(); @@ -61,10 +62,7 @@ namespace EasyAbp.EShop.Orders.Orders refundedAmount: 0, customerRemark: input.CustomerRemark); - foreach (var orderExtraProperty in orderExtraProperties) - { - order.SetProperty(orderExtraProperty.Key, orderExtraProperty.Value); - } + input.MapExtraPropertiesTo(order, MappingPropertyDefinitionChecks.Both); order.SetOrderLines(orderLines); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index 1b966cd0..0681894a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -6,6 +6,7 @@ using EasyAbp.EShop.Orders.Authorization; using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; +using EasyAbp.EShop.Stores.Permissions; using Microsoft.AspNetCore.Authorization; using Volo.Abp; using Volo.Abp.Application.Dtos; @@ -67,7 +68,8 @@ namespace EasyAbp.EShop.Orders.Orders if (input.StoreId.HasValue) { - // Todo: Check if current user is an admin of the store. + await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId.Value, + OrdersPermissions.Orders.Manage); } else { @@ -86,11 +88,10 @@ namespace EasyAbp.EShop.Orders.Orders if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage); - - // Todo: Check if current user is an admin of the store. + await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, + OrdersPermissions.Orders.Manage); } - + return MapToGetOutputDto(order); } @@ -103,13 +104,11 @@ namespace EasyAbp.EShop.Orders.Orders var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList(), input.StoreId); - var orderExtraProperties = new Dictionary(); + await _purchasableChecker.CheckAsync(input, productDict); - await _purchasableChecker.CheckAsync(input, productDict, orderExtraProperties); - - var order = await _newOrderGenerator.GenerateAsync(input, productDict, orderExtraProperties); + var order = await _newOrderGenerator.GenerateAsync(input, productDict); - await _orderManager.DiscountAsync(order, input.ExtraProperties); + await _orderManager.DiscountAsync(order); await Repository.InsertAsync(order, autoSave: true); @@ -134,7 +133,7 @@ namespace EasyAbp.EShop.Orders.Orders { throw new NotSupportedException(); } - + [RemoteService(false)] public override Task DeleteAsync(Guid id) { @@ -149,11 +148,9 @@ namespace EasyAbp.EShop.Orders.Orders if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage); - - // Todo: Check if current user is an admin of the store. + await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage); } - + return MapToGetOutputDto(order); } @@ -161,12 +158,10 @@ namespace EasyAbp.EShop.Orders.Orders public virtual async Task CompleteAsync(CompleteOrderInput input) { var order = await GetEntityByIdAsync(input.OrderId); - + if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage); - - // Todo: Check if current user is an admin of the store. + await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage); } order = await _orderManager.CompleteAsync(order); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs index ed1bbf19..4648a1f5 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs @@ -17,14 +17,13 @@ namespace EasyAbp.EShop.Orders.Orders _serviceProvider = serviceProvider; } - public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict, - Dictionary orderExtraProperties) + public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict) { var providers = _serviceProvider.GetServices(); foreach (var provider in providers) { - await provider.CheckAsync(input, productDict, orderExtraProperties); + await provider.CheckAsync(input, productDict); } } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs index 42e8fa7f..bf0c9484 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs @@ -1,6 +1,7 @@ using EasyAbp.EShop.Orders.Orders; using EasyAbp.EShop.Orders.Orders.Dtos; using AutoMapper; +using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Orders { @@ -11,7 +12,8 @@ namespace EasyAbp.EShop.Orders /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); CreateMap(); } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj index 4c581bce..b4cb6ac0 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj index 1f671c4c..5d5dc2c7 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs index e3f85c61..2fd6dd4b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs @@ -5,6 +5,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrderDiscountProvider { - Task DiscountAsync(Order order, Dictionary inputExtraProperties); + Task DiscountAsync(Order order); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs index ff6afc69..f5e3ce6b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs @@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrderManager : IDomainService { - Task DiscountAsync(Order order, Dictionary inputExtraProperties); + Task DiscountAsync(Order order); Task CompleteAsync(Order order); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs index bb0000fa..a8bf7622 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs @@ -19,11 +19,11 @@ namespace EasyAbp.EShop.Orders.Orders _orderRepository = orderRepository; } - public virtual async Task DiscountAsync(Order order, Dictionary inputExtraProperties) + public virtual async Task DiscountAsync(Order order) { foreach (var provider in ServiceProvider.GetServices()) { - await provider.DiscountAsync(order, inputExtraProperties); + await provider.DiscountAsync(order); } return order; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj index 06084e49..6a8cebce 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp.EShop.Orders.EntityFrameworkCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj index 9beb9cd6..9ee137e7 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi.Client/EasyAbp.EShop.Orders.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj index 7d168598..e2f475da 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.HttpApi/EasyAbp.EShop.Orders.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj index 193a549d..02bf2c53 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.MongoDB/EasyAbp.EShop.Orders.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj index 1181b13c..6c0fe4d5 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/EasyAbp.EShop.Orders.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs index ab082c0a..9da94e9d 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs @@ -1,5 +1,6 @@ using EasyAbp.EShop.Orders.Orders.Dtos; using AutoMapper; +using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Orders.Web { @@ -10,7 +11,8 @@ namespace EasyAbp.EShop.Orders.Web /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); CreateMap(); } } diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj index 0cf6c3b6..708aca8d 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Orders.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj index b5ce62f0..8d61cc2e 100644 --- a/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj +++ b/modules/EasyAbp.EShop.Orders/test/EasyAbp.EShop.Orders.TestBase/EasyAbp.EShop.Orders.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj index 598bff72..915bbaed 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj index fc41bb90..66023449 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp.EShop.Payments.Application.csproj @@ -8,9 +8,10 @@ - - + + + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs index 13594975..a5acd0b5 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -1,15 +1,14 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using EasyAbp.EShop.Orders.Orders; using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Payments.Authorization; -using EasyAbp.EShop.Payments.Payments; using EasyAbp.EShop.Payments.Payments.Dtos; +using EasyAbp.EShop.Stores.Permissions; using EasyAbp.PaymentService.Payments; using Microsoft.AspNetCore.Authorization; -using Volo.Abp; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.EventBus.Distributed; @@ -27,8 +26,7 @@ namespace EasyAbp.EShop.Payments.Payments private readonly IPayableChecker _payableChecker; private readonly IDistributedEventBus _distributedEventBus; private readonly IOrderAppService _orderAppService; - private readonly IPaymentRepository _repository; - + public PaymentAppService( IPayableChecker payableChecker, IDistributedEventBus distributedEventBus, @@ -38,7 +36,6 @@ namespace EasyAbp.EShop.Payments.Payments _payableChecker = payableChecker; _distributedEventBus = distributedEventBus; _orderAppService = orderAppService; - _repository = repository; } public override async Task GetAsync(Guid id) @@ -47,14 +44,20 @@ namespace EasyAbp.EShop.Payments.Payments if (payment.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); - - // Todo: Check if current user is an admin of the store. + if (payment.StoreId.HasValue) + { + await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value, + PaymentsPermissions.Payments.Manage); + } + else + { + await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); + } } return payment; } - + protected override IQueryable CreateFilteredQuery(GetPaymentListDto input) { var query = base.CreateFilteredQuery(input); @@ -75,7 +78,8 @@ namespace EasyAbp.EShop.Payments.Payments if (input.StoreId.HasValue) { - // Todo: Check if current user is an admin of the store. + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, + PaymentsPermissions.Payments.Manage); } else { @@ -85,23 +89,23 @@ namespace EasyAbp.EShop.Payments.Payments return await base.GetListAsync(input); } - + [Authorize(PaymentsPermissions.Payments.Create)] public virtual async Task CreateAsync(CreatePaymentDto input) { var orders = new List(); - + foreach (var orderId in input.OrderIds) { orders.Add(await _orderAppService.GetAsync(orderId)); } - var extraProperties = new Dictionary {{"StoreId", orders.First().StoreId}}; + var extraProperties = new Dictionary { { "StoreId", orders.First().StoreId } }; await _payableChecker.CheckAsync(input, orders, extraProperties); // Todo: should avoid duplicate creations. - + await _distributedEventBus.PublishAsync(new CreatePaymentEto { TenantId = CurrentTenant.Id, diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs index ba60f060..4a9d029a 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs @@ -1,11 +1,11 @@ -using System; -using System.Linq; -using System.Threading.Tasks; using EasyAbp.EShop.Payments.Authorization; using EasyAbp.EShop.Payments.Payments; using EasyAbp.EShop.Payments.Refunds.Dtos; +using EasyAbp.EShop.Stores.Permissions; using Microsoft.AspNetCore.Authorization; -using Volo.Abp; +using System; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Users; @@ -21,7 +21,7 @@ namespace EasyAbp.EShop.Payments.Refunds private readonly IPaymentRepository _paymentRepository; private readonly IRefundRepository _repository; - + public RefundAppService( IPaymentRepository paymentRepository, IRefundRepository repository) : base(repository) @@ -35,17 +35,22 @@ namespace EasyAbp.EShop.Payments.Refunds var refund = await base.GetAsync(id); var payment = await _paymentRepository.GetAsync(refund.PaymentId); - + if (payment.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); - - // Todo: Check if current user is an admin of the store. + if (payment.StoreId.HasValue) + { + await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value, PaymentsPermissions.Refunds.Manage); + } + else + { + await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); + } } return refund; } - + protected override IQueryable CreateFilteredQuery(GetRefundListDto input) { var query = input.UserId.HasValue ? _repository.GetQueryableByUserId(input.UserId.Value) : _repository; @@ -66,7 +71,8 @@ namespace EasyAbp.EShop.Payments.Refunds if (input.StoreId.HasValue) { - // Todo: Check if current user is an admin of the store. + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, + PaymentsPermissions.Refunds.Manage); } else { diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj index e24c8c57..fbc64944 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp.EShop.Payments.Domain.Shared.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj index 080bcb68..c1869a12 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp.EShop.Payments.Domain.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj index d1c8b000..a8d06c77 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp.EShop.Payments.EntityFrameworkCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj index 25fd567b..eae5d6de 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi.Client/EasyAbp.EShop.Payments.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj index bef8b959..9ec9c095 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.HttpApi/EasyAbp.EShop.Payments.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj index e171b386..2dd9f834 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.MongoDB/EasyAbp.EShop.Payments.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj index 2a14610c..5c537731 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Web/EasyAbp.EShop.Payments.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj index 1ff1a7c9..c3f6793a 100644 --- a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Payments.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj index 582e12bd..c901a17e 100644 --- a/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj +++ b/modules/EasyAbp.EShop.Payments/test/EasyAbp.EShop.Payments.TestBase/EasyAbp.EShop.Payments.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj index 7be88759..62d68e4f 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application.Contracts/EasyAbp.EShop.Plugins.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj index ecd82098..08255f92 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Application/EasyAbp.EShop.Plugins.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj index bb2fec65..5757660b 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain.Shared/EasyAbp.EShop.Plugins.Domain.Shared.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj index fec1b9bb..b3e37aa7 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Domain/EasyAbp.EShop.Plugins.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj index 8c9d9410..b7c007cc 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.EntityFrameworkCore/EasyAbp.EShop.Plugins.EntityFrameworkCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj index e00eb11a..5b71d7b8 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi.Client/EasyAbp.EShop.Plugins.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj index d5dae3b4..a72ca2b3 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.HttpApi/EasyAbp.EShop.Plugins.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj index e15a603d..4fe5485a 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.MongoDB/EasyAbp.EShop.Plugins.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj index 4566e412..fe09d410 100644 --- a/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj +++ b/modules/EasyAbp.EShop.Plugins/src/EasyAbp.EShop.Plugins.Web/EasyAbp.EShop.Plugins.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj index 7c315b45..149713a8 100644 --- a/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj b/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj index 2ed01749..d4818481 100644 --- a/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj +++ b/modules/EasyAbp.EShop.Plugins/test/EasyAbp.EShop.Plugins.TestBase/EasyAbp.EShop.Plugins.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj index dd94c673..ff8cb48e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp.EShop.Products.Application.Contracts.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs index 47cb94b5..dd51ebde 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs @@ -18,7 +18,8 @@ namespace EasyAbp.EShop.Products.Permissions categories.AddChild(ProductsPermissions.Categories.Create, L("Permission:Create")); categories.AddChild(ProductsPermissions.Categories.Update, L("Permission:Update")); categories.AddChild(ProductsPermissions.Categories.Delete, L("Permission:Delete")); - + categories.AddChild(ProductsPermissions.Categories.ShowHidden, L("Permission:ShowHidden")); + var product = moduleGroup.AddPermission(ProductsPermissions.Products.Default, L("Permission:Product")); product.AddChild(ProductsPermissions.Products.CrossStore, L("Permission:CrossStore")); product.AddChild(ProductsPermissions.Products.Create, L("Permission:Create")); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs index 42a97ea0..49f882ba 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs @@ -18,6 +18,7 @@ namespace EasyAbp.EShop.Products.Permissions public const string Delete = Default + ".Delete"; public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; + public const string ShowHidden = Default + ".ShowHidden"; } public class Products diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs index 561c2981..c9c98591 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/GetProductListDto.cs @@ -1,10 +1,12 @@ using System; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Products.Products.Dtos { public class GetProductListDto : PagedAndSortedResultRequestDto { + [Required] public Guid StoreId { get; set; } public Guid? CategoryId { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs index 9dac6b72..e120831d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs @@ -1,7 +1,6 @@ +using EasyAbp.EShop.Products.Products.Dtos; using System; -using System.Collections.Generic; using System.Threading.Tasks; -using EasyAbp.EShop.Products.Products.Dtos; using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Products.Products diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs similarity index 100% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/NotAllowedToGetProductListWithShowHiddenException.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs similarity index 100% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributeOptionsDeletionFailedException.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs similarity index 100% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/ProductAttributesModificationFailedException.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs similarity index 100% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StaticProductCannotBeModifiedException.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs similarity index 100% rename from modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs rename to modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/StoreIsNotProductOwnerException.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj index 1fe7357b..99b3a948 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj @@ -8,9 +8,10 @@ - - - + + + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs index f84a6e40..40ad6d57 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs @@ -34,10 +34,7 @@ namespace EasyAbp.EShop.Products.Categories public override async Task> GetListAsync(GetCategoryListDto input) { - // Todo: Check if current user is an admin of the store. - var isCurrentUserStoreAdmin = true && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Categories.Default); - - if (input.ShowHidden && !isCurrentUserStoreAdmin) + if (input.ShowHidden && !await AuthorizationService.IsGrantedAsync(ProductsPermissions.Categories.ShowHidden)) { throw new NotAllowedToGetCategoryListWithShowHiddenException(); } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs index f951f2c0..7f9296a9 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductCategories/ProductCategoryAppService.cs @@ -1,10 +1,9 @@ +using EasyAbp.EShop.Products.Permissions; +using EasyAbp.EShop.Products.ProductCategories.Dtos; using System; using System.Linq; using System.Threading.Tasks; -using EasyAbp.EShop.Products.Permissions; -using EasyAbp.EShop.Products.ProductCategories.Dtos; using Volo.Abp; -using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Products.ProductCategories diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs index 6160ff31..8244fc94 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs @@ -1,10 +1,11 @@ -using System; -using System.Threading.Tasks; using EasyAbp.EShop.Products.Permissions; using EasyAbp.EShop.Products.ProductInventories.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.ProductStores; +using EasyAbp.EShop.Stores.Permissions; using Microsoft.AspNetCore.Authorization; +using System; +using System.Threading.Tasks; using Volo.Abp.Application.Services; using Volo.Abp.Validation; @@ -50,9 +51,9 @@ namespace EasyAbp.EShop.Products.ProductInventories { throw new AbpValidationException("StoreId should not be null."); } - - // Todo: Check if current user is an admin of the store. - + + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, ProductsPermissions.ProductInventory.Update); + await _productStoreRepository.GetAsync(input.ProductId, input.StoreId.Value); } @@ -65,7 +66,7 @@ namespace EasyAbp.EShop.Products.ProductInventories await _repository.InsertAsync(productInventory, true); } - + await ChangeInventoryAsync(productInventory, input.ChangedInventory); return ObjectMapper.Map(productInventory); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index 35c20af2..e9defd0e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -1,12 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using EasyAbp.EShop.Products.Permissions; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Products.ProductStores; using EasyAbp.EShop.Products.ProductTypes; -using Microsoft.AspNetCore.Authorization; +using EasyAbp.EShop.Stores.Permissions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -48,9 +48,7 @@ namespace EasyAbp.EShop.Products.Products protected override IQueryable CreateFilteredQuery(GetProductListDto input) { - var query = input.CategoryId.HasValue - ? _repository.WithDetails(input.StoreId, input.CategoryId.Value) - : _repository.WithDetails(input.StoreId); + var query = _repository.WithDetails(input.StoreId, input.CategoryId); return input.ShowHidden ? query : query.Where(x => !x.IsHidden); } @@ -65,30 +63,30 @@ namespace EasyAbp.EShop.Products.Products public override async Task CreateAsync(CreateUpdateProductDto input) { await CheckCreatePolicyAsync(); - + var product = MapToEntity(input); TryToSetTenantId(product); - + await UpdateProductAttributesAsync(product, input); - + await _productManager.CreateAsync(product, input.StoreId, input.CategoryIds); return MapToGetOutputDto(product); } - + public override async Task UpdateAsync(Guid id, CreateUpdateProductDto input) { await CheckUpdatePolicyAsync(); await CheckStoreIsProductOwnerAsync(id, input.StoreId); - + var product = await GetEntityByIdAsync(id); - + CheckProductIsNotStatic(product); - + MapToEntity(input, product); - + await UpdateProductAttributesAsync(product, input); await _productManager.UpdateAsync(product, input.CategoryIds); @@ -111,7 +109,7 @@ namespace EasyAbp.EShop.Products.Products var isProductSkusEmpty = product.ProductSkus.IsNullOrEmpty(); var usedAttributeOptionIds = new HashSet(); - + foreach (var serializedAttributeOptionIds in product.ProductSkus.Select(sku => sku.SerializedAttributeOptionIds)) { foreach (var attributeOptionId in await _attributeOptionIdsSerializer.DeserializeAsync(serializedAttributeOptionIds)) @@ -119,21 +117,21 @@ namespace EasyAbp.EShop.Products.Products usedAttributeOptionIds.Add(attributeOptionId); } } - + foreach (var attributeDto in input.ProductAttributes) { var attribute = product.ProductAttributes.FirstOrDefault(a => a.DisplayName == attributeDto.DisplayName); - + if (attribute == null) { if (!isProductSkusEmpty) { throw new ProductAttributesModificationFailedException(); } - + attribute = new ProductAttribute(GuidGenerator.Create(), attributeDto.DisplayName, attributeDto.Description); - + product.ProductAttributes.Add(attribute); } @@ -145,7 +143,7 @@ namespace EasyAbp.EShop.Products.Products { option = new ProductAttributeOption(GuidGenerator.Create(), optionDto.DisplayName, optionDto.Description); - + attribute.ProductAttributeOptions.Add(option); } } @@ -171,7 +169,7 @@ namespace EasyAbp.EShop.Products.Products { throw new ProductAttributesModificationFailedException(); } - + product.ProductAttributes.RemoveAll(a => removedAttributeNames.Contains(a.DisplayName)); } @@ -188,24 +186,24 @@ namespace EasyAbp.EShop.Products.Products { throw new NotSupportedException(); } - + public virtual async Task GetAsync(Guid id, Guid storeId) { await CheckGetPolicyAsync(); var product = await GetEntityByIdAsync(id); - + if (!product.IsPublished) { await CheckStoreIsProductOwnerAsync(product.Id, storeId); } - + var dto = MapToGetOutputDto(product); - + await LoadDtoInventoryDataAsync(product, dto, storeId); await LoadDtoPriceAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductTypeUniqueNameAsync(new[] { dto }); return dto; } @@ -225,16 +223,16 @@ namespace EasyAbp.EShop.Products.Products await CheckGetPolicyAsync(); var product = await _repository.GetAsync(x => x.UniqueName == code); - + if (!product.IsPublished) { await CheckStoreIsProductOwnerAsync(product.Id, storeId); } - + var dto = MapToGetOutputDto(product); - + await LoadDtoInventoryDataAsync(product, dto, storeId); - + return dto; } @@ -242,9 +240,8 @@ namespace EasyAbp.EShop.Products.Products { await CheckGetListPolicyAsync(); - // Todo: Check if current user is an admin of the store. - var isCurrentUserStoreAdmin = true && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Products.Default); - + var isCurrentUserStoreAdmin = await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId, ProductsPermissions.Products.Default); + if (input.ShowHidden && !isCurrentUserStoreAdmin) { throw new NotAllowedToGetProductListWithShowHiddenException(); @@ -252,7 +249,7 @@ namespace EasyAbp.EShop.Products.Products // Todo: Products cache. var query = CreateFilteredQuery(input); - + if (!isCurrentUserStoreAdmin) { query = query.Where(x => x.IsPublished); @@ -266,32 +263,32 @@ namespace EasyAbp.EShop.Products.Products var products = await AsyncExecuter.ToListAsync(query); var items = new List(); - + foreach (var product in products) { var productDto = MapToGetListOutputDto(product); - + await LoadDtoInventoryDataAsync(product, productDto, input.StoreId); await LoadDtoPriceAsync(product, productDto, input.StoreId); items.Add(productDto); } - + await LoadDtosProductTypeUniqueNameAsync(items); - + return new PagedResultDto(totalCount, items); } - + protected virtual async Task LoadDtoInventoryDataAsync(Product product, ProductDto productDto, Guid storeId) { var inventoryDataDict = await _productInventoryProvider.GetInventoryDataDictionaryAsync(product, storeId); productDto.Sold = 0; - + foreach (var productSkuDto in productDto.ProductSkus) { var inventoryData = inventoryDataDict[productSkuDto.Id]; - + productSkuDto.Inventory = inventoryData.Inventory; productSkuDto.Sold = inventoryData.Sold; productDto.Sold += productSkuDto.Sold; @@ -322,7 +319,7 @@ namespace EasyAbp.EShop.Products.Products await CheckDeletePolicyAsync(); var product = await GetEntityByIdAsync(id); - + CheckProductIsNotStatic(product); await CheckStoreIsProductOwnerAsync(id, storeId); @@ -341,28 +338,28 @@ namespace EasyAbp.EShop.Products.Products public async Task CreateSkuAsync(Guid productId, Guid storeId, CreateProductSkuDto input) { await CheckUpdatePolicyAsync(); - + await CheckStoreIsProductOwnerAsync(productId, storeId); - + var product = await GetEntityByIdAsync(productId); CheckProductIsNotStatic(product); - + var sku = ObjectMapper.Map(input); EntityHelper.TrySetId(sku, GuidGenerator.Create); await _productManager.CreateSkuAsync(product, sku); - + return ObjectMapper.Map(product); } - + public async Task UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, UpdateProductSkuDto input) { await CheckUpdatePolicyAsync(); - + await CheckStoreIsProductOwnerAsync(productId, storeId); - + var product = await GetEntityByIdAsync(productId); CheckProductIsNotStatic(product); @@ -372,18 +369,18 @@ namespace EasyAbp.EShop.Products.Products ObjectMapper.Map(input, sku); await _productManager.UpdateSkuAsync(product, sku); - + return ObjectMapper.Map(product); } public async Task DeleteSkuAsync(Guid productId, Guid productSkuId, Guid storeId) { await CheckUpdatePolicyAsync(); - + await CheckStoreIsProductOwnerAsync(productId, storeId); - + var product = await GetEntityByIdAsync(productId); - + CheckProductIsNotStatic(product); var sku = product.ProductSkus.Single(x => x.Id == productSkuId); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs index ac7bcc8c..5e349cc1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs @@ -1,22 +1,22 @@ -using System.Linq; -using EasyAbp.EShop.Products.Products; -using EasyAbp.EShop.Products.Products.Dtos; +using AutoMapper; using EasyAbp.EShop.Products.Categories; using EasyAbp.EShop.Products.Categories.Dtos; -using EasyAbp.EShop.Products.ProductTypes; -using EasyAbp.EShop.Products.ProductTypes.Dtos; using EasyAbp.EShop.Products.ProductCategories; using EasyAbp.EShop.Products.ProductCategories.Dtos; -using AutoMapper; -using EasyAbp.EShop.Products.ProductDetails; -using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.ProductDetailHistories; using EasyAbp.EShop.Products.ProductDetailHistories.Dtos; +using EasyAbp.EShop.Products.ProductDetails; +using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.ProductHistories; using EasyAbp.EShop.Products.ProductHistories.Dtos; -using Volo.Abp.AutoMapper; using EasyAbp.EShop.Products.ProductInventories; using EasyAbp.EShop.Products.ProductInventories.Dtos; +using EasyAbp.EShop.Products.Products; +using EasyAbp.EShop.Products.Products.Dtos; +using EasyAbp.EShop.Products.ProductTypes; +using EasyAbp.EShop.Products.ProductTypes.Dtos; +using System.Linq; +using Volo.Abp.AutoMapper; using Volo.Abp.DependencyInjection; namespace EasyAbp.EShop.Products diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj index 37082b8e..7e8a44d7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp.EShop.Products.Domain.Shared.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json index c2c9aac2..17056c1d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json @@ -70,7 +70,7 @@ "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", "CreateProductType": "CreateProductType", "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", + "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the product type {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", @@ -79,7 +79,7 @@ "ProductCategoryDisplayOrder": "ProductCategoryDisplayOrder", "CreateProductCategory": "CreateProductCategory", "EditProductCategory": "EditProductCategory", - "ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the productcategory {0}?", + "ProductCategoryDeletionConfirmationMessage": "Are you sure to delete the product category {0}?", "Permission:ProductInventory": "ProductInventory", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs index 7dc3231c..0d1117cc 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProductSku.cs @@ -20,6 +20,6 @@ namespace EasyAbp.EShop.Products.Products string MediaResources { get; } - public Guid? ProductDetailId { get; } + Guid? ProductDetailId { get; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj index f7cb7745..9c7a64ff 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp.EShop.Products.Domain.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs index 302f69a6..ee295c5c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductStores/IProductStoreRepository.cs @@ -7,6 +7,6 @@ namespace EasyAbp.EShop.Products.ProductStores { public interface IProductStoreRepository : IRepository { - Task GetAsync(Guid productId, Guid storeId, CancellationToken cancellationToken = default); + Task GetAsync(Guid productId, Guid storeId, bool includeDetails = true, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs index 1e1ab030..47b08be5 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/IProductRepository.cs @@ -6,13 +6,8 @@ namespace EasyAbp.EShop.Products.Products { public interface IProductRepository : IRepository { - IQueryable GetQueryable(Guid storeId, Guid categoryId); - - IQueryable GetQueryable(Guid storeId); - - IQueryable WithDetails(Guid storeId, Guid categoryId); - - IQueryable WithDetails(Guid storeId); - + IQueryable GetQueryable(Guid storeId, Guid? categoryId = null); + + IQueryable WithDetails(Guid storeId, Guid? categoryId = null); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs index bbd034af..782b0604 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs @@ -1,7 +1,6 @@ +using JetBrains.Annotations; using System; using System.Collections.Generic; -using EasyAbp.EShop.Products.ProductDetails; -using JetBrains.Annotations; using Volo.Abp.Domain.Entities.Auditing; namespace EasyAbp.EShop.Products.Products diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs index a15d09c9..698ed8e0 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs @@ -1,10 +1,10 @@ -using System; +using EasyAbp.EShop.Products.ProductCategories; +using EasyAbp.EShop.Products.ProductStores; +using Microsoft.Extensions.DependencyInjection; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using EasyAbp.EShop.Products.ProductCategories; -using EasyAbp.EShop.Products.ProductStores; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Domain.Services; namespace EasyAbp.EShop.Products.Products @@ -51,7 +51,8 @@ namespace EasyAbp.EShop.Products.Products return product; } - public virtual async Task UpdateAsync(Product product, IEnumerable categoryIds = null) + public virtual async Task UpdateAsync(Product product, + IEnumerable categoryIds = null) { await CheckProductCodeUniqueAsync(product); @@ -168,14 +169,16 @@ namespace EasyAbp.EShop.Products.Products protected virtual async Task UpdateProductCategoriesAsync(Guid productId, IEnumerable categoryIds) { - await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId)); + categoryIds ??= new List(); - if (categoryIds == null) + var productCategories = await _productCategoryRepository.GetListByProductIdAsync(productId); + + foreach (var productCategory in productCategories.Where(x => !categoryIds.Contains(x.CategoryId))) { - return; + await _productCategoryRepository.DeleteAsync(productCategory, true); } - - foreach (var categoryId in categoryIds) + + foreach (var categoryId in categoryIds.Except(productCategories.Select(x => x.CategoryId))) { await _productCategoryRepository.InsertAsync( new ProductCategory(GuidGenerator.Create(), CurrentTenant.Id, categoryId, productId), true); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj index 54fe8eab..129fd9a5 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp.EShop.Products.EntityFrameworkCore.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs index 80bcce77..cb5d94a3 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductStores/ProductStoreRepository.cs @@ -1,9 +1,7 @@ +using EasyAbp.EShop.Products.EntityFrameworkCore; using System; -using System.Linq; using System.Threading; using System.Threading.Tasks; -using EasyAbp.EShop.Products.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -16,14 +14,13 @@ namespace EasyAbp.EShop.Products.ProductStores { } - public virtual async Task GetAsync(Guid productId, Guid storeId, CancellationToken cancellationToken = default) + public virtual async Task GetAsync(Guid productId, Guid storeId, bool includeDetails = true, CancellationToken cancellationToken = default) { - var entity = await GetQueryable().Where(x => x.ProductId == productId && x.StoreId == storeId) - .FirstOrDefaultAsync(cancellationToken); + var entity = await FindAsync(x => x.ProductId == productId && x.StoreId == storeId, includeDetails, cancellationToken); if (entity == null) { - throw new EntityNotFoundException(typeof(ProductStore), new {ProductId = productId, StoreId = storeId}); + throw new EntityNotFoundException(typeof(ProductStore), new { ProductId = productId, StoreId = storeId }); } return entity; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs index 470df422..523ce417 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/Products/ProductRepository.cs @@ -20,22 +20,36 @@ namespace EasyAbp.EShop.Products.Products .Include(x => x.ProductSkus); } - public IQueryable GetQueryable(Guid storeId, Guid categoryId) + public IQueryable GetQueryable(Guid storeId, Guid? categoryId = null) { - return JoinProductCategories(GetQueryable(storeId), categoryId); + var queryable = GetStoreQueryable(storeId); + + if (categoryId.HasValue) + { + queryable = JoinProductCategories(queryable, categoryId.Value); + } + + return queryable; } - - public IQueryable GetQueryable(Guid storeId) + + public IQueryable WithDetails(Guid storeId, Guid? categoryId = null) { - return JoinProductStores(GetQueryable(), storeId); + var queryable = WithStoreDetails(storeId); + + if (categoryId.HasValue) + { + queryable = JoinProductCategories(queryable, categoryId.Value); + } + + return queryable; } - - public IQueryable WithDetails(Guid storeId, Guid categoryId) + + protected virtual IQueryable GetStoreQueryable(Guid storeId) { - return JoinProductCategories(WithDetails(storeId), categoryId); + return JoinProductStores(GetQueryable(), storeId); } - - public IQueryable WithDetails(Guid storeId) + + protected virtual IQueryable WithStoreDetails(Guid storeId) { return JoinProductStores(WithDetails(), storeId); } @@ -49,7 +63,7 @@ namespace EasyAbp.EShop.Products.Products (product, productStore) => product ); } - + protected virtual IQueryable JoinProductCategories(IQueryable queryable, Guid categoryId) { return queryable.Join( diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj index bac6ae7a..d414adb9 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi.Client/EasyAbp.EShop.Products.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj index 74384517..b7f69632 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp.EShop.Products.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs index aa9bda8c..b806d0af 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs @@ -18,9 +18,9 @@ namespace EasyAbp.EShop.Products.Products _service = service; } - [HttpGet] - [Route("{id}/abandoned")] + [Route("{id}")] [RemoteService(false)] + [NonAction] public Task GetAsync(Guid id) { return _service.GetAsync(id); @@ -45,8 +45,7 @@ namespace EasyAbp.EShop.Products.Products return _service.UpdateAsync(id, input); } - [HttpDelete] - [Route("{id}/abandoned")] + [NonAction] [RemoteService(false)] public Task DeleteAsync(Guid id) { diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj index 5abb1036..e47053b9 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.MongoDB/EasyAbp.EShop.Products.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj index f4e3528c..96d37c54 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/EasyAbp.EShop.Products.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs index b642997d..55b46a33 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; using EasyAbp.EShop.Products.Localization; using EasyAbp.EShop.Products.Permissions; +using System.Collections.Generic; using System.Threading.Tasks; -using EasyAbp.EShop.Products.Localization; -using EasyAbp.EShop.Stores.Stores; -using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; namespace EasyAbp.EShop.Products.Web.Menus @@ -21,7 +18,9 @@ namespace EasyAbp.EShop.Products.Web.Menus private async Task ConfigureMainMenu(MenuConfigurationContext context) { - var l = context.GetLocalizer(); //Add main menu items. + var l = context.GetLocalizer(); + + //Add main menu items. var productManagementMenuItem = new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"]); @@ -41,12 +40,8 @@ namespace EasyAbp.EShop.Products.Web.Menus if (await context.IsGrantedAsync(ProductsPermissions.Products.Default)) { - var storeAppService = context.ServiceProvider.GetRequiredService(); - - var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; - productManagementMenuItem.AddItem( - new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product?storeId=" + defaultStore) + new ApplicationMenuItem(ProductsMenus.Product, l["Menu:Product"], "/EShop/Products/Products/Product") ); } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs index ef679742..90f85536 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs @@ -9,7 +9,7 @@ public const string ProductType = Prefix + ".ProductType"; public const string Category = Prefix + ".Category"; - + public const string Product = Prefix + ".Product"; //Add your menu items here... diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs index 43771b3b..20e67951 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs @@ -1,7 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using EasyAbp.EShop.Products.Categories; using EasyAbp.EShop.Products.Categories.Dtos; using EasyAbp.EShop.Products.ProductDetails; @@ -12,6 +8,10 @@ using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product @@ -20,14 +20,16 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product { [BindProperty(SupportsGet = true)] public Guid StoreId { get; set; } - + [BindProperty] public CreateEditProductViewModel Product { get; set; } - + public ICollection ProductTypes { get; set; } - + public ICollection Categories { get; set; } + public ICollection Tags { get; set; } + private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; @@ -45,18 +47,18 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product _service = service; } - public virtual async Task OnGetAsync(Guid? categoryId) + public virtual async Task OnGetAsync(Guid? categoryId, Guid? tagId) { ProductTypes = (await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto - {MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount})).Items + { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items .Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList(); - + Categories = (await _categoryAppService.GetListAsync(new GetCategoryListDto - {MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount}))?.Items + { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount }))?.Items .Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList(); - + Product = new CreateEditProductViewModel { StoreId = StoreId, @@ -68,10 +70,15 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product if (categoryId.HasValue) { - Product.CategoryIds = new List(new[] {categoryId.Value}); + Product.CategoryIds = new List(new[] { categoryId.Value }); + } + + if (tagId.HasValue) + { + Product.TagIds = new List(new[] { tagId.Value }); } } - + public virtual async Task OnPostAsync() { var detail = await _productDetailAppService.CreateAsync( @@ -81,7 +88,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product var createDto = ObjectMapper.Map(Product); createDto.ProductDetailId = detail.Id; - + var product = await _service.CreateAsync(createDto); return NoContent(); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs index 0663b796..55fc1270 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs @@ -1,19 +1,19 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using EasyAbp.EShop.Products.Categories; using EasyAbp.EShop.Products.Categories.Dtos; using EasyAbp.EShop.Products.ProductCategories; using EasyAbp.EShop.Products.ProductCategories.Dtos; using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.ProductDetails.Dtos; -using Microsoft.AspNetCore.Mvc; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product @@ -31,6 +31,8 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product public ICollection Categories { get; set; } + public ICollection Tags { get; set; } + private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; @@ -74,7 +76,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product ProductId = productDto.Id, MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items.Select(x => x.CategoryId).ToList(); - + Product.ProductDetail = new CreateEditProductDetailViewModel { StoreId = storeId, diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml index c5ef3d60..548ba20d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml @@ -24,6 +24,7 @@ diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs index 8194c851..fd6f9ecc 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.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; } } } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs index 6ec35a65..e1ed5a60 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs @@ -23,7 +23,11 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM [SelectItems("Categories")] [Display(Name = "ProductCategory")] public List CategoryIds { get; set; } - + + [SelectItems("Tags")] + [Display(Name = "ProductTag")] + public List TagIds { get; set; } + [Display(Name = "ProductUniqueName")] public string UniqueName { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js index 99b0f255..6f049fd2 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js @@ -15,7 +15,7 @@ $(function () { scrollCollapse: true, order: [[1, "asc"]], ajax: abp.libs.datatables.createAjax(service.getList, function () { - return { storeId: storeId, categoryId: categoryId, showHidden: true } + return { storeId: storeId, categoryId: categoryId, tagId: tagId, showHidden: true } }), columnDefs: [ { @@ -69,6 +69,6 @@ $(function () { $('#NewProductButton').click(function (e) { e.preventDefault(); - createModal.open({ storeId: storeId, categoryId: categoryId }); + createModal.open({ storeId: storeId, categoryId: categoryId, tagId: tagId }); }); }); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs index 707aacce..b1dc8a78 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using EasyAbp.EShop.Products.Products.Dtos; @@ -20,6 +20,7 @@ namespace EasyAbp.EShop.Products.Web * into multiple profile classes for a better organization. */ CreateMap() .Ignore(model => model.CategoryIds) + .Ignore(model => model.TagIds) .Ignore(model => model.ProductDetail) .Ignore(model => model.StoreId) .ForSourceMember(dto => dto.Sold, opt => opt.DoNotValidate()) @@ -41,11 +42,11 @@ namespace EasyAbp.EShop.Products.Web x.ProductAttributeNames.Split(",", StringSplitOptions.RemoveEmptyEntries).Select((s, i) => new CreateUpdateProductAttributeDto { - DisplayName = s, + DisplayName = s.Trim(), ProductAttributeOptions = new List( x.ProductAttributeOptionNames.SplitToLines(StringSplitOptions.RemoveEmptyEntries)[i] .Split(",", StringSplitOptions.RemoveEmptyEntries).Select(o => - new CreateUpdateProductAttributeOptionDto {DisplayName = o})) + new CreateUpdateProductAttributeOptionDto {DisplayName = o.Trim()})) }))); CreateMap() .Ignore(model => model.StoreId); diff --git a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp.csproj index d838df6b..9e0db9be 100644 --- a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Products.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.TestBase/EasyAbp.EShop.Products.TestBase.csproj b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.TestBase/EasyAbp.EShop.Products.TestBase.csproj index 61a2674c..3aa085a1 100644 --- a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.TestBase/EasyAbp.EShop.Products.TestBase.csproj +++ b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.TestBase/EasyAbp.EShop.Products.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp.EShop.Stores.Application.Contracts.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp.EShop.Stores.Application.Contracts.csproj index 0f4b5329..dc7b7988 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp.EShop.Stores.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp.EShop.Stores.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs index c9fd4104..fb1a51e8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs @@ -1,4 +1,7 @@ -using Volo.Abp.Application; +using EasyAbp.EShop.Stores.Permissions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; using Volo.Abp.Authorization; @@ -12,6 +15,9 @@ namespace EasyAbp.EShop.Stores )] public class EShopStoresApplicationContractsModule : AbpModule { - + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddSingleton(); + } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs new file mode 100644 index 00000000..5215bcbb --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs @@ -0,0 +1,46 @@ +using System; +using EasyAbp.EShop.Stores.StoreOwners; +using Microsoft.AspNetCore.Authorization; +using System.Security.Principal; +using System.Threading.Tasks; +using Volo.Abp.Authorization.Permissions; + +namespace EasyAbp.EShop.Stores.Permissions +{ + public class BasicStorePermissionAuthorizationHandler : AuthorizationHandler + { + private readonly IStoreOwnerAppService _storeOwnerAppService; + private readonly IPermissionChecker _permissionChecker; + + public BasicStorePermissionAuthorizationHandler(IStoreOwnerAppService storeOwnerAppService, + IPermissionChecker permissionChecker) + { + _storeOwnerAppService = storeOwnerAppService; + _permissionChecker = permissionChecker; + } + + protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, StorePermissionAuthorizationRequirement requirement) + { + var userId = context.User?.FindUserId(); + if (userId.HasValue) + { + var isStoreOwner = await _storeOwnerAppService.IsStoreOwnerAsync(requirement.StoreId, userId.Value); + + if (isStoreOwner) + { + if (!requirement.PolicyName.IsNullOrWhiteSpace()) + { + if (await _permissionChecker.IsGrantedAsync(context.User, requirement.PolicyName)) + { + context.Succeed(requirement); + } + } + else + { + context.Succeed(requirement); + } + } + } + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs new file mode 100644 index 00000000..b0172516 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs @@ -0,0 +1,23 @@ +using Microsoft.AspNetCore.Authorization; +using System; +using System.Threading.Tasks; + +namespace EasyAbp.EShop.Stores.Permissions +{ + public static class StoreOwnerAuthorizationExtensions + { + public static Task IsStoreOwnerGrantedAsync(this IAuthorizationService authorizationService, + Guid storeId, string policyName, object resource = null) + { + return authorizationService.IsGrantedAsync(resource, + new StorePermissionAuthorizationRequirement(storeId, policyName)); + } + + public static Task CheckStoreOwnerAsync(this IAuthorizationService authorizationService, + Guid storeId, string policyName, object resource = null) + { + return authorizationService.CheckAsync(resource, + new StorePermissionAuthorizationRequirement(storeId, policyName)); + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs new file mode 100644 index 00000000..56a6459a --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs @@ -0,0 +1,18 @@ +using System; +using Microsoft.AspNetCore.Authorization; + +namespace EasyAbp.EShop.Stores.Permissions +{ + public class StorePermissionAuthorizationRequirement : IAuthorizationRequirement + { + internal StorePermissionAuthorizationRequirement(Guid storeId, string policyName = null) + { + StoreId = storeId; + PolicyName = policyName; + } + + public Guid StoreId { get; } + + public string PolicyName { get; } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs index 77bdb864..6ee9a966 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs @@ -12,6 +12,8 @@ namespace EasyAbp.EShop.Stores.Permissions var moduleGroup = context.AddGroup(StoresPermissions.GroupName, L("Permission:Stores")); var stores = moduleGroup.AddPermission(StoresPermissions.Stores.Default, L("Permission:Store")); + stores.AddChild(StoresPermissions.Stores.CrossStore, L("Permission:CrossStore")); + stores.AddChild(StoresPermissions.Stores.Manage, L("Permission:Manage")); stores.AddChild(StoresPermissions.Stores.Create, L("Permission:Create")); stores.AddChild(StoresPermissions.Stores.Update, L("Permission:Update")); stores.AddChild(StoresPermissions.Stores.Delete, L("Permission:Delete"), MultiTenancySides.Host); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs index be383fde..61d6173e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs @@ -14,6 +14,8 @@ namespace EasyAbp.EShop.Stores.Permissions public class Stores { public const string Default = GroupName + ".Store"; + public const string CrossStore = Default + ".CrossStore"; + public const string Manage = Default + ".Manage"; public const string Delete = Default + ".Delete"; public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs new file mode 100644 index 00000000..2d98b1d9 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.StoreOwners.Dtos +{ + public class GetStoreOwnerListDto : PagedAndSortedResultRequestDto + { + public Guid? StoreId { get; set; } + + public Guid? OwnerId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs new file mode 100644 index 00000000..31157a32 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs @@ -0,0 +1,12 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.StoreOwners.Dtos +{ + public class StoreOwnerDto : AuditedEntityDto + { + public Guid StoreId { get; set; } + + public Guid OwnerId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs new file mode 100644 index 00000000..c6223354 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs @@ -0,0 +1,16 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public interface IStoreOwnerAppService : + IReadOnlyAppService< + StoreOwnerDto, + Guid, + GetStoreOwnerListDto> + { + Task IsStoreOwnerAsync(Guid storeId, Guid userId); + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs index 4e9982bf..209fad58 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs @@ -1,13 +1,18 @@ using System; +using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.Stores.Dtos { - public class CreateUpdateStoreDto + public class CreateUpdateStoreDto : ExtensibleEntityDto { [Required] [DisplayName("StoreName")] public string Name { get; set; } + + [DisplayName("StoreOwner")] + public ICollection OwnerIds { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs index 6d034d47..f4e247ac 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs @@ -3,7 +3,7 @@ using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.Stores.Dtos { - public class StoreDto : FullAuditedEntityDto + public class StoreDto : ExtensibleAuditedEntityDto { public string Name { get; set; } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj index d68407ab..0daef21b 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs new file mode 100644 index 00000000..bb7009d7 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -0,0 +1,54 @@ +using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwnerAppService : ReadOnlyAppService, + IStoreOwnerAppService + { + protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Default; + + private readonly IStoreOwnerRepository _repository; + + public StoreOwnerAppService(IStoreOwnerRepository repository) : base(repository) + { + _repository = repository; + } + + protected override IQueryable CreateFilteredQuery(GetStoreOwnerListDto input) + { + var queryable = Repository.AsQueryable(); + + if (input.StoreId.HasValue) + { + queryable = queryable.Where(x => x.StoreId == input.StoreId); + } + + if (input.OwnerId.HasValue) + { + queryable = queryable.Where(x => x.OwnerId == input.OwnerId); + } + + return queryable; + } + + [RemoteService(false)] + public override Task GetAsync(Guid id) + { + throw new NotSupportedException(); + } + + [RemoteService(false)] + public async Task IsStoreOwnerAsync(Guid storeId, Guid userId) + { + var storeOwner = await _repository.FindAsync(x => x.OwnerId == userId && x.StoreId == storeId, false); + + return storeOwner != null; + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs index aebef321..55cb8fd1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs @@ -1,7 +1,6 @@ +using EasyAbp.EShop.Stores.Stores.Dtos; using System; -using System.Linq; using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Stores.Dtos; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -11,10 +10,13 @@ namespace EasyAbp.EShop.Stores.Stores IStoreAppService { private readonly IStoreRepository _repository; + private readonly IStoreManager _storeManager; - public StoreAppService(IStoreRepository repository) : base(repository) + public StoreAppService(IStoreRepository repository, + IStoreManager storeManager) : base(repository) { _repository = repository; + _storeManager = storeManager; } public async Task GetDefaultAsync() @@ -22,5 +24,31 @@ namespace EasyAbp.EShop.Stores.Stores // Todo: need to be improved return ObjectMapper.Map(await _repository.FindDefaultStoreAsync()); } + + public override async Task CreateAsync(CreateUpdateStoreDto input) + { + await CheckCreatePolicyAsync(); + + var entity = MapToEntity(input); + + TryToSetTenantId(entity); + + entity = await _storeManager.CreateAsync(entity, input.OwnerIds); + + return MapToGetOutputDto(entity); + } + + public override async Task UpdateAsync(Guid id, CreateUpdateStoreDto input) + { + await CheckUpdatePolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + + MapToEntity(input, entity); + + entity = await _storeManager.UpdateAsync(entity, input.OwnerIds); + + return MapToGetOutputDto(entity); + } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs index 7f600d61..ccb37257 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs @@ -1,6 +1,9 @@ +using AutoMapper; +using EasyAbp.EShop.Stores.StoreOwners; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; using EasyAbp.EShop.Stores.Stores; using EasyAbp.EShop.Stores.Stores.Dtos; -using AutoMapper; +using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Stores { @@ -11,8 +14,14 @@ namespace EasyAbp.EShop.Stores /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(MemberList.Source); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(MemberList.Source) + .MapExtraProperties(MappingPropertyDefinitionChecks.Both) + .ForSourceMember(x => x.OwnerIds, opt => opt.DoNotValidate()); + + CreateMap(); + } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp.EShop.Stores.Domain.Shared.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp.EShop.Stores.Domain.Shared.csproj index 2a270ba6..f8c45822 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp.EShop.Stores.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp.EShop.Stores.Domain.Shared.csproj @@ -9,7 +9,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj index 31f32699..485f6190 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj @@ -1,4 +1,4 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs new file mode 100644 index 00000000..57da4bb7 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public interface IStoreOwnerRepository : IRepository + { + Task> GetListByStoreIdAsync(Guid storeId, CancellationToken cancellationToken = default); + + Task> GetListByOwnerIdAsync(Guid ownerId, CancellationToken cancellationToken = default); + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs new file mode 100644 index 00000000..91c962ad --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwner : FullAuditedAggregateRoot, IMultiTenant + { + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid StoreId { get; protected set; } + + public virtual Guid OwnerId { get; protected set; } + + protected StoreOwner() + { + } + + public StoreOwner(Guid id, Guid storeId, Guid ownerId, Guid? tenantId = null) : base(id) + { + StoreId = storeId; + OwnerId = ownerId; + TenantId = tenantId; + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs new file mode 100644 index 00000000..40a4cecb --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs @@ -0,0 +1,14 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Volo.Abp.Domain.Services; + +namespace EasyAbp.EShop.Stores.Stores +{ + public interface IStoreManager : IDomainService + { + Task CreateAsync(Store store, IEnumerable ownerIds = null); + + Task UpdateAsync(Store store, IEnumerable ownerIds = null); + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs new file mode 100644 index 00000000..2f8e66e7 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs @@ -0,0 +1,58 @@ +using EasyAbp.EShop.Stores.StoreOwners; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Domain.Services; + +namespace EasyAbp.EShop.Stores.Stores +{ + public class StoreManager : DomainService, IStoreManager + { + private readonly IStoreRepository _storeRepository; + private readonly IStoreOwnerRepository _storeOwnerRepository; + + public StoreManager(IStoreRepository storeRepository, + IStoreOwnerRepository storeOwnerRepository) + { + _storeRepository = storeRepository; + _storeOwnerRepository = storeOwnerRepository; + } + + public async Task CreateAsync(Store store, IEnumerable ownerIds = null) + { + store = await _storeRepository.InsertAsync(store); + + await UpdateStoreOwnersAsync(store.Id, ownerIds); + + return store; + } + + public async Task UpdateAsync(Store store, IEnumerable ownerIds = null) + { + store = await _storeRepository.UpdateAsync(store); + + await UpdateStoreOwnersAsync(store.Id, ownerIds); + + return store; + } + + protected virtual async Task UpdateStoreOwnersAsync(Guid storeId, IEnumerable ownerIds) + { + ownerIds ??= new List(); + + var storeOwners = await _storeOwnerRepository.GetListByStoreIdAsync(storeId); + + foreach (var storeOwner in storeOwners.Where(x => !ownerIds.Contains(x.OwnerId)).ToList()) + { + await _storeOwnerRepository.DeleteAsync(storeOwner, true); + } + + foreach (var ownerId in ownerIds.Except(storeOwners.Select(x => x.OwnerId).ToList())) + { + await _storeOwnerRepository.InsertAsync( + new StoreOwner(GuidGenerator.Create(), storeId, ownerId, CurrentTenant.Id), true); + } + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp.EShop.Stores.EntityFrameworkCore.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp.EShop.Stores.EntityFrameworkCore.csproj index 9e8e74b5..ffeecbec 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp.EShop.Stores.EntityFrameworkCore.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp.EShop.Stores.EntityFrameworkCore.csproj @@ -8,12 +8,8 @@ - + - - - - diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs index d31bf8a5..de698069 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Stores.StoreOwners; using EasyAbp.EShop.Stores.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; @@ -19,6 +20,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * options.AddRepository(); */ options.AddRepository(); + options.AddRepository(); }); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs index 3f685352..438940c8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Stores.StoreOwners; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; @@ -12,5 +13,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * DbSet Questions { get; } */ DbSet Stores { get; set; } + + DbSet StoreOwners { get; set; } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs index a57ed827..cc90f2a6 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Stores.StoreOwners; using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; @@ -12,6 +13,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * public DbSet Questions { get; set; } */ public DbSet Stores { get; set; } + public DbSet StoreOwners { get; set; } public StoresDbContext(DbContextOptions options) : base(options) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs index 8b3b905b..f9b97b84 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs @@ -1,5 +1,6 @@ using EasyAbp.EShop.Stores.Stores; using System; +using EasyAbp.EShop.Stores.StoreOwners; using Microsoft.EntityFrameworkCore; using Volo.Abp; using Volo.Abp.EntityFrameworkCore.Modeling; @@ -47,6 +48,13 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore b.ConfigureByConvention(); /* Configure more properties here */ }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "StoreOwners", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + }); } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs new file mode 100644 index 00000000..760b63be --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs @@ -0,0 +1,29 @@ +using EasyAbp.EShop.Stores.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwnerRepository : EfCoreRepository, IStoreOwnerRepository + { + public StoreOwnerRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public async Task> GetListByStoreIdAsync(Guid storeId, CancellationToken cancellationToken = default) + { + return await GetQueryable().Where(pc => pc.StoreId == storeId).ToListAsync(cancellationToken); + } + + public async Task> GetListByOwnerIdAsync(Guid ownerId, CancellationToken cancellationToken = default) + { + return await GetQueryable().Where(pc => pc.OwnerId == ownerId).ToListAsync(cancellationToken); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi.Client/EasyAbp.EShop.Stores.HttpApi.Client.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi.Client/EasyAbp.EShop.Stores.HttpApi.Client.csproj index ca512af6..9ce5f270 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi.Client/EasyAbp.EShop.Stores.HttpApi.Client.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi.Client/EasyAbp.EShop.Stores.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp.EShop.Stores.HttpApi.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp.EShop.Stores.HttpApi.csproj index 8a0d43ad..01e75b50 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp.EShop.Stores.HttpApi.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp.EShop.Stores.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs new file mode 100644 index 00000000..81d232b2 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs @@ -0,0 +1,34 @@ +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Threading.Tasks; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + [RemoteService(Name = "EShopStores")] + [Route("/api/eShop/stores/storeOwner")] + public class StoreOwnerController : StoresController + { + private readonly IStoreOwnerAppService _service; + + public StoreOwnerController(IStoreOwnerAppService service) + { + _service = service; + } + + [NonAction] + [RemoteService(false)] + public Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public Task> GetListAsync(GetStoreOwnerListDto input) + { + return _service.GetListAsync(input); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.MongoDB/EasyAbp.EShop.Stores.MongoDB.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.MongoDB/EasyAbp.EShop.Stores.MongoDB.csproj index c85c2201..96eb5f6e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.MongoDB/EasyAbp.EShop.Stores.MongoDB.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.MongoDB/EasyAbp.EShop.Stores.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs index 134d0241..6b469bec 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EShopStoresWebModule.cs @@ -5,6 +5,7 @@ using EasyAbp.EShop.Stores.Web.Menus; using Volo.Abp.AspNetCore.Mvc.Localization; using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; using Volo.Abp.AutoMapper; +using Volo.Abp.Identity; using Volo.Abp.Modularity; using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; @@ -14,7 +15,8 @@ namespace EasyAbp.EShop.Stores.Web [DependsOn( typeof(EShopStoresHttpApiModule), typeof(AbpAspNetCoreMvcUiThemeSharedModule), - typeof(AbpAutoMapperModule) + typeof(AbpAutoMapperModule), + typeof(AbpIdentityApplicationContractsModule) )] public class EShopStoresWebModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj index 5de28a2e..5657a4f8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj @@ -1,4 +1,4 @@ - + @@ -12,8 +12,9 @@ - - + + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs index 5b8f3281..315e88dc 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs @@ -1,8 +1,13 @@ +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Stores.Stores; using EasyAbp.EShop.Stores.Stores.Dtos; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Identity; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store { @@ -11,16 +16,31 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store [BindProperty] public CreateEditStoreViewModel Store { get; set; } + public ICollection StoreOwners { get; set; } + private readonly IStoreAppService _service; + private readonly IIdentityUserAppService _userAppService; - public CreateModalModel(IStoreAppService service) + public CreateModalModel(IStoreAppService service, + IIdentityUserAppService userAppService) { _service = service; + _userAppService = userAppService; + } + + public virtual async Task OnGetAsync() + { + StoreOwners = + (await _userAppService.GetListAsync(new GetIdentityUsersInput + { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items + .Select(dto => new SelectListItem(dto.UserName, dto.Id.ToString())).ToList(); } public async Task OnPostAsync() { - await _service.CreateAsync(ObjectMapper.Map(Store)); + var createDto = ObjectMapper.Map(Store); + var product = await _service.CreateAsync(createDto); + return NoContent(); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs index 7b4f8553..77e07738 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs @@ -1,9 +1,16 @@ -using System; -using System.Threading.Tasks; using EasyAbp.EShop.Stores.Stores; using EasyAbp.EShop.Stores.Stores.Dtos; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.StoreOwners; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Identity; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store { @@ -16,17 +23,36 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store [BindProperty] public CreateEditStoreViewModel Store { get; set; } + public ICollection StoreOwners { get; set; } + private readonly IStoreAppService _service; + private readonly IIdentityUserAppService _userAppService; + private readonly IStoreOwnerAppService _storeOwnerAppService; - public EditModalModel(IStoreAppService service) + public EditModalModel(IStoreAppService service, + IIdentityUserAppService userAppService, + IStoreOwnerAppService storeOwnerAppService) { _service = service; + _userAppService = userAppService; + _storeOwnerAppService = storeOwnerAppService; } public async Task OnGetAsync() { + StoreOwners = + (await _userAppService.GetListAsync(new GetIdentityUsersInput + { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items + .Select(x => new SelectListItem(x.UserName, x.Id.ToString())).ToList(); + var dto = await _service.GetAsync(Id); Store = ObjectMapper.Map(dto); + + Store.OwnerIds = (await _storeOwnerAppService.GetListAsync(new GetStoreOwnerListDto + { + StoreId = Id, + MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount + })).Items.Select(x => x.OwnerId).ToList(); } public async Task OnPostAsync() diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs index a6a65d72..cddc2499 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs @@ -1,11 +1,20 @@ -using System.ComponentModel.DataAnnotations; +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; +using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels { - public class CreateEditStoreViewModel + public class CreateEditStoreViewModel : ExtensibleObject { [Required] [Display(Name = "StoreName")] public string Name { get; set; } + + + [SelectItems("StoreOwners")] + [Display(Name = "StoreOwner")] + public List OwnerIds { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs index 85c543a5..beb7bfc1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs @@ -1,6 +1,8 @@ using EasyAbp.EShop.Stores.Stores.Dtos; using AutoMapper; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; +using Volo.Abp.AutoMapper; +using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Stores.Web { @@ -11,8 +13,11 @@ namespace EasyAbp.EShop.Stores.Web /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both) + .Ignore(x=>x.OwnerIds); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); } } } diff --git a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp.csproj b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp.csproj index 15ff3344..b94d4774 100644 --- a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp.csproj +++ b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Stores.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.TestBase/EasyAbp.EShop.Stores.TestBase.csproj b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.TestBase/EasyAbp.EShop.Stores.TestBase.csproj index 695d4f0a..a0ed473b 100644 --- a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.TestBase/EasyAbp.EShop.Stores.TestBase.csproj +++ b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.TestBase/EasyAbp.EShop.Stores.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application.Contracts/EasyAbp.EShop.Plugins.Baskets.Application.Contracts.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application.Contracts/EasyAbp.EShop.Plugins.Baskets.Application.Contracts.csproj index 97ac50f2..4453a973 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application.Contracts/EasyAbp.EShop.Plugins.Baskets.Application.Contracts.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application.Contracts/EasyAbp.EShop.Plugins.Baskets.Application.Contracts.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp.EShop.Plugins.Baskets.Application.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp.EShop.Plugins.Baskets.Application.csproj index b303d448..cef2ba3f 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp.EShop.Plugins.Baskets.Application.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Application/EasyAbp.EShop.Plugins.Baskets.Application.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj index 979c1520..51f8c0f3 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj @@ -9,11 +9,11 @@ - + - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain/EasyAbp.EShop.Plugins.Baskets.Domain.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain/EasyAbp.EShop.Plugins.Baskets.Domain.csproj index 5383439b..b52366b2 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain/EasyAbp.EShop.Plugins.Baskets.Domain.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain/EasyAbp.EShop.Plugins.Baskets.Domain.csproj @@ -8,7 +8,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.csproj index 1a83545c..a0b997f0 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.csproj @@ -8,7 +8,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.csproj index 94f052bd..4ec65305 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.csproj @@ -8,7 +8,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi/EasyAbp.EShop.Plugins.Baskets.HttpApi.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi/EasyAbp.EShop.Plugins.Baskets.HttpApi.csproj index 2d8695f1..46b1e21d 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi/EasyAbp.EShop.Plugins.Baskets.HttpApi.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.HttpApi/EasyAbp.EShop.Plugins.Baskets.HttpApi.csproj @@ -8,7 +8,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.MongoDB/EasyAbp.EShop.Plugins.Baskets.MongoDB.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.MongoDB/EasyAbp.EShop.Plugins.Baskets.MongoDB.csproj index 80e11b34..6faa8d5a 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.MongoDB/EasyAbp.EShop.Plugins.Baskets.MongoDB.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.MongoDB/EasyAbp.EShop.Plugins.Baskets.MongoDB.csproj @@ -8,7 +8,7 @@ - + diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/EasyAbp.EShop.Plugins.Baskets.Web.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/EasyAbp.EShop.Plugins.Baskets.Web.csproj index 65f6a088..396abdfa 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/EasyAbp.EShop.Plugins.Baskets.Web.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Web/EasyAbp.EShop.Plugins.Baskets.Web.csproj @@ -12,8 +12,8 @@ - - + + diff --git a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests.csproj b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests.csproj index f2419fac..b2ea256f 100644 --- a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests.csproj +++ b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Baskets.EntityFrameworkCore.Tests.csproj @@ -12,7 +12,7 @@ - + diff --git a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp.csproj b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp.csproj index 55abdbb8..2ec4a686 100644 --- a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp.csproj +++ b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Baskets.HttpApi.Client.ConsoleTestApp.csproj @@ -7,7 +7,7 @@ - + diff --git a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.TestBase/EasyAbp.EShop.Plugins.Baskets.TestBase.csproj b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.TestBase/EasyAbp.EShop.Plugins.Baskets.TestBase.csproj index 77e21e36..80617097 100644 --- a/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.TestBase/EasyAbp.EShop.Plugins.Baskets.TestBase.csproj +++ b/plugins/Baskets/test/EasyAbp.EShop.Plugins.Baskets.TestBase/EasyAbp.EShop.Plugins.Baskets.TestBase.csproj @@ -14,9 +14,9 @@ - - - + + + diff --git a/plugins/ProductTag/.gitattributes b/plugins/ProductTag/.gitattributes new file mode 100644 index 00000000..c941e526 --- /dev/null +++ b/plugins/ProductTag/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/plugins/ProductTag/.gitignore b/plugins/ProductTag/.gitignore new file mode 100644 index 00000000..666ef8a0 --- /dev/null +++ b/plugins/ProductTag/.gitignore @@ -0,0 +1,258 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# ProductTag +host/EasyAbp.EShop.Plugins.ProductTag.IdentityServer/Logs/logs.txt +host/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.ProductTag.Web.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.ProductTag.Web.Unified/Logs/logs.txt diff --git a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln new file mode 100644 index 00000000..b43e8329 --- /dev/null +++ b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln @@ -0,0 +1,139 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain.Shared", "src\EasyAbp.EShop.Plugins.ProductTag.Domain.Shared\EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain", "src\EasyAbp.EShop.Plugins.ProductTag.Domain\EasyAbp.EShop.Plugins.ProductTag.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application.Contracts", "src\EasyAbp.EShop.Plugins.ProductTag.Application.Contracts\EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application", "src\EasyAbp.EShop.Plugins.ProductTag.Application\EasyAbp.EShop.Plugins.ProductTag.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.MongoDB", "src\EasyAbp.EShop.Plugins.ProductTag.MongoDB\EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi", "src\EasyAbp.EShop.Plugins.ProductTag.HttpApi\EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client", "src\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.TestBase", "test\EasyAbp.EShop.Plugins.ProductTag.TestBase\EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests\EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.Domain.Tests\EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.Application.Tests\EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Web", "src\EasyAbp.EShop.Plugins.ProductTag.Web\EasyAbp.EShop.Plugins.ProductTag.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Host.Shared", "host\EasyAbp.EShop.Plugins.ProductTag.Host.Shared\EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings new file mode 100644 index 00000000..cb0b2c91 --- /dev/null +++ b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings @@ -0,0 +1,23 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + \ No newline at end of file diff --git a/plugins/ProductTag/common.props b/plugins/ProductTag/common.props new file mode 100644 index 00000000..d9519ad8 --- /dev/null +++ b/plugins/ProductTag/common.props @@ -0,0 +1,30 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591 + module + true + EasyAbp Team + An abp application module group that provides basic e-shop service. + https://avatars3.githubusercontent.com/u/58311641?s=128 + https://github.com/EasyAbp/EShop + https://github.com/EasyAbp/EShop + abp module easyabp EShop shopping shop ordering product payment store mall + EasyAbp + MIT + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + \ No newline at end of file diff --git a/plugins/ProductTag/docker-compose.migrations.yml b/plugins/ProductTag/docker-compose.migrations.yml new file mode 100644 index 00000000..5e7c2ed1 --- /dev/null +++ b/plugins/ProductTag/docker-compose.migrations.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + migrations: + build: + context: ../../ + dockerfile: templates/service/database/Dockerfile + depends_on: + - sqlserver + environment: + - IdentityServer_DB=ProductTag_Identity + - ProductTag_DB=ProductTag_ModuleDb + - SA_PASSWORD=yourStrong(!)Password diff --git a/plugins/ProductTag/docker-compose.override.yml b/plugins/ProductTag/docker-compose.override.yml new file mode 100644 index 00000000..d5d2a0e4 --- /dev/null +++ b/plugins/ProductTag/docker-compose.override.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + sqlserver: + environment: + - SA_PASSWORD=yourStrong(!)Password + - ACCEPT_EULA=Y + ports: + - "51599:1433" + + identity-server: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=ProductTag_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + ports: + - "51600:80" + + product-tag: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=ProductTag_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=ProductTag_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - AuthServer__Authority=http://identity-server + ports: + - "51601:80" \ No newline at end of file diff --git a/plugins/ProductTag/docker-compose.yml b/plugins/ProductTag/docker-compose.yml new file mode 100644 index 00000000..54ef5f29 --- /dev/null +++ b/plugins/ProductTag/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.4' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server + volumes: + - dbdata:/var/opt/mssql + + identity-server: + build: + context: ../../ + dockerfile: templates/service/host/IdentityServerHost/Dockerfile + depends_on: + - sqlserver + + product-tag: + build: + context: ../../ + dockerfile: templates/service/host/EasyAbp.EShop.Plugins.ProductTag.Host/Dockerfile + depends_on: + - sqlserver + - identity-server + +volumes: + dbdata: \ No newline at end of file diff --git a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj new file mode 100644 index 00000000..d469bb9b --- /dev/null +++ b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj @@ -0,0 +1,10 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + diff --git a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 00000000..4e271474 --- /dev/null +++ b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.MultiTenancy +{ + public static class MultiTenancyConsts + { + /* Enable/disable multi-tenancy in a single point + * to test your module with multi-tenancy. + */ + public const bool IsEnabled = false; + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj new file mode 100644 index 00000000..b953a1d8 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj @@ -0,0 +1,20 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs new file mode 100644 index 00000000..2bcbcb33 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs @@ -0,0 +1,24 @@ +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.ProductTag.Permissions +{ + public class ProductTagPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var moduleGroup = context.AddGroup(ProductTagPermissions.GroupName, L("Permission:ProductTag")); + + var tags = moduleGroup.AddPermission(ProductTagPermissions.Tags.Default, L("Permission:Tag")); + tags.AddChild(ProductTagPermissions.Tags.Create, L("Permission:Create")); + tags.AddChild(ProductTagPermissions.Tags.Update, L("Permission:Update")); + tags.AddChild(ProductTagPermissions.Tags.Delete, L("Permission:Delete")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs new file mode 100644 index 00000000..ed8496ec --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs @@ -0,0 +1,22 @@ +using Volo.Abp.Reflection; + +namespace EasyAbp.EShop.Plugins.ProductTag.Permissions +{ + public class ProductTagPermissions + { + public const string GroupName = "EasyAbp.EShop.ProductTag"; + + public class Tags + { + public const string Default = GroupName + ".Tag"; + public const string Delete = Default + ".Delete"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + } + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(ProductTagPermissions)); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs new file mode 100644 index 00000000..95a8ca02 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs @@ -0,0 +1,18 @@ +using EasyAbp.EShop.Stores; +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule), + typeof(EShopStoresDomainSharedModule) + )] + public class ProductTagApplicationContractsModule : AbpModule + { + + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs new file mode 100644 index 00000000..323f2e33 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos +{ + public class CreateUpdateProductTagsDto : ExtensibleObject + { + public Guid StoreId { get; set; } + + public Guid ProductId { get; set; } + + public List TagIds { get; set; } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs new file mode 100644 index 00000000..00c63de1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs @@ -0,0 +1,15 @@ +using System; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos +{ + public class GetProductTagListDto : PagedAndSortedResultRequestDto, IMultiStore + { + public Guid StoreId { get; set; } + + public Guid? TagId { get; set; } + + public Guid? ProductId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs new file mode 100644 index 00000000..8083a1d2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos +{ + public class ProductTagDto : ExtensibleAuditedEntityDto + { + public Guid TagId { get; set; } + + public Guid ProductId { get; set; } + + public int DisplayOrder { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs new file mode 100644 index 00000000..194760d0 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos +{ + public class UpdateProductTagDto : ExtensibleEntityDto + { + public Guid TagId { get; set; } + + public Guid ProductId { get; set; } + + public int DisplayOrder { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs new file mode 100644 index 00000000..360a5bbc --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs @@ -0,0 +1,17 @@ +using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + public interface IProductTagAppService : + IReadOnlyAppService< + ProductTagDto, + Guid, + GetProductTagListDto>, + IUpdateAppService + { + Task UpdateAsync(CreateUpdateProductTagsDto input); + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs new file mode 100644 index 00000000..cb5ea626 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs @@ -0,0 +1,30 @@ +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos +{ + public class UpdateTagDto : ExtensibleEntityDto + { + [DisplayName("TagParentId")] + public Guid? ParentId { get; set; } + + [Required] + [DisplayName("TagDisplayName")] + public string DisplayName { get; set; } + + [DisplayName("TagDescription")] + public string Description { get; set; } + + [DisplayName("TagMediaResources")] + public string MediaResources { get; set; } + } + + public class CreateTagDto : UpdateTagDto + { + [Required] + [DisplayName("TagStoreId")] + public Guid StoreId { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs new file mode 100644 index 00000000..6b397a7f --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Stores; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos +{ + public class GetTagListDto : PagedAndSortedResultRequestDto, IMultiStore + { + [Required] + public Guid StoreId { get; set; } + + public bool ShowHidden { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs new file mode 100644 index 00000000..934179e1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs @@ -0,0 +1,26 @@ +using EasyAbp.EShop.Stores.Stores; +using System; +using System.Collections.Generic; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos +{ + public class TagDto : ExtensibleFullAuditedEntityDto, IMultiStore + { + public Guid StoreId { get; set; } + + public Guid? ParentId { get; set; } + + public string Code { get; set; } + + public int Level { get; set; } + + public string DisplayName { get; set; } + + public string Description { get; set; } + + public string MediaResources { get; set; } + + public ICollection Children { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs new file mode 100644 index 00000000..33cebd33 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs @@ -0,0 +1,15 @@ +using System; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + public interface ITagAppService : ICrudAppService< + TagDto, + Guid, + GetTagListDto, + CreateTagDto, + UpdateTagDto> + { + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj new file mode 100644 index 00000000..11bdb9a1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj @@ -0,0 +1,20 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs new file mode 100644 index 00000000..53b30d75 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs @@ -0,0 +1,14 @@ +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public abstract class ProductTagAppService : ApplicationService + { + protected ProductTagAppService() + { + LocalizationResource = typeof(ProductTagResource); + ObjectMapperContext = typeof(ProductTagApplicationModule); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..e13e925e --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs @@ -0,0 +1,25 @@ +using AutoMapper; +using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public class ProductTagApplicationAutoMapperProfile : Profile + { + public ProductTagApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + CreateMap(); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + + CreateMap(); + CreateMap(MemberList.Source); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs new file mode 100644 index 00000000..be07ebcd --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs @@ -0,0 +1,27 @@ +using EasyAbp.EShop.Products; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagDomainModule), + typeof(ProductTagApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule), + typeof(EShopProductsDomainModule) + )] + public class ProductTagApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs new file mode 100644 index 00000000..f279118c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs @@ -0,0 +1,130 @@ +using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using EasyAbp.EShop.Products.Permissions; +using EasyAbp.EShop.Products.ProductStores; +using EasyAbp.EShop.Stores.Permissions; +using System; +using System.Collections.Generic; +using System.Collections.Immutable; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Products.Products; +using Microsoft.AspNetCore.Authorization; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + public class ProductTagAppService : ReadOnlyAppService, + IProductTagAppService + { + private readonly IProductTagRepository _repository; + private readonly ITagRepository _tagRepository; + private readonly IProductStoreRepository _productStoreRepository; + + public ProductTagAppService(IProductTagRepository repository, + ITagRepository tagRepository, + IProductStoreRepository productStoreRepository) : base(repository) + { + _repository = repository; + _tagRepository = tagRepository; + _productStoreRepository = productStoreRepository; + } + + protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; + protected string UpdatePolicyName { get; set; } = ProductsPermissions.Products.Update; + + [RemoteService(false)] + public override Task GetAsync(Guid id) + { + throw new NotSupportedException(); + } + + public override async Task> GetListAsync(GetProductTagListDto input) + { + await CheckGetListPolicyAsync(); + + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, GetListPolicyName); + + var query = CreateFilteredQuery(input); + + var totalCount = await AsyncExecuter.CountAsync(query); + + query = ApplySorting(query, input); + query = ApplyPaging(query, input); + + var entities = await AsyncExecuter.ToListAsync(query); + + return new PagedResultDto( + totalCount, + entities.Select(MapToGetListOutputDto).ToList()); + } + + protected override IQueryable CreateFilteredQuery(GetProductTagListDto input) + { + var queryable = Repository.AsQueryable(); + + queryable = queryable.Where(x => x.StoreId == input.StoreId); + + if (input.TagId.HasValue) + { + queryable = queryable.Where(x => x.TagId == input.TagId); + } + + if (input.ProductId.HasValue) + { + queryable = queryable.Where(x => x.ProductId == input.ProductId); + } + + return queryable; + } + + public async Task UpdateAsync(Guid id, UpdateProductTagDto input) + { + var entity = await GetEntityByIdAsync(id); + + await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, UpdatePolicyName); + + MapToEntity(input, entity); + await _repository.UpdateAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public async Task UpdateAsync(CreateUpdateProductTagsDto input) + { + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, UpdatePolicyName); + + var productStore = await _productStoreRepository.GetAsync(input.ProductId, input.StoreId, false); + + if (!productStore.IsOwner) + { + throw new StoreIsNotProductOwnerException(input.ProductId, input.StoreId); + } + + input.TagIds ??= new List(); + + var storeTags = (await _tagRepository.GetListByAsync(input.StoreId)).Select(x => x.Id); + + var productTags = await _repository.GetListByProductIdAsync(input.ProductId, input.StoreId); + + foreach (var productTag in productTags.Where(x => !input.TagIds.Contains(x.TagId))) + { + await _repository.DeleteAsync(productTag, true); + } + + foreach (var tagId in input.TagIds.Except(productTags.Select(x => x.TagId).Concat(storeTags))) + { + await _repository.InsertAsync( + new ProductTag(GuidGenerator.Create(), CurrentTenant.Id, tagId, input.ProductId), true); + } + } + + protected virtual ProductTag MapToEntity(UpdateProductTagDto input, ProductTag entity) + { + return ObjectMapper.Map(input, entity); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs new file mode 100644 index 00000000..0ea57bb8 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs @@ -0,0 +1,110 @@ +using EasyAbp.EShop.Plugins.ProductTag.Permissions; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; +using EasyAbp.EShop.Stores.Permissions; +using JetBrains.Annotations; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Linq; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + public class TagAppService : CrudAppService, + ITagAppService + { + private readonly IAsyncQueryableExecuter _asyncQueryableExecuter; + protected override string CreatePolicyName { get; set; } = ProductTagPermissions.Tags.Create; + protected override string DeletePolicyName { get; set; } = ProductTagPermissions.Tags.Delete; + protected override string UpdatePolicyName { get; set; } = ProductTagPermissions.Tags.Update; + protected override string GetPolicyName { get; set; } = ProductTagPermissions.Tags.Default; + protected override string GetListPolicyName { get; set; } = ProductTagPermissions.Tags.Default; + + public TagAppService(ITagRepository repository, + [NotNull] IAsyncQueryableExecuter asyncQueryableExecuter) : base(repository) + { + _asyncQueryableExecuter = asyncQueryableExecuter ?? throw new ArgumentNullException(nameof(asyncQueryableExecuter)); + } + + protected override IQueryable CreateFilteredQuery(GetTagListDto input) + { + var query = base.CreateFilteredQuery(input); + + query = query.Where(x => x.StoreId == input.StoreId); + + return input.ShowHidden ? query : query.Where(x => !x.IsHidden); + } + + public override async Task GetAsync(Guid id) + { + await CheckGetPolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + + await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, GetPolicyName, entity); + + return MapToGetOutputDto(entity); + } + + public override async Task> GetListAsync(GetTagListDto input) + { + await CheckGetListPolicyAsync(); + + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, GetListPolicyName); + + var query = CreateFilteredQuery(input); + + var totalCount = await _asyncQueryableExecuter.CountAsync(query); + + query = ApplySorting(query, input); + query = ApplyPaging(query, input); + + var entities = await _asyncQueryableExecuter.ToListAsync(query); + + return new PagedResultDto( + totalCount, + entities.Select(MapToGetListOutputDto).ToList()); + } + + public override async Task CreateAsync(CreateTagDto input) + { + await CheckCreatePolicyAsync(); + + var entity = MapToEntity(input); + + await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, CreatePolicyName, entity); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public override async Task UpdateAsync(Guid id, UpdateTagDto input) + { + await CheckUpdatePolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + + await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, UpdatePolicyName, entity); + + MapToEntity(input, entity); + await Repository.UpdateAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public override async Task DeleteAsync(Guid id) + { + await CheckDeletePolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + + await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, DeletePolicyName, entity); + + await DeleteByIdAsync(id); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj new file mode 100644 index 00000000..8e9296cb --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj @@ -0,0 +1,24 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + true + + + + + + + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json new file mode 100644 index 00000000..081cdb8a --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json @@ -0,0 +1,21 @@ +{ + "culture": "cs", + "texts": { + "ManageYourProfile": "Spravovat profil", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json new file mode 100644 index 00000000..41833bb9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json @@ -0,0 +1,22 @@ +{ + "culture": "en", + "texts": { + "ManageYourProfile": "Manage your profile", + "SamplePageMessage": "A sample page for the ProductTag module", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json new file mode 100644 index 00000000..aa76992a --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json @@ -0,0 +1,20 @@ +{ + "culture": "pl-PL", + "texts": { + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json new file mode 100644 index 00000000..7c6362cb --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json @@ -0,0 +1,20 @@ +{ + "culture": "pt-BR", + "texts": { + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json new file mode 100644 index 00000000..298da6dd --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json @@ -0,0 +1,21 @@ +{ + "culture": "sl", + "texts": { + "ManageYourProfile": "Upravljajte svojim profilom", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json new file mode 100644 index 00000000..34f9901c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json @@ -0,0 +1,22 @@ +{ + "culture": "tr", + "texts": { + "ManageYourProfile": "Profil yönetimi", + "SamplePageMessage": "ProductTag modulünden örnek bir sayfa", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json new file mode 100644 index 00000000..1319bc8d --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json @@ -0,0 +1,20 @@ +{ + "culture": "vi", + "texts": { + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json new file mode 100644 index 00000000..05a31078 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json @@ -0,0 +1,21 @@ +{ + "culture": "zh-Hans", + "texts": { + "ManageYourProfile": "管理个人资料", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json new file mode 100644 index 00000000..fd2b044a --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json @@ -0,0 +1,21 @@ +{ + "culture": "zh-Hant", + "texts": { + "ManageYourProfile": "管理個人資料", + "Menu:Tag": "MenuTag", + "Tag": "Tag", + "TagTenantId": "TagTenantId", + "TagStoreId": "TagStoreId", + "TagDisplayName": "TagDisplayName", + "TagDescription": "TagDescription", + "TagMediaResources": "TagMediaResources", + "CreateTag": "CreateTag", + "EditTag": "EditTag", + "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", + "Permission:ProductTag": "ProductTag", + "Permission:Tag": "Tag", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete" + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs new file mode 100644 index 00000000..8024441c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.ProductTag.Localization +{ + [LocalizationResourceName("ProductTag")] + public class ProductTagResource + { + + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs new file mode 100644 index 00000000..d4b2ba4d --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs @@ -0,0 +1,37 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(AbpValidationModule) + )] + public class ProductTagDomainSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/ProductTag"); + }); + + Configure(options => + { + options.MapCodeNamespace("ProductTag", typeof(ProductTagResource)); + }); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs new file mode 100644 index 00000000..ff528d99 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs @@ -0,0 +1,7 @@ +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public static class ProductTagErrorCodes + { + //Add your business exception error codes here... + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj new file mode 100644 index 00000000..c3a84dc7 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs new file mode 100644 index 00000000..70233f15 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public static class ProductTagDbProperties + { + public static string DbTablePrefix { get; set; } = "ProductTag"; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "ProductTag"; + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs new file mode 100644 index 00000000..ad1a21de --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs @@ -0,0 +1,16 @@ +using EasyAbp.Abp.Trees; +using EasyAbp.EShop.Stores; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagDomainSharedModule), + typeof(AbpTreesDomainModule), + typeof(EShopStoresDomainSharedModule) + )] + public class ProductTagDomainModule : AbpModule + { + + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs new file mode 100644 index 00000000..e6d0168c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + public interface IProductTagRepository : IRepository + { + Task> GetListByTagIdAsync(Guid tagId, Guid? storeId = null, CancellationToken cancellationToken = default); + + Task> GetListByProductIdAsync(Guid productId, Guid? storeId = null, CancellationToken cancellationToken = default); + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs new file mode 100644 index 00000000..570d3449 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs @@ -0,0 +1,37 @@ +using System; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + public class ProductTag : AuditedAggregateRoot, IMultiTenant + { + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid StoreId { get; set; } + + public virtual Guid TagId { get; protected set; } + + public virtual Guid ProductId { get; protected set; } + + public virtual int DisplayOrder { get; protected set; } + + protected ProductTag() + { + } + + public ProductTag( + Guid id, + Guid? tenantId, + Guid tagId, + Guid productId, + int displayOrder = 0 + ) : base(id) + { + TenantId = tenantId; + TagId = tagId; + ProductId = productId; + DisplayOrder = displayOrder; + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs new file mode 100644 index 00000000..919c64ea --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace EasyAbp.EShop.Plugins.ProductTag.Settings +{ + public class ProductTagSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from ProductTagSettings class. + */ + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs new file mode 100644 index 00000000..40555821 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.Settings +{ + public static class ProductTagSettings + { + public const string GroupName = "ProductTag"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs new file mode 100644 index 00000000..dfb32dfe --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + public interface ITagRepository : IRepository + { + Task> GetListByAsync(Guid storeId, bool includeDetails = false, CancellationToken cancellationToken = default); + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs new file mode 100644 index 00000000..91ac332b --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using EasyAbp.Abp.Trees; +using EasyAbp.EShop.Stores.Stores; +using JetBrains.Annotations; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + public class Tag : FullAuditedAggregateRoot, ITree, IMultiTenant, IMultiStore + { + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid StoreId { get; protected set; } + + [CanBeNull] + public virtual string Description { get; protected set; } + + [CanBeNull] + public virtual string MediaResources { get; protected set; } + + public virtual bool IsHidden { get; protected set; } + + #region Properties of ITree + + [NotNull] + public virtual string DisplayName { get; set; } + + [NotNull] + public virtual string Code { get; set; } + + public virtual int Level { get; set; } + + public virtual Guid? ParentId { get; set; } + + public virtual Tag Parent { get; set; } + + public virtual ICollection Children { get; set; } + + #endregion + + protected Tag() + { + } + + public Tag( + Guid id, + Guid? tenantId, + Guid storeId, + Guid? parentId, + string displayName, + string description, + string mediaResources, + bool isHidden + ) : base(id) + { + TenantId = tenantId; + StoreId = storeId; + ParentId = parentId; + DisplayName = displayName; + Description = description; + MediaResources = mediaResources; + IsHidden = isHidden; + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj new file mode 100644 index 00000000..db7d2960 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs new file mode 100644 index 00000000..8d481613 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs @@ -0,0 +1,17 @@ +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] + public interface IProductTagDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + DbSet Tags { get; set; } + DbSet ProductTags { get; set; } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs new file mode 100644 index 00000000..19d93b2f --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs @@ -0,0 +1,31 @@ +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] + public class ProductTagDbContext : AbpDbContext, IProductTagDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public DbSet Tags { get; set; } + public DbSet ProductTags { get; set; } + + public ProductTagDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureProductTag(); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..01a377d1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs @@ -0,0 +1,66 @@ +using System; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + public static class ProductTagDbContextModelCreatingExtensions + { + public static void ConfigureProductTag( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new ProductTagModelBuilderConfigurationOptions( + ProductTagDbProperties.DbTablePrefix, + ProductTagDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "Questions", options.Schema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + + + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Tags", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + + b.HasIndex(x => x.StoreId); + }); + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "ProductTags", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + + b.HasIndex(x => x.TagId); + b.HasIndex(x => x.ProductId); + }); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..6022e551 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs @@ -0,0 +1,29 @@ +using EasyAbp.Abp.Trees.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.ProductTag.ProductTags; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + [DependsOn( + typeof(ProductTagDomainModule), + typeof(AbpEntityFrameworkCoreModule), + typeof(AbpTreesEntityFrameworkCoreModule) + )] + public class ProductTagEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + options.AddRepository(); + options.AddRepository(); + }); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..f234aee5 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + public class ProductTagModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public ProductTagModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs new file mode 100644 index 00000000..052993ec --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs @@ -0,0 +1,43 @@ +using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + public class ProductTagRepository : EfCoreRepository, IProductTagRepository + { + public ProductTagRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public virtual async Task> GetListByTagIdAsync(Guid categoryId, Guid? storeId = null, + CancellationToken cancellationToken = default) + { + var queryable = GetQueryable(); + if (storeId.HasValue) + { + queryable = queryable.Where(x => x.StoreId == storeId.Value); + } + + return await queryable.Where(pc => pc.TagId == categoryId).ToListAsync(cancellationToken); + } + + public virtual async Task> GetListByProductIdAsync(Guid productId, Guid? storeId = null, + CancellationToken cancellationToken = default) + { + var queryable = GetQueryable(); + if (storeId.HasValue) + { + queryable = queryable.Where(x => x.StoreId == storeId.Value); + } + + return await queryable.Where(pc => pc.ProductId == productId).ToListAsync(cancellationToken); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs new file mode 100644 index 00000000..2e528cab --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs @@ -0,0 +1,32 @@ +using EasyAbp.Abp.Trees; +using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + public class TagRepository : EfCoreTreeRepository, ITagRepository + { + public TagRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public async Task> GetListByAsync(Guid storeId, bool includeDetails = false, CancellationToken cancellationToken = default) + { + return includeDetails + ? await WithDetails().Where(x => x.StoreId == storeId).ToListAsync(GetCancellationToken(cancellationToken)) + : await GetQueryable().Where(x => x.StoreId == storeId).ToListAsync(GetCancellationToken(cancellationToken)); + } + + [Obsolete("Should use GetListByAsync(Guid storeId, bool includeDetails, CancellationToken cancellationToken)")] + public override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = new CancellationToken()) + { + return base.GetListAsync(includeDetails, cancellationToken); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj new file mode 100644 index 00000000..6d083269 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs new file mode 100644 index 00000000..264a411f --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagApplicationContractsModule), + typeof(AbpHttpClientModule))] + public class ProductTagHttpApiClientModule : AbpModule + { + public const string RemoteServiceName = "ProductTag"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(ProductTagApplicationContractsModule).Assembly, + RemoteServiceName + ); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj new file mode 100644 index 00000000..decfa3db --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs new file mode 100644 index 00000000..3d123e0c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public abstract class ProductTagBaseController : AbpController + { + protected ProductTagBaseController() + { + LocalizationResource = typeof(ProductTagResource); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs new file mode 100644 index 00000000..90825e4d --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs @@ -0,0 +1,33 @@ +using Localization.Resources.AbpUi; +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class ProductTagHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(ProductTagHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs new file mode 100644 index 00000000..ab622bc1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs @@ -0,0 +1,48 @@ +using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags +{ + [RemoteService(Name = "ProductTagService")] + [Route("/api/eShop/products/productTag")] + public class ProductTagController : ProductTagBaseController, IProductTagAppService + { + private readonly IProductTagAppService _service; + + public ProductTagController(IProductTagAppService service) + { + _service = service; + } + + [HttpPut] + public virtual Task UpdateAsync(CreateUpdateProductTagsDto input) + { + return _service.UpdateAsync(input); + } + + [RemoteService(false)] + [NonAction] + public Task GetAsync(Guid id) + { + throw new NotSupportedException(); + } + + [HttpGet] + public Task> GetListAsync(GetProductTagListDto input) + { + return _service.GetListAsync(input); + } + + + [HttpPut] + [Route("{id}")] + public Task UpdateAsync(Guid id, UpdateProductTagDto input) + { + return _service.UpdateAsync(id, input); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs new file mode 100644 index 00000000..c9acb3d2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.Tags +{ + [RemoteService(Name = "TagService")] + [Route("/api/eShop/products/tag")] + public class TagController : ProductTagBaseController, ITagAppService + { + private readonly ITagAppService _service; + + public TagController(ITagAppService service) + { + _service = service; + } + + [HttpGet] + [Route("{id}")] + public Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public Task> GetListAsync(GetTagListDto input) + { + return _service.GetListAsync(input); + } + + [HttpPost] + public Task CreateAsync(CreateTagDto input) + { + return _service.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public Task UpdateAsync(Guid id, UpdateTagDto input) + { + return _service.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public Task DeleteAsync(Guid id) + { + return _service.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj new file mode 100644 index 00000000..951ad0ea --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml new file mode 100644 index 00000000..00e1d9a1 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs new file mode 100644 index 00000000..c82594b7 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] + public interface IProductTagMongoDbContext : IAbpMongoDbContext + { + /* Define mongo collections here. Example: + * IMongoCollection Questions { get; } + */ + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs new file mode 100644 index 00000000..2bfe8f87 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] + public class ProductTagMongoDbContext : AbpMongoDbContext, IProductTagMongoDbContext + { + /* Add mongo collections here. Example: + * public IMongoCollection Questions => Collection(); + */ + + protected override void CreateModel(IMongoModelBuilder modelBuilder) + { + base.CreateModel(modelBuilder); + + modelBuilder.ConfigureProductTag(); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs new file mode 100644 index 00000000..00b88801 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + public static class ProductTagMongoDbContextExtensions + { + public static void ConfigureProductTag( + this IMongoModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new ProductTagMongoModelBuilderConfigurationOptions( + ProductTagDbProperties.DbTablePrefix + ); + + optionsAction?.Invoke(options); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs new file mode 100644 index 00000000..2b28a721 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + [DependsOn( + typeof(ProductTagDomainModule), + typeof(AbpMongoDbModule) + )] + public class ProductTagMongoDbModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddMongoDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..b052723e --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs @@ -0,0 +1,14 @@ +using JetBrains.Annotations; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + public class ProductTagMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions + { + public ProductTagMongoModelBuilderConfigurationOptions( + [NotNull] string collectionPrefix = "") + : base(collectionPrefix) + { + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj new file mode 100644 index 00000000..6a8d8589 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj @@ -0,0 +1,47 @@ + + + + + + netcoreapp3.1 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + EasyAbp.EShop.Plugins.ProductTag.Web + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs new file mode 100644 index 00000000..23344d33 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs @@ -0,0 +1,39 @@ +using System.Collections.Generic; +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using EasyAbp.EShop.Plugins.ProductTag.Permissions; +using EasyAbp.EShop.Products.Web.Menus; +using System.Threading.Tasks; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Menus +{ + public class ProductTagMenuContributor : IMenuContributor + { + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenu(context); + } + } + + private async Task ConfigureMainMenu(MenuConfigurationContext context) + { + //Add main menu items. + var l = context.GetLocalizer(); + + var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == ProductsMenus.ModuleGroupPrefix, + () => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); + + var productManagementMenuItem = eShopMenuItem.Items.GetOrAdd(x => x.Name == ProductsMenus.Prefix, + () => new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"])); + + if (await context.IsGrantedAsync(ProductTagPermissions.Tags.Default)) + { + productManagementMenuItem.AddItem( + new ApplicationMenuItem(ProductTagMenus.Tag, l["Menu:Tag"], "/EShop/Products/Tags/Tag") + ); + } + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs new file mode 100644 index 00000000..9d59ae47 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs @@ -0,0 +1,13 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Menus +{ + public class ProductTagMenus + { + private const string Prefix = "ProductTag"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + + public const string Tag = Prefix + ".Tag"; + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml new file mode 100644 index 00000000..85b85366 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml @@ -0,0 +1,9 @@ +@page +@using Microsoft.Extensions.Localization +@using EasyAbp.EShop.Plugins.ProductTag.Localization +@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.ProductTag.IndexModel +@inject IStringLocalizer L +@{ +} +

ProductTag

+

@L["SamplePageMessage"]

diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs new file mode 100644 index 00000000..c4fc906c --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.ProductTag +{ + public class IndexModel : ProductTagPageModel + { + public void OnGet() + { + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml new file mode 100644 index 00000000..07cc44da --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using EasyAbp.EShop.Plugins.ProductTag.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs new file mode 100644 index 00000000..134cb57e --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs @@ -0,0 +1,26 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag +{ + public class CreateModalModel : ProductTagPageModel + { + [BindProperty] + public CreateTagDto ViewModel { get; set; } + + private readonly ITagAppService _service; + + public CreateModalModel(ITagAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + await _service.CreateAsync(ViewModel); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml new file mode 100644 index 00000000..ffb257f8 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.EShop.Plugins.ProductTag.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs new file mode 100644 index 00000000..61595422 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs @@ -0,0 +1,37 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.ProductTag.Tags; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag +{ + public class EditModalModel : ProductTagPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public UpdateTagDto ViewModel { get; set; } + + private readonly ITagAppService _service; + + public EditModalModel(ITagAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + await _service.UpdateAsync(Id, ViewModel); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml new file mode 100644 index 00000000..4de9187d --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml @@ -0,0 +1,61 @@ +@page +@using EasyAbp.EShop.Plugins.ProductTag.Localization +@using EasyAbp.EShop.Plugins.ProductTag.Web.Menus +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@{ + PageLayout.Content.Title = L["Tag"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Tag"].Value); + PageLayout.Content.MenuItemName = ProductTagMenus.Tag; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + + @L["Tag"] - @Model.StoreName + + + + + + + + + + + @L["Actions"] + Id + @*@L["TagStoreId"]*@ + @L["TagDescription"] + @L["TagMediaResources"] + @*@L["TagIsHidden"]*@ + @L["TagDisplayName"] + @*@L["TagCode"]*@ + @*@L["TagLevel"]*@ + @L["TagParentId"] + @*@L["TagParent"] + @L["TagChildren"]*@ + + + + + \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs new file mode 100644 index 00000000..ec5a07d9 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs @@ -0,0 +1,51 @@ +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.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag +{ + public class IndexModel : ProductTagPageModel + { + private readonly IStoreAppService _storeAppService; + private readonly IStoreOwnerAppService _storeOwnerAppService; + + [BindProperty(SupportsGet = true)] + public Guid? StoreId { get; set; } + + public string StoreName { get; set; } + + public IndexModel(IStoreAppService storeAppService, + IStoreOwnerAppService storeOwnerAppService) + { + _storeAppService = storeAppService; + _storeOwnerAppService = storeOwnerAppService; + } + + public virtual async Task OnGetAsync() + { + //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; + } + + //show default store + if (!StoreId.HasValue) + { + var defaultStore = await _storeAppService.GetDefaultAsync(); + StoreId = defaultStore.Id; + } + + StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name; + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css new file mode 100644 index 00000000..e69de29b diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js new file mode 100644 index 00000000..1617ed57 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js @@ -0,0 +1,80 @@ +$(function () { + + var l = abp.localization.getResource('Products'); + + var service = easyAbp.eShop.products.tags.tag; + var createModal = new abp.ModalManager(abp.appPath + 'EShop/Products/Tags/Tag/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'EShop/Products/Tags/Tag/EditModal'); + + var dataTable = $('#TagTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId, showHidden: true } + }), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Product'), + action: function (data) { + document.location.href = document.location.origin + + '/EShop/Products/Products/Product?StoreId=' + storeId + '&TagId=' + data.record.id; + } + }, + { + text: l('Edit'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + confirmMessage: function (data) { + return l('TagDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { data: "id"}, + //{ data: "storeId" }, + { data: "description" }, + { data: "mediaResources" }, + //{ data: "isHidden" }, + { data: "displayName" }, + //{ data: "code" }, + //{ data: "level" }, + { data: "parentId" }, + //{ data: "parent" }, + //{ data: "children" }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewTagButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs new file mode 100644 index 00000000..7cb25b39 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs @@ -0,0 +1,16 @@ +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages +{ + /* Inherit your PageModel classes from this class. + */ + public abstract class ProductTagPageModel : AbpPageModel + { + protected ProductTagPageModel() + { + LocalizationResourceType = typeof(ProductTagResource); + ObjectMapperContext = typeof(ProductTagWebModule); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs new file mode 100644 index 00000000..e6196b15 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs @@ -0,0 +1,18 @@ +using AutoMapper; +using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web +{ + public class ProductTagWebAutoMapperProfile : Profile + { + public ProductTagWebAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + + CreateMap(); + CreateMap(); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs new file mode 100644 index 00000000..79dbc117 --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs @@ -0,0 +1,58 @@ +using EasyAbp.EShop.Plugins.ProductTag.Localization; +using EasyAbp.EShop.Plugins.ProductTag.Web.Menus; +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.ProductTag.Web +{ + [DependsOn( + typeof(ProductTagHttpApiModule), + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAutoMapperModule) + )] + public class ProductTagWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(ProductTagResource), typeof(ProductTagWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(ProductTagWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new ProductTagMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } + } +} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json new file mode 100644 index 00000000..0f428ebe --- /dev/null +++ b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:1625/", + "sslPort": 44392 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EasyAbp.EShop.Plugins.ProductTag.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj new file mode 100644 index 00000000..0d0e5054 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs new file mode 100644 index 00000000..aa019db8 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.ProductTag +{ + /* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ + public abstract class ProductTagApplicationTestBase : ProductTagTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs new file mode 100644 index 00000000..662e0188 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagApplicationModule), + typeof(ProductTagDomainTestModule) + )] + public class ProductTagApplicationTestModule : AbpModule + { + + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs new file mode 100644 index 00000000..6e5f4666 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs @@ -0,0 +1,30 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Plugins.ProductTag.Samples +{ + public class SampleAppService_Tests : ProductTagApplicationTestBase + { + private readonly ISampleAppService _sampleAppService; + + public SampleAppService_Tests() + { + _sampleAppService = GetRequiredService(); + } + + [Fact] + public async Task GetAsync() + { + var result = await _sampleAppService.GetAsync(); + result.Value.ShouldBe(42); + } + + [Fact] + public async Task GetAuthorizedAsync() + { + var result = await _sampleAppService.GetAuthorizedAsync(); + result.Value.ShouldBe(42); + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj new file mode 100644 index 00000000..5ced1389 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs new file mode 100644 index 00000000..9ea5f5aa --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.ProductTag +{ + /* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ + public abstract class ProductTagDomainTestBase : ProductTagTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs new file mode 100644 index 00000000..a287e7b9 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs @@ -0,0 +1,17 @@ +using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + /* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ + [DependsOn( + typeof(ProductTagEntityFrameworkCoreTestModule) + )] + public class ProductTagDomainTestModule : AbpModule + { + + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs new file mode 100644 index 00000000..529935d2 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Plugins.ProductTag.Samples +{ + public class SampleManager_Tests : ProductTagDomainTestBase + { + //private readonly SampleManager _sampleManager; + + public SampleManager_Tests() + { + //_sampleManager = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..ae7e53ba --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..daa009b6 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + /* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class ProductTagEntityFrameworkCoreTestBase : ProductTagTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..388da505 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore +{ + [DependsOn( + typeof(ProductTagTestBaseModule), + typeof(ProductTagEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class ProductTagEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new ProductTagDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..4b161b23 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs @@ -0,0 +1,12 @@ +using EasyAbp.EShop.Plugins.ProductTag.Samples; + +namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Samples +{ + public class SampleRepository_Tests : SampleRepository_Tests + { + /* Don't write custom repository tests here, instead write to + * the base class. + * One exception can be some specific tests related to EF core. + */ + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..cffdd8fb --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,156 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.Extensions.Configuration; +using EasyAbp.EShop.Plugins.ProductTag.Samples; +using Volo.Abp.DependencyInjection; +using Volo.Abp.IdentityModel; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public class ClientDemoService : ITransientDependency + { + private readonly ISampleAppService _sampleAppService; + private readonly IIdentityModelAuthenticationService _authenticationService; + private readonly IConfiguration _configuration; + + public ClientDemoService( + ISampleAppService sampleAppService, + IIdentityModelAuthenticationService authenticationService, + IConfiguration configuration) + { + _sampleAppService = sampleAppService; + _authenticationService = authenticationService; + _configuration = configuration; + } + + public async Task RunAsync() + { + await TestWithDynamicProxiesAsync(); + await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); + await TestAllManuallyAsync(); + } + + /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy + * feature. It is just simple as calling a local service method. + * Authorization and HTTP request details are handled by the ABP framework. + */ + private async Task TestWithDynamicProxiesAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); + + var result = await _sampleAppService.GetAsync(); + Console.WriteLine("Result: " + result.Value); + + result = await _sampleAppService.GetAuthorizedAsync(); + Console.WriteLine("Result (authorized): " + result.Value); + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. + */ + private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); + + //Get access token using ABP's IIdentityModelAuthenticationService + + var accessToken = await _authenticationService.GetAccessTokenAsync( + new IdentityClientConfiguration( + _configuration["IdentityClients:Default:Authority"], + _configuration["IdentityClients:Default:Scope"], + _configuration["IdentityClients:Default:ClientId"], + _configuration["IdentityClients:Default:ClientSecret"], + _configuration["IdentityClients:Default:GrantType"], + _configuration["IdentityClients:Default:UserName"], + _configuration["IdentityClients:Default:UserPassword"] + ) + ); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(accessToken); + + var url = _configuration["RemoteServices:ProductTag:BaseUrl"] + + "api/ProductTag/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It obtains access token using IdentityServer's API. See its documentation: + * https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html + */ + private async Task TestAllManuallyAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); + + //Obtain access token from the IDS4 server + + // discover endpoints from metadata + var client = new HttpClient(); + var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); + if (disco.IsError) + { + Console.WriteLine(disco.Error); + return; + } + + // request token + var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest + { + Address = disco.TokenEndpoint, + ClientId = _configuration["IdentityClients:Default:ClientId"], + ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], + UserName = _configuration["IdentityClients:Default:UserName"], + Password = _configuration["IdentityClients:Default:UserPassword"], + Scope = _configuration["IdentityClients:Default:Scope"] + }); + + if (tokenResponse.IsError) + { + Console.WriteLine(tokenResponse.Error); + return; + } + + Console.WriteLine(tokenResponse.Json); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(tokenResponse.AccessToken); + + var url = _configuration["RemoteServices:ProductTag:BaseUrl"] + + "api/ProductTag/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..06b96ffe --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp +{ + public class ConsoleTestAppHostedService : IHostedService + { + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = AbpApplicationFactory.Create()) + { + application.Initialize(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + application.Shutdown(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..99cf34c2 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,26 @@ + + + + Exe + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + + PreserveNewest + Always + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs new file mode 100644 index 00000000..00c5cb52 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(ProductTagHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] + public class ProductTagConsoleApiClientModule : AbpModule + { + + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..282fb945 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp +{ + class Program + { + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..220d40f5 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44362/" + }, + "ProductTag": { + "BaseUrl": "https://localhost:44375/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "ProductTag_ConsoleTestApp", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44362/", + "Scope": "ProductTag" + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj new file mode 100644 index 00000000..d0f972bf --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj @@ -0,0 +1,17 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs new file mode 100644 index 00000000..7e1890b4 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -0,0 +1,22 @@ +using System; +using Mongo2Go; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + public class MongoDbFixture : IDisposable + { + private static readonly MongoDbRunner MongoDbRunner; + public static readonly string ConnectionString; + + static MongoDbFixture() + { + MongoDbRunner = MongoDbRunner.Start(); + ConnectionString = MongoDbRunner.ConnectionString; + } + + public void Dispose() + { + MongoDbRunner?.Dispose(); + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs new file mode 100644 index 00000000..5021a6fe --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs @@ -0,0 +1,10 @@ +using Xunit; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + [CollectionDefinition(Name)] + public class MongoTestCollection : ICollectionFixture + { + public const string Name = "MongoDB Collection"; + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs new file mode 100644 index 00000000..b4814cc2 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + /* This class can be used as a base class for MongoDB integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class ProductTagMongoDbTestBase : ProductTagTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs new file mode 100644 index 00000000..f77a5e40 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs @@ -0,0 +1,25 @@ +using System; +using Volo.Abp.Data; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB +{ + [DependsOn( + typeof(ProductTagTestBaseModule), + typeof(ProductTagMongoDbModule) + )] + public class ProductTagMongoDbTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N"); + + Configure(options => + { + options.ConnectionStrings.Default = connectionString; + }); + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..0c1e9333 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs @@ -0,0 +1,14 @@ +using EasyAbp.EShop.Plugins.ProductTag.Samples; +using Xunit; + +namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB.Samples +{ + [Collection(MongoTestCollection.Name)] + public class SampleRepository_Tests : SampleRepository_Tests + { + /* Don't write custom repository tests here, instead write to + * the base class. + * One exception can be some specific tests related to MongoDB. + */ + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj new file mode 100644 index 00000000..d8c26cfe --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.ProductTag + + + + + + + + + + + + + + + + diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs new file mode 100644 index 00000000..5ee6714a --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + public class ProductTagDataSeedContributor : IDataSeedContributor, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + + public ProductTagDataSeedContributor( + IGuidGenerator guidGenerator) + { + _guidGenerator = guidGenerator; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs new file mode 100644 index 00000000..ffc27da7 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + /* All test classes are derived from this class, directly or indirectly. */ + public abstract class ProductTagTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs new file mode 100644 index 00000000..f7c7e7a6 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EasyAbp.EShop.Plugins.ProductTag +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(ProductTagDomainModule) + )] + public class ProductTagTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs new file mode 100644 index 00000000..f2eeae67 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Modularity; +using Xunit; + +namespace EasyAbp.EShop.Plugins.ProductTag.Samples +{ + /* Write your custom repository tests like that, in this project, as abstract classes. + * Then inherit these abstract classes from EF Core & MongoDB test projects. + * In this way, both database providers are tests with the same set tests. + */ + public abstract class SampleRepository_Tests : ProductTagTestBase + where TStartupModule : IAbpModule + { + //private readonly ISampleRepository _sampleRepository; + + protected SampleRepository_Tests() + { + //_sampleRepository = GetRequiredService(); + } + + [Fact] + public async Task Method1Async() + { + + } + } +} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..25bd2a26 --- /dev/null +++ b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EasyAbp.EShop.Plugins.ProductTag.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/plugins/StoreApproval/.gitattributes b/plugins/StoreApproval/.gitattributes new file mode 100644 index 00000000..c941e526 --- /dev/null +++ b/plugins/StoreApproval/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/plugins/StoreApproval/.gitignore b/plugins/StoreApproval/.gitignore new file mode 100644 index 00000000..8a6cac80 --- /dev/null +++ b/plugins/StoreApproval/.gitignore @@ -0,0 +1,258 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# StoreApproval +host/EasyAbp.EShop.Plugins.StoreApproval.IdentityServer/Logs/logs.txt +host/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.StoreApproval.Web.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.StoreApproval.Web.Unified/Logs/logs.txt diff --git a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln new file mode 100644 index 00000000..7de6603e --- /dev/null +++ b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln @@ -0,0 +1,144 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29001.49 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared", "src\EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared\EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain", "src\EasyAbp.EShop.Plugins.StoreApproval.Domain\EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts", "src\EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts\EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application", "src\EasyAbp.EShop.Plugins.StoreApproval.Application\EasyAbp.EShop.Plugins.StoreApproval.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.MongoDB", "src\EasyAbp.EShop.Plugins.StoreApproval.MongoDB\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi", "src\EasyAbp.EShop.Plugins.StoreApproval.HttpApi\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client", "src\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.TestBase", "test\EasyAbp.EShop.Plugins.StoreApproval.TestBase\EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests\EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.Application.Tests\EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Web", "src\EasyAbp.EShop.Plugins.StoreApproval.Web\EasyAbp.EShop.Plugins.StoreApproval.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Host.Shared", "host\EasyAbp.EShop.Plugins.StoreApproval.Host.Shared\EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{654F3755-D4A8-4C3A-9BB6-339D757EBC20}" + ProjectSection(SolutionItems) = preProject + common.props = common.props + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU + {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU + {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU + {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} + {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings new file mode 100644 index 00000000..8572f56c --- /dev/null +++ b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings @@ -0,0 +1,25 @@ + + True + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + WARNING + Required + Required + Required + Required + False + True + False + False + True + False + False + SQL + True + True + \ No newline at end of file diff --git a/plugins/StoreApproval/common.props b/plugins/StoreApproval/common.props new file mode 100644 index 00000000..d9519ad8 --- /dev/null +++ b/plugins/StoreApproval/common.props @@ -0,0 +1,30 @@ + + + latest + 0.1.0 + $(NoWarn);CS1591 + module + true + EasyAbp Team + An abp application module group that provides basic e-shop service. + https://avatars3.githubusercontent.com/u/58311641?s=128 + https://github.com/EasyAbp/EShop + https://github.com/EasyAbp/EShop + abp module easyabp EShop shopping shop ordering product payment store mall + EasyAbp + MIT + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/docker-compose.migrations.yml b/plugins/StoreApproval/docker-compose.migrations.yml new file mode 100644 index 00000000..c753f66f --- /dev/null +++ b/plugins/StoreApproval/docker-compose.migrations.yml @@ -0,0 +1,13 @@ +version: '3.4' + +services: + migrations: + build: + context: ../../ + dockerfile: templates/service/database/Dockerfile + depends_on: + - sqlserver + environment: + - IdentityServer_DB=StoreApproval_Identity + - StoreApproval_DB=StoreApproval_ModuleDb + - SA_PASSWORD=yourStrong(!)Password diff --git a/plugins/StoreApproval/docker-compose.override.yml b/plugins/StoreApproval/docker-compose.override.yml new file mode 100644 index 00000000..a9c8aece --- /dev/null +++ b/plugins/StoreApproval/docker-compose.override.yml @@ -0,0 +1,29 @@ +version: '3.4' + +services: + sqlserver: + environment: + - SA_PASSWORD=yourStrong(!)Password + - ACCEPT_EULA=Y + ports: + - "51599:1433" + + identity-server: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=StoreApproval_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + ports: + - "51600:80" + + store-approval: + environment: + - ASPNETCORE_URLS=http://0.0.0.0:80 + - ConnectionStrings__Default=Server=sqlserver;Database=StoreApproval_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=StoreApproval_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false + - AuthServer__Authority=http://identity-server + ports: + - "51601:80" \ No newline at end of file diff --git a/plugins/StoreApproval/docker-compose.yml b/plugins/StoreApproval/docker-compose.yml new file mode 100644 index 00000000..f327a3e6 --- /dev/null +++ b/plugins/StoreApproval/docker-compose.yml @@ -0,0 +1,25 @@ +version: '3.4' + +services: + sqlserver: + image: mcr.microsoft.com/mssql/server + volumes: + - dbdata:/var/opt/mssql + + identity-server: + build: + context: ../../ + dockerfile: templates/service/host/IdentityServerHost/Dockerfile + depends_on: + - sqlserver + + store-approval: + build: + context: ../../ + dockerfile: templates/service/host/EasyAbp.EShop.Plugins.StoreApproval.Host/Dockerfile + depends_on: + - sqlserver + - identity-server + +volumes: + dbdata: \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj new file mode 100644 index 00000000..79121eff --- /dev/null +++ b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj @@ -0,0 +1,10 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 00000000..2afcefc5 --- /dev/null +++ b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.MultiTenancy +{ + public static class MultiTenancyConsts + { + /* Enable/disable multi-tenancy in a single point + * to test your module with multi-tenancy. + */ + public const bool IsEnabled = false; + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj new file mode 100644 index 00000000..bca008da --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..bd6def33 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs new file mode 100644 index 00000000..944dbb18 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs @@ -0,0 +1,25 @@ +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Permissions +{ + public class StoreApprovalPermissionDefinitionProvider : PermissionDefinitionProvider + { + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(StoreApprovalPermissions.GroupName, L("Permission:StoreApproval")); + + var storeApplicationPermission = myGroup.AddPermission(StoreApprovalPermissions.StoreApplication.Default, L("Permission:StoreApplication")); + storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Create, L("Permission:Create")); + storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Update, L("Permission:Update")); + storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Delete, L("Permission:Delete")); + storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Approval, L("Permission:Approval")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs new file mode 100644 index 00000000..c526c6da --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs @@ -0,0 +1,23 @@ +using Volo.Abp.Reflection; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Permissions +{ + public class StoreApprovalPermissions + { + public const string GroupName = "StoreApproval"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(StoreApprovalPermissions)); + } + + public class StoreApplication + { + public const string Default = GroupName + ".StoreApplication"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + public const string Approval = Default + ".Approval"; + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs new file mode 100644 index 00000000..bbad0b85 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs @@ -0,0 +1,64 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.Validation; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos +{ + [Serializable] + public class CreateStoreApplicationDto : UpdateStoreApplicationDto + { + [Required] + public Guid ApplicantId { get; set; } + } + + [Serializable] + public class UpdateStoreApplicationDto + { + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string StoreName { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string BusinessCategory { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxAddressLength))] + public string Address { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string UnifiedCreditCode { get; set; } + + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string HouseNumber { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] + public string BusinessLicenseImage { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string Name { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] + public string IdNumber { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] + public string IdCardFrontImage { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] + public string IdCardBackImage { get; set; } + + [Required] + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] + public string StoreImage { get; set; } + + [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNoteLength))] + public string Note { get; set; } + } + +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs new file mode 100644 index 00000000..8d89b5d6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs @@ -0,0 +1,20 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos +{ + public class GetStoreApplicationListDto : PagedAndSortedResultRequestDto + { + public Guid? ApplicantId { get; set; } + + public string StoreName { get; set; } + + public string BusinessCategory { get; protected set; } + + public string UnifiedCreditCode { get; protected set; } + + public string Name { get; protected set; } + + public string IdNumber { get; protected set; } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs new file mode 100644 index 00000000..add16dab --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs @@ -0,0 +1,37 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos +{ + [Serializable] + public class StoreApplicationDto : FullAuditedEntityDto + { + public Guid ApplicantId { get; set; } + + public ApprovalStatusType ApprovalStatus { get; set; } + + public string StoreName { get; set; } + + public string BusinessCategory { get; set; } + + public string Address { get; set; } + + public string UnifiedCreditCode { get; set; } + + public string HouseNumber { get; set; } + + public string BusinessLicenseImage { get; set; } + + public string Name { get; set; } + + public string IdNumber { get; set; } + + public string IdCardFrontImage { get; set; } + + public string IdCardBackImage { get; set; } + + public string StoreImage { get; set; } + + public string Note { get; set; } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs new file mode 100644 index 00000000..08d8b37d --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs @@ -0,0 +1,22 @@ +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public interface IStoreApplicationAppService : + ICrudAppService< + StoreApplicationDto, + Guid, + GetStoreApplicationListDto, + CreateStoreApplicationDto, + UpdateStoreApplicationDto> + { + Task SubmitAsync(Guid id); + + Task ApproveAsync(Guid id); + + Task RejectAsync(Guid id); + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs new file mode 100644 index 00000000..d41877b2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs @@ -0,0 +1,16 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] + public class StoreApprovalApplicationContractsModule : AbpModule + { + + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj new file mode 100644 index 00000000..8903c456 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs new file mode 100644 index 00000000..234be2aa --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs @@ -0,0 +1,118 @@ +using EasyAbp.EShop.Plugins.StoreApproval.Permissions; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.Identity; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationAppService : CrudAppService, + IStoreApplicationAppService + { + protected IdentityUserManager UserManager; + protected override string GetPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Default; + protected override string GetListPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Default; + protected override string CreatePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Create; + protected override string UpdatePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Update; + protected override string DeletePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Delete; + protected virtual string ApprovalPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Approval; + + public StoreApplicationAppService(IRepository repository, + IdentityUserManager userManager) : base(repository) + { + UserManager = userManager; + } + + protected override IQueryable CreateFilteredQuery(GetStoreApplicationListDto input) + { + var queryable = base.CreateFilteredQuery(input); + + if (input.ApplicantId.HasValue) + { + queryable = queryable.Where(x => x.ApplicantId == input.ApplicantId.Value); + } + + if (!input.Name.IsNullOrWhiteSpace()) + { + queryable = queryable.Where(x => x.Name == input.Name); + } + + if (!input.StoreName.IsNullOrWhiteSpace()) + { + queryable = queryable.Where(x => x.StoreName == input.StoreName); + } + + if (!input.BusinessCategory.IsNullOrWhiteSpace()) + { + queryable = queryable.Where(x => x.BusinessCategory == input.BusinessCategory); + } + + if (!input.IdNumber.IsNullOrWhiteSpace()) + { + queryable = queryable.Where(x => x.IdNumber == input.IdNumber); + } + + if (!input.UnifiedCreditCode.IsNullOrWhiteSpace()) + { + queryable = queryable.Where(x => x.UnifiedCreditCode == input.UnifiedCreditCode); + } + + return queryable; + } + + public override async Task CreateAsync(CreateStoreApplicationDto input) + { + await CheckCreatePolicyAsync(); + + var user = await UserManager.GetByIdAsync(input.ApplicantId); + + var entity = MapToEntity(input); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public async Task SubmitAsync(Guid id) + { + await CheckCreatePolicyAsync(); + + var entity = await GetEntityByIdAsync(id); + entity.Submit(); + + await Repository.UpdateAsync(entity); + + return ObjectMapper.Map(entity); + } + + public async Task ApproveAsync(Guid id) + { + await CheckPolicyAsync(ApprovalPolicyName); + + var entity = await GetEntityByIdAsync(id); + entity.Approve(); + + await Repository.UpdateAsync(entity); + + return ObjectMapper.Map(entity); + } + + public async Task RejectAsync(Guid id) + { + await CheckPolicyAsync(ApprovalPolicyName); + + var entity = await GetEntityByIdAsync(id); + entity.Reject(); + + await Repository.UpdateAsync(entity); + + return ObjectMapper.Map(entity); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs new file mode 100644 index 00000000..cc5eb9b7 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs @@ -0,0 +1,14 @@ +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public abstract class StoreApprovalAppService : ApplicationService + { + protected StoreApprovalAppService() + { + LocalizationResource = typeof(StoreApprovalResource); + ObjectMapperContext = typeof(StoreApprovalApplicationModule); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..a1f6cab9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs @@ -0,0 +1,19 @@ +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public class StoreApprovalApplicationAutoMapperProfile : Profile + { + public StoreApprovalApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + CreateMap(); + CreateMap(MemberList.Source); + CreateMap(MemberList.Source); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs new file mode 100644 index 00000000..d1bb4c05 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs @@ -0,0 +1,25 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalDomainModule), + typeof(StoreApprovalApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] + public class StoreApprovalApplicationModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj new file mode 100644 index 00000000..d478ff43 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj @@ -0,0 +1,24 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + true + + + + + + + + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json new file mode 100644 index 00000000..c6271538 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json @@ -0,0 +1,31 @@ +{ + "culture": "cs", + "texts": { + "ManageYourProfile": "Spravovat profil", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json new file mode 100644 index 00000000..8d4fc4b6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json @@ -0,0 +1,32 @@ +{ + "culture": "en", + "texts": { + "ManageYourProfile": "Manage your profile", + "SamplePageMessage": "A sample page for the StoreApproval module", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json new file mode 100644 index 00000000..4cb155d4 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json @@ -0,0 +1,30 @@ +{ + "culture": "pl-PL", + "texts": { + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json new file mode 100644 index 00000000..faf80305 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json @@ -0,0 +1,30 @@ +{ + "culture": "pt-BR", + "texts": { + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json new file mode 100644 index 00000000..6b4e8b9b --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json @@ -0,0 +1,31 @@ +{ + "culture": "sl", + "texts": { + "ManageYourProfile": "Upravljajte svojim profilom", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json new file mode 100644 index 00000000..74815d15 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json @@ -0,0 +1,32 @@ +{ + "culture": "tr", + "texts": { + "ManageYourProfile": "Profil yönetimi", + "SamplePageMessage": "StoreApproval modulünden örnek bir sayfa", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json new file mode 100644 index 00000000..ced4802f --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json @@ -0,0 +1,30 @@ +{ + "culture": "vi", + "texts": { + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json new file mode 100644 index 00000000..05987cbc --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json @@ -0,0 +1,31 @@ +{ + "culture": "zh-Hans", + "texts": { + "ManageYourProfile": "管理个人资料", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json new file mode 100644 index 00000000..f04735e8 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json @@ -0,0 +1,31 @@ +{ + "culture": "zh-Hant", + "texts": { + "ManageYourProfile": "管理個人資料", + "Permission:StoreApplication": "StoreApplication", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Permission:Approval": "Approval", + "Menu:StoreApplication": "MenuStoreApplication", + "StoreApplication": "StoreApplication", + "StoreApplicationApplicantId": "StoreApplicationApplicantId", + "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", + "StoreApplicationStoreName": "StoreApplicationStoreName", + "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", + "StoreApplicationAddress": "StoreApplicationAddress", + "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", + "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", + "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", + "StoreApplicationName": "StoreApplicationName", + "StoreApplicationIdNumber": "StoreApplicationIdNumber", + "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", + "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", + "StoreApplicationStoreImage": "StoreApplicationStoreImage", + "StoreApplicationNote": "StoreApplicationNote", + "CreateStoreApplication": "CreateStoreApplication", + "EditStoreApplication": "EditStoreApplication", + "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", + "SuccessfullyDeleted": "Successfully deleted" + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs new file mode 100644 index 00000000..2154af53 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs @@ -0,0 +1,10 @@ +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Localization +{ + [LocalizationResourceName("StoreApproval")] + public class StoreApprovalResource + { + + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs new file mode 100644 index 00000000..1287a974 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs @@ -0,0 +1,13 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public enum ApprovalStatusType + { + Preparing, + + ReadyForReview, + + Rejected, + + Approved, + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs new file mode 100644 index 00000000..b12397d3 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs @@ -0,0 +1,13 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public static class StoreApplicationConsts + { + public static int MaxNameLength { get; set; } = 32; + + public static int MaxAddressLength { get; set; } = 128; + + public static int MaxImageResourcesLength { get; set; } = 64; + + public static int MaxNoteLength { get; set; } = 1024; + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs new file mode 100644 index 00000000..ade9b92f --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs @@ -0,0 +1,37 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(AbpValidationModule) + )] + public class StoreApprovalDomainSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/Localization/StoreApproval"); + }); + + Configure(options => + { + options.MapCodeNamespace("StoreApproval", typeof(StoreApprovalResource)); + }); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs new file mode 100644 index 00000000..1a8dd2a7 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public static class StoreApprovalErrorCodes + { + public const string Namespace = "EasyAbp.EShop.Plugins.StoreApproval"; + + public const string AlreadySubmitted = Namespace + ":" + "000001"; + public const string AlreadyApproved = Namespace + ":" + "000002"; + public const string NotSubmitted = Namespace + ":" + "000003"; + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj new file mode 100644 index 00000000..ab0263a4 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml new file mode 100644 index 00000000..00e1d9a1 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs new file mode 100644 index 00000000..b4bab658 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Settings; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Settings +{ + public class StoreApprovalSettingDefinitionProvider : SettingDefinitionProvider + { + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from StoreApprovalSettings class. + */ + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs new file mode 100644 index 00000000..b1a9cf84 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.Settings +{ + public static class StoreApprovalSettings + { + public const string GroupName = "StoreApproval"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs new file mode 100644 index 00000000..e1dea6d8 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public interface IStoreApplicationRepository : IRepository + { + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs new file mode 100644 index 00000000..735e7217 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs @@ -0,0 +1,129 @@ +using System; +using JetBrains.Annotations; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplication : FullAuditedAggregateRoot, IMultiTenant + { + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid ApplicantId { get; protected set; } + + public virtual ApprovalStatusType ApprovalStatus { get; protected set; } + + [NotNull] + public virtual string StoreName { get; protected set; } + + [NotNull] + public virtual string BusinessCategory { get; protected set; } + + [NotNull] + public virtual string Address { get; protected set; } + + [NotNull] + public virtual string UnifiedCreditCode { get; protected set; } + + [CanBeNull] + public virtual string HouseNumber { get; protected set; } + + [NotNull] + public virtual string BusinessLicenseImage { get; protected set; } + + [NotNull] + public virtual string Name { get; protected set; } + + [NotNull] + public virtual string IdNumber { get; protected set; } + + [NotNull] + public virtual string IdCardFrontImage { get; protected set; } + + [NotNull] + public virtual string IdCardBackImage { get; protected set; } + + [NotNull] + public virtual string StoreImage { get; protected set; } + + [CanBeNull] + public virtual string Note { get; protected set; } + + protected StoreApplication() + { + } + + public StoreApplication(Guid id, Guid? tenantId, Guid applicantId, ApprovalStatusType approvalStatus, string storeName, string businessCategory, string address, string unifiedCreditCode, string houseNumber, string businessLicenseImage, string name, string idNumber, string idCardFrontImage, string idCardBackImage, string storeImage, string note) : base(id) + { + TenantId = tenantId; + ApplicantId = applicantId; + ApprovalStatus = approvalStatus; + StoreName = storeName; + BusinessCategory = businessCategory; + Address = address; + UnifiedCreditCode = unifiedCreditCode; + HouseNumber = houseNumber; + BusinessLicenseImage = businessLicenseImage; + Name = name; + IdNumber = idNumber; + IdCardFrontImage = idCardFrontImage; + IdCardBackImage = idCardBackImage; + StoreImage = storeImage; + Note = note; + } + + public void Submit() + { + switch (ApprovalStatus) + { + case ApprovalStatusType.Preparing: + case ApprovalStatusType.Rejected: + ApprovalStatus = ApprovalStatusType.ReadyForReview; + //TODO event + break; + case ApprovalStatusType.ReadyForReview: + throw new StoreApplicationAlreadySubmittedException(); + case ApprovalStatusType.Approved: + throw new StoreApplicationAlreadyApprovedException(); + default: + throw new ArgumentOutOfRangeException(); + } + } + + public void Approve() + { + switch (ApprovalStatus) + { + case ApprovalStatusType.ReadyForReview: + ApprovalStatus = ApprovalStatusType.Approved; + //TODO event + break; + case ApprovalStatusType.Preparing: + case ApprovalStatusType.Rejected: + throw new StoreApplicationNotSubmittedException(); + case ApprovalStatusType.Approved: + throw new StoreApplicationAlreadyApprovedException(); + default: + throw new ArgumentOutOfRangeException(); + } + } + + public void Reject() + { + switch (ApprovalStatus) + { + case ApprovalStatusType.ReadyForReview: + ApprovalStatus = ApprovalStatusType.Rejected; + //TODO event + break; + case ApprovalStatusType.Preparing: + case ApprovalStatusType.Rejected: + throw new StoreApplicationNotSubmittedException(); + case ApprovalStatusType.Approved: + throw new StoreApplicationAlreadyApprovedException(); + default: + throw new ArgumentOutOfRangeException(); + } + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs new file mode 100644 index 00000000..f0e1ea8d --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs @@ -0,0 +1,13 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationAlreadyApprovedException : BusinessException + { + public StoreApplicationAlreadyApprovedException() + :base(StoreApprovalErrorCodes.AlreadyApproved) + { + + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs new file mode 100644 index 00000000..08d65acb --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs @@ -0,0 +1,13 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationAlreadySubmittedException : BusinessException + { + public StoreApplicationAlreadySubmittedException() + : base(StoreApprovalErrorCodes.AlreadySubmitted) + { + + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs new file mode 100644 index 00000000..eb2e24f0 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs @@ -0,0 +1,13 @@ +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationNotSubmittedException : BusinessException + { + public StoreApplicationNotSubmittedException() + : base(StoreApprovalErrorCodes.NotSubmitted) + { + + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs new file mode 100644 index 00000000..e6eedabe --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Stores; +using Microsoft.AspNetCore.Identity; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.Guids; +using Volo.Abp.Identity; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationUpdatedEventHandler + : ILocalEventHandler>, + ITransientDependency + { + private readonly IStoreManager _storeManager; + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + private readonly IdentityUserManager _userManager; + + public StoreApplicationUpdatedEventHandler(IStoreManager storeManager, + IGuidGenerator guidGenerator, + ICurrentTenant currentTenant, + IdentityUserManager userManager) + { + _storeManager = storeManager; + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + _userManager = userManager; + } + + public async Task HandleEventAsync( + EntityUpdatedEventData eventData) + { + switch (eventData.Entity.ApprovalStatus) + { + case ApprovalStatusType.Preparing: + case ApprovalStatusType.ReadyForReview: + case ApprovalStatusType.Rejected: + break; + case ApprovalStatusType.Approved: + await CreateStore(eventData.Entity.StoreName, eventData.Entity.ApplicantId); + break; + default: + throw new ArgumentOutOfRangeException(); + } + } + + private async Task CreateStore(string storeName, Guid userId) + { + const string merchant = nameof(merchant); + + var user = await _userManager.GetByIdAsync(userId); + + var store = await _storeManager.CreateAsync(new Store( + _guidGenerator.Create(), + _currentTenant.Id, + storeName), new []{ userId }); + + (await _userManager.SetRolesAsync(user, new []{ merchant })).CheckErrors(); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs new file mode 100644 index 00000000..4ec63638 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public static class StoreApprovalDbProperties + { + public static string DbTablePrefix { get; set; } = "StoreApproval"; + + public static string DbSchema { get; set; } = null; + + public const string ConnectionStringName = "StoreApproval"; + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs new file mode 100644 index 00000000..109dc1ce --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalDomainSharedModule) + )] + public class StoreApprovalDomainModule : AbpModule + { + + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj new file mode 100644 index 00000000..67bb7fac --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs new file mode 100644 index 00000000..3903b575 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs @@ -0,0 +1,16 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] + public interface IStoreApprovalDbContext : IEfCoreDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ + DbSet StoreApplications { get; set; } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs new file mode 100644 index 00000000..6283c96b --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] + public class StoreApprovalDbContext : AbpDbContext, IStoreApprovalDbContext + { + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + public DbSet StoreApplications { get; set; } + + public StoreApprovalDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureStoreApproval(); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..d5b5245e --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs @@ -0,0 +1,54 @@ +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using System; +using Microsoft.EntityFrameworkCore; +using Volo.Abp; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + public static class StoreApprovalDbContextModelCreatingExtensions + { + public static void ConfigureStoreApproval( + this ModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new StoreApprovalModelBuilderConfigurationOptions( + StoreApprovalDbProperties.DbTablePrefix, + StoreApprovalDbProperties.DbSchema + ); + + optionsAction?.Invoke(options); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(options.TablePrefix + "Questions", options.Schema); + + b.ConfigureByConvention(); + + //Properties + b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); + + //Relations + b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); + + //Indexes + b.HasIndex(q => q.CreationTime); + }); + */ + + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "StoreApplications", options.Schema); + b.ConfigureByConvention(); + + /* Configure more properties here */ + }); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..1d98af3b --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs @@ -0,0 +1,26 @@ +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + [DependsOn( + typeof(StoreApprovalDomainModule), + typeof(AbpEntityFrameworkCoreModule) + )] + public class StoreApprovalEntityFrameworkCoreModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + + options.AddRepository(); + }); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..49fb4601 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs @@ -0,0 +1,18 @@ +using JetBrains.Annotations; +using Volo.Abp.EntityFrameworkCore.Modeling; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + public class StoreApprovalModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions + { + public StoreApprovalModelBuilderConfigurationOptions( + [NotNull] string tablePrefix = "", + [CanBeNull] string schema = null) + : base( + tablePrefix, + schema) + { + + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs new file mode 100644 index 00000000..eb6652a6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs @@ -0,0 +1,14 @@ +using EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore; +using System; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class EfCoreStoreApplicationRepository : EfCoreRepository, IStoreApplicationRepository + { + public EfCoreStoreApplicationRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj new file mode 100644 index 00000000..fab85913 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj @@ -0,0 +1,15 @@ + + + + + + netstandard2.0 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..00e1d9a1 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs new file mode 100644 index 00000000..d6b739f8 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalApplicationContractsModule), + typeof(AbpHttpClientModule))] + public class StoreApprovalHttpApiClientModule : AbpModule + { + public const string RemoteServiceName = "StoreApproval"; + + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(StoreApprovalApplicationContractsModule).Assembly, + RemoteServiceName + ); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj new file mode 100644 index 00000000..fce884bd --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs new file mode 100644 index 00000000..076e8c32 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs @@ -0,0 +1,75 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using Volo.Abp.Application.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + [RemoteService(Name = "StoreApprovalStoreApplication")] + [Route("/api/eShop/storeApproval/storeApplication")] + public class StoreApplicationController : StoreApprovalController, IStoreApplicationAppService + { + private readonly IStoreApplicationAppService _service; + + public StoreApplicationController(IStoreApplicationAppService service) + { + _service = service; + } + + [HttpGet] + [Route("{id}")] + public virtual Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public virtual Task> GetListAsync(GetStoreApplicationListDto input) + { + return _service.GetListAsync(input); + } + + [HttpPost] + public virtual Task CreateAsync(CreateStoreApplicationDto input) + { + return _service.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public virtual Task UpdateAsync(Guid id, UpdateStoreApplicationDto input) + { + return _service.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public virtual Task DeleteAsync(Guid id) + { + return _service.DeleteAsync(id); + } + + [HttpPost] + [Route("{id}/submit")] + public virtual Task SubmitAsync(Guid id) + { + return _service.SubmitAsync(id); + } + + [HttpPost] + [Route("{id}/approve")] + public virtual Task ApproveAsync(Guid id) + { + return _service.ApproveAsync(id); + } + + [HttpPost] + [Route("{id}/reject")] + public virtual Task RejectAsync(Guid id) + { + return _service.RejectAsync(id); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs new file mode 100644 index 00000000..ae77fa33 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public abstract class StoreApprovalController : AbpController + { + protected StoreApprovalController() + { + LocalizationResource = typeof(StoreApprovalResource); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs new file mode 100644 index 00000000..15809319 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs @@ -0,0 +1,33 @@ +using Localization.Resources.AbpUi; +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] + public class StoreApprovalHttpApiModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(StoreApprovalHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj new file mode 100644 index 00000000..57314e99 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml new file mode 100644 index 00000000..00e1d9a1 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs new file mode 100644 index 00000000..37a35ac2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] + public interface IStoreApprovalMongoDbContext : IAbpMongoDbContext + { + /* Define mongo collections here. Example: + * IMongoCollection Questions { get; } + */ + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs new file mode 100644 index 00000000..d46fd9a3 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs @@ -0,0 +1,20 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] + public class StoreApprovalMongoDbContext : AbpMongoDbContext, IStoreApprovalMongoDbContext + { + /* Add mongo collections here. Example: + * public IMongoCollection Questions => Collection(); + */ + + protected override void CreateModel(IMongoModelBuilder modelBuilder) + { + base.CreateModel(modelBuilder); + + modelBuilder.ConfigureStoreApproval(); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs new file mode 100644 index 00000000..9778a881 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs @@ -0,0 +1,22 @@ +using System; +using Volo.Abp; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + public static class StoreApprovalMongoDbContextExtensions + { + public static void ConfigureStoreApproval( + this IMongoModelBuilder builder, + Action optionsAction = null) + { + Check.NotNull(builder, nameof(builder)); + + var options = new StoreApprovalMongoModelBuilderConfigurationOptions( + StoreApprovalDbProperties.DbTablePrefix + ); + + optionsAction?.Invoke(options); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs new file mode 100644 index 00000000..d951e3c6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs @@ -0,0 +1,23 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + [DependsOn( + typeof(StoreApprovalDomainModule), + typeof(AbpMongoDbModule) + )] + public class StoreApprovalMongoDbModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddMongoDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs new file mode 100644 index 00000000..ce957c4e --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs @@ -0,0 +1,14 @@ +using JetBrains.Annotations; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + public class StoreApprovalMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions + { + public StoreApprovalMongoModelBuilderConfigurationOptions( + [NotNull] string collectionPrefix = "") + : base(collectionPrefix) + { + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj new file mode 100644 index 00000000..344202a2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj @@ -0,0 +1,40 @@ + + + + + + netcoreapp3.1 + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + EasyAbp.EShop.Plugins.StoreApproval.Web + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs new file mode 100644 index 00000000..b4ca5328 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs @@ -0,0 +1,31 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using EasyAbp.EShop.Plugins.StoreApproval.Permissions; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Menus +{ + public class StoreApprovalMenuContributor : IMenuContributor + { + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenu(context); + } + } + + private async Task ConfigureMainMenu(MenuConfigurationContext context) + { + var l = context.GetLocalizer(); + //Add main menu items. + + if (await context.IsGrantedAsync(StoreApprovalPermissions.StoreApplication.Default)) + { + context.Menu.AddItem( + new ApplicationMenuItem("StoreApplication", l["Menu:StoreApplication"], "/StoreApproval/StoreApplications/StoreApplication") + ); + } + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs new file mode 100644 index 00000000..505b82b6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs @@ -0,0 +1,11 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Menus +{ + public class StoreApprovalMenus + { + private const string Prefix = "StoreApproval"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml new file mode 100644 index 00000000..cb63a652 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml @@ -0,0 +1,9 @@ +@page +@using Microsoft.Extensions.Localization +@using EasyAbp.EShop.Plugins.StoreApproval.Localization +@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.IndexModel +@inject IStringLocalizer L +@{ +} +

StoreApproval

+

@L["SamplePageMessage"]

diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs new file mode 100644 index 00000000..82edeb48 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval +{ + public class IndexModel : StoreApprovalPageModel + { + public void OnGet() + { + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml new file mode 100644 index 00000000..ac8353dd --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.EShop.Plugins.StoreApproval.Localization +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs new file mode 100644 index 00000000..316bc9c0 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication +{ + public class CreateModalModel : StoreApprovalPageModel + { + [BindProperty] + public CreateStoreApplicationViewModel ViewModel { get; set; } + + private readonly IStoreApplicationAppService _service; + + public CreateModalModel(IStoreApplicationAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml new file mode 100644 index 00000000..6604d450 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.EShop.Plugins.StoreApproval.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs new file mode 100644 index 00000000..0e2d2251 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs @@ -0,0 +1,39 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication +{ + public class EditModalModel : StoreApprovalPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public EditStoreApplicationViewModel ViewModel { get; set; } + + private readonly IStoreApplicationAppService _service; + + public EditModalModel(IStoreApplicationAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml new file mode 100644 index 00000000..a51241d6 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml @@ -0,0 +1,67 @@ +@page +@using EasyAbp.EShop.Plugins.StoreApproval.Permissions +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication +@using EasyAbp.EShop.Plugins.StoreApproval.Localization +@model IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["StoreApplication"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:StoreApplication"].Value); + PageLayout.Content.MenuItemName = "StoreApplication"; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + @L["StoreApplication"] + + + @if (await Authorization.IsGrantedAsync(StoreApprovalPermissions.StoreApplication.Create)) + { + + } + + + + + + + + @L["Actions"] + @L["StoreApplicationApplicantId"] + @L["StoreApplicationApprovalStatus"] + @L["StoreApplicationStoreName"] + @L["StoreApplicationBusinessCategory"] + @L["StoreApplicationAddress"] + @L["StoreApplicationUnifiedCreditCode"] + @L["StoreApplicationHouseNumber"] + @L["StoreApplicationBusinessLicenseImage"] + @L["StoreApplicationName"] + @L["StoreApplicationIdNumber"] + @L["StoreApplicationIdCardFrontImage"] + @L["StoreApplicationIdCardBackImage"] + @L["StoreApplicationStoreImage"] + @L["StoreApplicationNote"] + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs new file mode 100644 index 00000000..f2f427cc --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs @@ -0,0 +1,12 @@ +using System.Threading.Tasks; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication +{ + public class IndexModel : StoreApprovalPageModel + { + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs new file mode 100644 index 00000000..2487a804 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs @@ -0,0 +1,54 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels +{ + public class CreateStoreApplicationViewModel : EditStoreApplicationViewModel + { + [Display(Name = "StoreApplicationApplicantId")] + public Guid ApplicantId { get; set; } + } + + public class EditStoreApplicationViewModel + { + [Display(Name = "StoreApplicationApplicantId")] + public Guid ApplicantId { get; set; } + + [Display(Name = "StoreApplicationStoreName")] + public string StoreName { get; set; } + + [Display(Name = "StoreApplicationBusinessCategory")] + public string BusinessCategory { get; set; } + + [Display(Name = "StoreApplicationAddress")] + public string Address { get; set; } + + [Display(Name = "StoreApplicationUnifiedCreditCode")] + public string UnifiedCreditCode { get; set; } + + [Display(Name = "StoreApplicationHouseNumber")] + public string HouseNumber { get; set; } + + [Display(Name = "StoreApplicationBusinessLicenseImage")] + public string BusinessLicenseImage { get; set; } + + [Display(Name = "StoreApplicationName")] + public string Name { get; set; } + + [Display(Name = "StoreApplicationIdNumber")] + public string IdNumber { get; set; } + + [Display(Name = "StoreApplicationIdCardFrontImage")] + public string IdCardFrontImage { get; set; } + + [Display(Name = "StoreApplicationIdCardBackImage")] + public string IdCardBackImage { get; set; } + + [Display(Name = "StoreApplicationStoreImage")] + public string StoreImage { get; set; } + + [Display(Name = "StoreApplicationNote")] + public string Note { get; set; } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css new file mode 100644 index 00000000..e69de29b diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js new file mode 100644 index 00000000..922de5e1 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js @@ -0,0 +1,76 @@ +$(function () { + + var l = abp.localization.getResource('StoreApproval'); + + var service = easyAbp.eShop.plugins.storeApproval.storeApplications.storeApplication; + var createModal = new abp.ModalManager(abp.appPath + 'StoreApproval/StoreApplications/StoreApplication/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'StoreApproval/StoreApplications/StoreApplication/EditModal'); + + var dataTable = $('#StoreApplicationTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Edit'), + visible: abp.auth.isGranted('StoreApproval.StoreApplication.Update'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('StoreApproval.StoreApplication.Delete'), + confirmMessage: function (data) { + return l('StoreApplicationDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { data: "applicantId" }, + { data: "approvalStatus" }, + { data: "storeName" }, + { data: "businessCategory" }, + { data: "address" }, + { data: "unifiedCreditCode" }, + { data: "houseNumber" }, + { data: "businessLicenseImage" }, + { data: "name" }, + { data: "idNumber" }, + { data: "idCardFrontImage" }, + { data: "idCardBackImage" }, + { data: "storeImage" }, + { data: "note" }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewStoreApplicationButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml @@ -0,0 +1,4 @@ +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap +@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs new file mode 100644 index 00000000..9ffc9e7f --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs @@ -0,0 +1,16 @@ +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages +{ + /* Inherit your PageModel classes from this class. + */ + public abstract class StoreApprovalPageModel : AbpPageModel + { + protected StoreApprovalPageModel() + { + LocalizationResourceType = typeof(StoreApprovalResource); + ObjectMapperContext = typeof(StoreApprovalWebModule); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json new file mode 100644 index 00000000..610ee0c0 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json @@ -0,0 +1,27 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:5733/", + "sslPort": 44304 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "EasyAbp.EShop.Plugins.StoreApproval.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs new file mode 100644 index 00000000..991d2f47 --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs @@ -0,0 +1,19 @@ +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; +using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web +{ + public class StoreApprovalWebAutoMapperProfile : Profile + { + public StoreApprovalWebAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + CreateMap(); + CreateMap(); + CreateMap(); + } + } +} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs new file mode 100644 index 00000000..005030dc --- /dev/null +++ b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Plugins.StoreApproval.Localization; +using EasyAbp.EShop.Plugins.StoreApproval.Web.Menus; +using Volo.Abp.AspNetCore.Mvc.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.UI.Navigation; +using Volo.Abp.VirtualFileSystem; +using EasyAbp.EShop.Plugins.StoreApproval.Permissions; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Web +{ + [DependsOn( + typeof(StoreApprovalHttpApiModule), + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAutoMapperModule) + )] + public class StoreApprovalWebModule : AbpModule + { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(StoreApprovalResource), typeof(StoreApprovalWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(StoreApprovalWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new StoreApprovalMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj new file mode 100644 index 00000000..36a44182 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs new file mode 100644 index 00000000..29741b2f --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs @@ -0,0 +1,26 @@ +using Shouldly; +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationAppServiceTests : StoreApprovalApplicationTestBase + { + private readonly IStoreApplicationAppService _storeApplicationAppService; + + public StoreApplicationAppServiceTests() + { + _storeApplicationAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs new file mode 100644 index 00000000..ae6ac519 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + /* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ + public abstract class StoreApprovalApplicationTestBase : StoreApprovalTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs new file mode 100644 index 00000000..b69fcdd7 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalApplicationModule), + typeof(StoreApprovalDomainTestModule) + )] + public class StoreApprovalApplicationTestModule : AbpModule + { + + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj new file mode 100644 index 00000000..3f05fd71 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj @@ -0,0 +1,15 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml new file mode 100644 index 00000000..bd7fba1b --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs new file mode 100644 index 00000000..3d63e5f3 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications +{ + public class StoreApplicationDomainTests : StoreApprovalDomainTestBase + { + public StoreApplicationDomainTests() + { + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Assert + + // Assert + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs new file mode 100644 index 00000000..8470fe57 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + /* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ + public abstract class StoreApprovalDomainTestBase : StoreApprovalTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs new file mode 100644 index 00000000..2ac79e91 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs @@ -0,0 +1,17 @@ +using EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + /* Domain tests are configured to use the EF Core provider. + * You can switch to MongoDB, however your domain tests should be + * database independent anyway. + */ + [DependsOn( + typeof(StoreApprovalEntityFrameworkCoreTestModule) + )] + public class StoreApprovalDomainTestModule : AbpModule + { + + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..2b828a1a --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs new file mode 100644 index 00000000..3b432fa7 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; +using Volo.Abp.Domain.Repositories; +using Xunit; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.StoreApplications +{ + public class StoreApplicationRepositoryTests : StoreApprovalEntityFrameworkCoreTestBase + { + private readonly IRepository _storeApplicationRepository; + + public StoreApplicationRepositoryTests() + { + _storeApplicationRepository = GetRequiredService>(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..0246008c --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + /* This class can be used as a base class for EF Core integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class StoreApprovalEntityFrameworkCoreTestBase : StoreApprovalTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..e8ac8d6c --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs @@ -0,0 +1,43 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore.Sqlite; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore +{ + [DependsOn( + typeof(StoreApprovalTestBaseModule), + typeof(StoreApprovalEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] + public class StoreApprovalEntityFrameworkCoreTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var sqliteConnection = CreateDatabaseAndGetConnection(); + + Configure(options => + { + options.Configure(abpDbContextConfigurationContext => + { + abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); + }); + }); + } + + private static SqliteConnection CreateDatabaseAndGetConnection() + { + var connection = new SqliteConnection("Data Source=:memory:"); + connection.Open(); + + new StoreApprovalDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 00000000..bd7fba1b --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..e6c31760 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,154 @@ +using System; +using System.Net.Http; +using System.Threading.Tasks; +using IdentityModel.Client; +using Microsoft.Extensions.Configuration; +using Volo.Abp.DependencyInjection; +using Volo.Abp.IdentityModel; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public class ClientDemoService : ITransientDependency + { + private readonly IIdentityModelAuthenticationService _authenticationService; + private readonly IConfiguration _configuration; + + public ClientDemoService( + IIdentityModelAuthenticationService authenticationService, + IConfiguration configuration) + { + _authenticationService = authenticationService; + _configuration = configuration; + } + + public async Task RunAsync() + { + await TestWithDynamicProxiesAsync(); + await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); + await TestAllManuallyAsync(); + } + + /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy + * feature. It is just simple as calling a local service method. + * Authorization and HTTP request details are handled by the ABP framework. + */ + private Task TestWithDynamicProxiesAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); + + return Task.CompletedTask; + + //var result = await _sampleAppService.GetAsync(); + //Console.WriteLine("Result: " + result.Value); + + //result = await _sampleAppService.GetAuthorizedAsync(); + //Console.WriteLine("Result (authorized): " + result.Value); + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. + */ + private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); + + //Get access token using ABP's IIdentityModelAuthenticationService + + var accessToken = await _authenticationService.GetAccessTokenAsync( + new IdentityClientConfiguration( + _configuration["IdentityClients:Default:Authority"], + _configuration["IdentityClients:Default:Scope"], + _configuration["IdentityClients:Default:ClientId"], + _configuration["IdentityClients:Default:ClientSecret"], + _configuration["IdentityClients:Default:GrantType"], + _configuration["IdentityClients:Default:UserName"], + _configuration["IdentityClients:Default:UserPassword"] + ) + ); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(accessToken); + + var url = _configuration["RemoteServices:StoreApproval:BaseUrl"] + + "api/StoreApproval/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + + /* Shows how to use HttpClient to perform a request to the HTTP API. + * It obtains access token using IdentityServer's API. See its documentation: + * https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html + */ + private async Task TestAllManuallyAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); + + //Obtain access token from the IDS4 server + + // discover endpoints from metadata + var client = new HttpClient(); + var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); + if (disco.IsError) + { + Console.WriteLine(disco.Error); + return; + } + + // request token + var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest + { + Address = disco.TokenEndpoint, + ClientId = _configuration["IdentityClients:Default:ClientId"], + ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], + UserName = _configuration["IdentityClients:Default:UserName"], + Password = _configuration["IdentityClients:Default:UserPassword"], + Scope = _configuration["IdentityClients:Default:Scope"] + }); + + if (tokenResponse.IsError) + { + Console.WriteLine(tokenResponse.Error); + return; + } + + Console.WriteLine(tokenResponse.Json); + + //Perform the actual HTTP request + + using (var httpClient = new HttpClient()) + { + httpClient.SetBearerToken(tokenResponse.AccessToken); + + var url = _configuration["RemoteServices:StoreApproval:BaseUrl"] + + "api/StoreApproval/sample/authorized"; + + var responseMessage = await httpClient.GetAsync(url); + if (responseMessage.IsSuccessStatusCode) + { + var responseString = await responseMessage.Content.ReadAsStringAsync(); + Console.WriteLine("Result: " + responseString); + } + else + { + throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); + } + } + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..cd95e937 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp +{ + public class ConsoleTestAppHostedService : IHostedService + { + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = AbpApplicationFactory.Create()) + { + application.Initialize(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + application.Shutdown(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..8d97fa66 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,26 @@ + + + + Exe + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + + PreserveNewest + Always + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..24e88dd5 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,21 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp +{ + class Program + { + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs new file mode 100644 index 00000000..850afaeb --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs @@ -0,0 +1,14 @@ +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(StoreApprovalHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] + public class StoreApprovalConsoleApiClientModule : AbpModule + { + + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..a505774e --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44339/" + }, + "StoreApproval": { + "BaseUrl": "https://localhost:44383/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "StoreApproval_ConsoleTestApp", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44339/", + "Scope": "StoreApproval" + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj new file mode 100644 index 00000000..2c28533c --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj @@ -0,0 +1,17 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml new file mode 100644 index 00000000..bd7fba1b --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs new file mode 100644 index 00000000..844fedd6 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -0,0 +1,22 @@ +using System; +using Mongo2Go; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + public class MongoDbFixture : IDisposable + { + private static readonly MongoDbRunner MongoDbRunner; + public static readonly string ConnectionString; + + static MongoDbFixture() + { + MongoDbRunner = MongoDbRunner.Start(); + ConnectionString = MongoDbRunner.ConnectionString; + } + + public void Dispose() + { + MongoDbRunner?.Dispose(); + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs new file mode 100644 index 00000000..a9c4161e --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs @@ -0,0 +1,10 @@ +using Xunit; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + [CollectionDefinition(Name)] + public class MongoTestCollection : ICollectionFixture + { + public const string Name = "MongoDB Collection"; + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs new file mode 100644 index 00000000..2a4ac974 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + /* This class can be used as a base class for MongoDB integration tests, + * while SampleRepository_Tests uses a different approach. + */ + public abstract class StoreApprovalMongoDbTestBase : StoreApprovalTestBase + { + + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs new file mode 100644 index 00000000..a44846e4 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs @@ -0,0 +1,25 @@ +using System; +using Volo.Abp.Data; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB +{ + [DependsOn( + typeof(StoreApprovalTestBaseModule), + typeof(StoreApprovalMongoDbModule) + )] + public class StoreApprovalMongoDbTestModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N"); + + Configure(options => + { + options.ConnectionStrings.Default = connectionString; + }); + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj new file mode 100644 index 00000000..506c5a91 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj @@ -0,0 +1,23 @@ + + + + + + netcoreapp3.1 + EasyAbp.EShop.Plugins.StoreApproval + + + + + + + + + + + + + + + + diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml new file mode 100644 index 00000000..bd7fba1b --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..8d7534f3 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,43 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EasyAbp.EShop.Plugins.StoreApproval.Security +{ + [Dependency(ReplaceServices = true)] + public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor + { + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal _principal; + + private ClaimsPrincipal GetPrincipal() + { + if (_principal == null) + { + lock (this) + { + if (_principal == null) + { + _principal = new ClaimsPrincipal( + new ClaimsIdentity( + new List + { + new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), + new Claim(AbpClaimTypes.UserName,"admin"), + new Claim(AbpClaimTypes.Email,"admin@abp.io") + } + ) + ); + } + } + } + + return _principal; + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs new file mode 100644 index 00000000..47ddeb77 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs @@ -0,0 +1,27 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + public class StoreApprovalDataSeedContributor : IDataSeedContributor, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + + public StoreApprovalDataSeedContributor( + IGuidGenerator guidGenerator) + { + _guidGenerator = guidGenerator; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + return Task.CompletedTask; + } + } +} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs new file mode 100644 index 00000000..e2861157 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs @@ -0,0 +1,60 @@ +using System; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; +using Volo.Abp.Testing; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + /* All test classes are derived from this class, directly or indirectly. */ + public abstract class StoreApprovalTestBase : AbpIntegratedTest + where TStartupModule : IAbpModule + { + protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) + { + options.UseAutofac(); + } + + protected virtual Task WithUnitOfWorkAsync(Func func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + await action(); + + await uow.CompleteAsync(); + } + } + } + + protected virtual Task WithUnitOfWorkAsync(Func> func) + { + return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); + } + + protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) + { + using (var scope = ServiceProvider.CreateScope()) + { + var uowManager = scope.ServiceProvider.GetRequiredService(); + + using (var uow = uowManager.Begin(options)) + { + var result = await func(); + await uow.CompleteAsync(); + return result; + } + } + } + } +} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs new file mode 100644 index 00000000..82e41262 --- /dev/null +++ b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs @@ -0,0 +1,42 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.Authorization; +using Volo.Abp.Autofac; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Threading; + +namespace EasyAbp.EShop.Plugins.StoreApproval +{ + [DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(StoreApprovalDomainModule) + )] + public class StoreApprovalTestBaseModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysAllowAuthorization(); + } + + public override void OnApplicationInitialization(ApplicationInitializationContext context) + { + SeedTestData(context); + } + + private static void SeedTestData(ApplicationInitializationContext context) + { + AsyncHelper.RunSync(async () => + { + using (var scope = context.ServiceProvider.CreateScope()) + { + await scope.ServiceProvider + .GetRequiredService() + .SeedAsync(); + } + }); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj index 105795fc..d13ecac9 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application.Contracts/EShopSample.Application.Contracts.csproj @@ -16,12 +16,12 @@ - - - - - - + + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj index 2bbb5c1f..516c26df 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj @@ -17,11 +17,11 @@ - - - - - + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj index d31831c4..215f4e96 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj @@ -19,14 +19,14 @@
- + - + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj index 1e97397c..f7027a6e 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain.Shared/EShopSample.Domain.Shared.csproj @@ -11,14 +11,14 @@ - - - - - - - - + + + + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj index 48305783..5a54b2c0 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj @@ -17,15 +17,15 @@ - - - - - - - - - + + + + + + + + +
diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj index 2d064f25..a5300360 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj @@ -13,15 +13,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj index d26b7316..bf0000d1 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi.Client/EShopSample.HttpApi.Client.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj index 39e95391..6e525a93 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj @@ -16,11 +16,11 @@ - - - - - + + + + + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj index 4be93c09..95ffa914 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj @@ -48,14 +48,14 @@ - - - - - - - - + + + + + + + +
diff --git a/samples/EShopSample/aspnet-core/test/EShopSample.HttpApi.Client.ConsoleTestApp/EShopSample.HttpApi.Client.ConsoleTestApp.csproj b/samples/EShopSample/aspnet-core/test/EShopSample.HttpApi.Client.ConsoleTestApp/EShopSample.HttpApi.Client.ConsoleTestApp.csproj index 6b93e56b..f1b0c069 100644 --- a/samples/EShopSample/aspnet-core/test/EShopSample.HttpApi.Client.ConsoleTestApp/EShopSample.HttpApi.Client.ConsoleTestApp.csproj +++ b/samples/EShopSample/aspnet-core/test/EShopSample.HttpApi.Client.ConsoleTestApp/EShopSample.HttpApi.Client.ConsoleTestApp.csproj @@ -17,7 +17,7 @@
- + diff --git a/samples/EShopSample/aspnet-core/test/EShopSample.TestBase/EShopSample.TestBase.csproj b/samples/EShopSample/aspnet-core/test/EShopSample.TestBase/EShopSample.TestBase.csproj index 1b249c49..5d4c9e2b 100644 --- a/samples/EShopSample/aspnet-core/test/EShopSample.TestBase/EShopSample.TestBase.csproj +++ b/samples/EShopSample/aspnet-core/test/EShopSample.TestBase/EShopSample.TestBase.csproj @@ -8,9 +8,9 @@ - - - + + + diff --git a/samples/EShopSample/aspnet-core/test/EShopSample.Web.Tests/EShopSample.Web.Tests.csproj b/samples/EShopSample/aspnet-core/test/EShopSample.Web.Tests/EShopSample.Web.Tests.csproj index fbcb9041..6d023827 100644 --- a/samples/EShopSample/aspnet-core/test/EShopSample.Web.Tests/EShopSample.Web.Tests.csproj +++ b/samples/EShopSample/aspnet-core/test/EShopSample.Web.Tests/EShopSample.Web.Tests.csproj @@ -17,7 +17,7 @@ - +
From 5ffbe8c5fa520d3971629448c6d5f1276abcde71 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Mon, 3 Aug 2020 19:17:46 +0800 Subject: [PATCH 02/24] Remove plugins --- plugins/ProductTag/.gitattributes | 1 - plugins/ProductTag/.gitignore | 258 ------------------ .../EasyAbp.EShop.Plugins.ProductTag.sln | 139 ---------- ...p.EShop.Plugins.ProductTag.sln.DotSettings | 23 -- plugins/ProductTag/common.props | 30 -- .../ProductTag/docker-compose.migrations.yml | 13 - .../ProductTag/docker-compose.override.yml | 29 -- plugins/ProductTag/docker-compose.yml | 25 -- ...Shop.Plugins.ProductTag.Host.Shared.csproj | 10 - .../MultiTenancy/MultiTenancyConsts.cs | 10 - ...ns.ProductTag.Application.Contracts.csproj | 20 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTagPermissionDefinitionProvider.cs | 24 -- .../Permissions/ProductTagPermissions.cs | 22 -- .../ProductTagApplicationContractsModule.cs | 18 -- .../Dtos/CreateUpdateProductTagsDto.cs | 15 - .../ProductTags/Dtos/GetProductTagListDto.cs | 15 - .../ProductTags/Dtos/ProductTagDto.cs | 14 - .../ProductTags/Dtos/UpdateProductTagDto.cs | 14 - .../ProductTags/IProductTagAppService.cs | 17 -- .../Tags/Dtos/CreateUpdateTagDto.cs | 30 -- .../Tags/Dtos/GetTagListDto.cs | 15 - .../Tags/Dtos/TagDto.cs | 26 -- .../Tags/ITagAppService.cs | 15 - ...Shop.Plugins.ProductTag.Application.csproj | 20 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTagAppService.cs | 14 - .../ProductTagApplicationAutoMapperProfile.cs | 25 -- .../ProductTagApplicationModule.cs | 27 -- .../ProductTags/ProductTagAppService.cs | 130 --------- .../Tags/TagAppService.cs | 110 -------- ...op.Plugins.ProductTag.Domain.Shared.csproj | 24 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../Localization/ProductTag/cs.json | 21 -- .../Localization/ProductTag/en.json | 22 -- .../Localization/ProductTag/pl-PL.json | 20 -- .../Localization/ProductTag/pt-BR.json | 20 -- .../Localization/ProductTag/sl.json | 21 -- .../Localization/ProductTag/tr.json | 22 -- .../Localization/ProductTag/vi.json | 20 -- .../Localization/ProductTag/zh-Hans.json | 21 -- .../Localization/ProductTag/zh-Hant.json | 21 -- .../Localization/ProductTagResource.cs | 10 - .../ProductTagDomainSharedModule.cs | 37 --- .../ProductTagErrorCodes.cs | 7 - ...Abp.EShop.Plugins.ProductTag.Domain.csproj | 17 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTagDbProperties.cs | 11 - .../ProductTagDomainModule.cs | 16 -- .../ProductTags/IProductTagRepository.cs | 15 - .../ProductTags/ProductTags.cs | 37 --- .../ProductTagSettingDefinitionProvider.cs | 14 - .../Settings/ProductTagSettings.cs | 11 - .../Tags/ITagRepository.cs | 13 - .../Tags/Tag.cs | 67 ----- ...gins.ProductTag.EntityFrameworkCore.csproj | 16 -- .../IProductTagDbContext.cs | 17 -- .../ProductTagDbContext.cs | 31 --- ...ductTagDbContextModelCreatingExtensions.cs | 66 ----- .../ProductTagEntityFrameworkCoreModule.cs | 29 -- ...ductTagModelBuilderConfigurationOptions.cs | 18 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTags/ProductTagRepository.cs | 43 --- .../Tags/TagRepository.cs | 32 --- ...p.Plugins.ProductTag.HttpApi.Client.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTagHttpApiClientModule.cs | 22 -- ...bp.EShop.Plugins.ProductTag.HttpApi.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ProductTagBaseController.cs | 13 - .../ProductTagHttpApiModule.cs | 33 --- .../ProductTags/ProductTagController.cs | 48 ---- .../Tags/TagController.cs | 54 ---- ...bp.EShop.Plugins.ProductTag.MongoDB.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../MongoDB/IProductTagMongoDbContext.cs | 13 - .../MongoDB/ProductTagMongoDbContext.cs | 20 -- .../ProductTagMongoDbContextExtensions.cs | 22 -- .../MongoDB/ProductTagMongoDbModule.cs | 23 -- ...agMongoModelBuilderConfigurationOptions.cs | 14 - ...asyAbp.EShop.Plugins.ProductTag.Web.csproj | 47 ---- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../Menus/ProductTagMenuContributor.cs | 39 --- .../Menus/ProductTagMenus.cs | 13 - .../EShop/Products/ProductTag/Index.cshtml | 9 - .../EShop/Products/ProductTag/Index.cshtml.cs | 9 - .../Products/ProductTag/_ViewImports.cshtml | 4 - .../Products/Tags/Tag/CreateModal.cshtml | 18 -- .../Products/Tags/Tag/CreateModal.cshtml.cs | 26 -- .../EShop/Products/Tags/Tag/EditModal.cshtml | 19 -- .../Products/Tags/Tag/EditModal.cshtml.cs | 37 --- .../EShop/Products/Tags/Tag/Index.cshtml | 61 ----- .../EShop/Products/Tags/Tag/Index.cshtml.cs | 51 ---- .../Pages/EShop/Products/Tags/Tag/index.css | 0 .../Pages/EShop/Products/Tags/Tag/index.js | 80 ------ .../Pages/ProductTagPageModel.cs | 16 -- .../ProductTagWebAutoMapperProfile.cs | 18 -- .../ProductTagWebModule.cs | 58 ---- .../Properties/launchSettings.json | 27 -- ...lugins.ProductTag.Application.Tests.csproj | 16 -- .../ProductTagApplicationTestBase.cs | 10 - .../ProductTagApplicationTestModule.cs | 13 - .../Samples/SampleAppService_Tests.cs | 30 -- ...hop.Plugins.ProductTag.Domain.Tests.csproj | 15 - .../ProductTagDomainTestBase.cs | 10 - .../ProductTagDomainTestModule.cs | 17 -- .../Samples/SampleManager_Tests.cs | 21 -- ...roductTag.EntityFrameworkCore.Tests.csproj | 18 -- .../ProductTagEntityFrameworkCoreTestBase.cs | 10 - ...ProductTagEntityFrameworkCoreTestModule.cs | 43 --- .../Samples/SampleRepository_Tests.cs | 12 - .../ClientDemoService.cs | 156 ----------- .../ConsoleTestAppHostedService.cs | 26 -- ...ctTag.HttpApi.Client.ConsoleTestApp.csproj | 26 -- .../ProductTagConsoleApiClientModule.cs | 14 - .../Program.cs | 21 -- .../appsettings.json | 21 -- ...op.Plugins.ProductTag.MongoDB.Tests.csproj | 17 -- .../MongoDB/MongoDbFixture.cs | 22 -- .../MongoDB/MongoTestCollection.cs | 10 - .../MongoDB/ProductTagMongoDbTestBase.cs | 10 - .../MongoDB/ProductTagMongoDbTestModule.cs | 25 -- .../MongoDB/Samples/SampleRepository_Tests.cs | 14 - ...p.EShop.Plugins.ProductTag.TestBase.csproj | 23 -- .../ProductTagDataSeedContributor.cs | 27 -- .../ProductTagTestBase.cs | 60 ---- .../ProductTagTestBaseModule.cs | 42 --- .../Samples/SampleRepository_Tests.cs | 27 -- .../Security/FakeCurrentPrincipalAccessor.cs | 43 --- plugins/StoreApproval/.gitattributes | 1 - plugins/StoreApproval/.gitignore | 258 ------------------ .../EasyAbp.EShop.Plugins.StoreApproval.sln | 144 ---------- ...Shop.Plugins.StoreApproval.sln.DotSettings | 25 -- plugins/StoreApproval/common.props | 30 -- .../docker-compose.migrations.yml | 13 - .../StoreApproval/docker-compose.override.yml | 29 -- plugins/StoreApproval/docker-compose.yml | 25 -- ...p.Plugins.StoreApproval.Host.Shared.csproj | 10 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../MultiTenancy/MultiTenancyConsts.cs | 10 - ...StoreApproval.Application.Contracts.csproj | 16 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- ...oreApprovalPermissionDefinitionProvider.cs | 25 -- .../Permissions/StoreApprovalPermissions.cs | 23 -- .../Dtos/CreateUpdateStoreApplicationDto.cs | 64 ----- .../Dtos/GetStoreApplicationListDto.cs | 20 -- .../Dtos/StoreApplicationDto.cs | 37 --- .../IStoreApplicationAppService.cs | 22 -- ...StoreApprovalApplicationContractsModule.cs | 16 -- ...p.Plugins.StoreApproval.Application.csproj | 17 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApplicationAppService.cs | 118 -------- .../StoreApprovalAppService.cs | 14 - ...oreApprovalApplicationAutoMapperProfile.cs | 19 -- .../StoreApprovalApplicationModule.cs | 25 -- ...Plugins.StoreApproval.Domain.Shared.csproj | 24 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../Localization/StoreApproval/cs.json | 31 --- .../Localization/StoreApproval/en.json | 32 --- .../Localization/StoreApproval/pl-PL.json | 30 -- .../Localization/StoreApproval/pt-BR.json | 30 -- .../Localization/StoreApproval/sl.json | 31 --- .../Localization/StoreApproval/tr.json | 32 --- .../Localization/StoreApproval/vi.json | 30 -- .../Localization/StoreApproval/zh-Hans.json | 31 --- .../Localization/StoreApproval/zh-Hant.json | 31 --- .../Localization/StoreApprovalResource.cs | 10 - .../StoreApplications/ApprovalStatusType.cs | 13 - .../StoreApplicationConsts.cs | 13 - .../StoreApprovalDomainSharedModule.cs | 37 --- .../StoreApprovalErrorCodes.cs | 11 - ....EShop.Plugins.StoreApproval.Domain.csproj | 17 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApprovalSettingDefinitionProvider.cs | 14 - .../Settings/StoreApprovalSettings.cs | 11 - .../IStoreApplicationRepository.cs | 9 - .../StoreApplications/StoreApplication.cs | 129 --------- ...toreApplicationAlreadyApprovedException.cs | 13 - ...oreApplicationAlreadySubmittedException.cs | 13 - .../StoreApplicationNotSubmittedException.cs | 13 - .../StoreApplicationUpdatedEventHandler.cs | 65 ----- .../StoreApprovalDbProperties.cs | 11 - .../StoreApprovalDomainModule.cs | 12 - ...s.StoreApproval.EntityFrameworkCore.csproj | 15 - .../IStoreApprovalDbContext.cs | 16 -- .../StoreApprovalDbContext.cs | 29 -- ...pprovalDbContextModelCreatingExtensions.cs | 54 ---- .../StoreApprovalEntityFrameworkCoreModule.cs | 26 -- ...pprovalModelBuilderConfigurationOptions.cs | 18 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../EfCoreStoreApplicationRepository.cs | 14 - ...lugins.StoreApproval.HttpApi.Client.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApprovalHttpApiClientModule.cs | 22 -- ...EShop.Plugins.StoreApproval.HttpApi.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApplicationController.cs | 75 ----- .../StoreApprovalController.cs | 13 - .../StoreApprovalHttpApiModule.cs | 33 --- ...EShop.Plugins.StoreApproval.MongoDB.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../MongoDB/IStoreApprovalMongoDbContext.cs | 13 - .../MongoDB/StoreApprovalMongoDbContext.cs | 20 -- .../StoreApprovalMongoDbContextExtensions.cs | 22 -- .../MongoDB/StoreApprovalMongoDbModule.cs | 23 -- ...alMongoModelBuilderConfigurationOptions.cs | 14 - ...Abp.EShop.Plugins.StoreApproval.Web.csproj | 40 --- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../Menus/StoreApprovalMenuContributor.cs | 31 --- .../Menus/StoreApprovalMenus.cs | 11 - .../Pages/StoreApproval/Index.cshtml | 9 - .../Pages/StoreApproval/Index.cshtml.cs | 9 - .../StoreApplication/CreateModal.cshtml | 18 -- .../StoreApplication/CreateModal.cshtml.cs | 28 -- .../StoreApplication/EditModal.cshtml | 19 -- .../StoreApplication/EditModal.cshtml.cs | 39 --- .../StoreApplication/Index.cshtml | 67 ----- .../StoreApplication/Index.cshtml.cs | 12 - .../CreateEditStoreApplicationViewModel.cs | 54 ---- .../StoreApplication/index.css | 0 .../StoreApplication/index.js | 76 ------ .../Pages/StoreApproval/_ViewImports.cshtml | 4 - .../Pages/StoreApprovalPageModel.cs | 16 -- .../Properties/launchSettings.json | 27 -- .../StoreApprovalWebAutoMapperProfile.cs | 19 -- .../StoreApprovalWebModule.cs | 59 ---- ...ins.StoreApproval.Application.Tests.csproj | 16 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApplicationAppServiceTests.cs | 26 -- .../StoreApprovalApplicationTestBase.cs | 10 - .../StoreApprovalApplicationTestModule.cs | 13 - ....Plugins.StoreApproval.Domain.Tests.csproj | 15 - .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../StoreApplicationDomainTests.cs | 23 -- .../StoreApprovalDomainTestBase.cs | 10 - .../StoreApprovalDomainTestModule.cs | 17 -- ...eApproval.EntityFrameworkCore.Tests.csproj | 18 -- .../StoreApplicationRepositoryTests.cs | 31 --- ...toreApprovalEntityFrameworkCoreTestBase.cs | 10 - ...reApprovalEntityFrameworkCoreTestModule.cs | 43 --- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../ClientDemoService.cs | 154 ----------- .../ConsoleTestAppHostedService.cs | 26 -- ...roval.HttpApi.Client.ConsoleTestApp.csproj | 26 -- .../Program.cs | 21 -- .../StoreApprovalConsoleApiClientModule.cs | 14 - .../appsettings.json | 21 -- ...Plugins.StoreApproval.MongoDB.Tests.csproj | 17 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../MongoDB/MongoDbFixture.cs | 22 -- .../MongoDB/MongoTestCollection.cs | 10 - .../MongoDB/StoreApprovalMongoDbTestBase.cs | 10 - .../MongoDB/StoreApprovalMongoDbTestModule.cs | 25 -- ...Shop.Plugins.StoreApproval.TestBase.csproj | 23 -- .../FodyWeavers.xml | 3 - .../FodyWeavers.xsd | 30 -- .../Security/FakeCurrentPrincipalAccessor.cs | 43 --- .../StoreApprovalDataSeedContributor.cs | 27 -- .../StoreApprovalTestBase.cs | 60 ---- .../StoreApprovalTestBaseModule.cs | 42 --- 283 files changed, 7675 deletions(-) delete mode 100644 plugins/ProductTag/.gitattributes delete mode 100644 plugins/ProductTag/.gitignore delete mode 100644 plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln delete mode 100644 plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings delete mode 100644 plugins/ProductTag/common.props delete mode 100644 plugins/ProductTag/docker-compose.migrations.yml delete mode 100644 plugins/ProductTag/docker-compose.override.yml delete mode 100644 plugins/ProductTag/docker-compose.yml delete mode 100644 plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj delete mode 100644 plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs delete mode 100644 plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs delete mode 100644 plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs delete mode 100644 plugins/StoreApproval/.gitattributes delete mode 100644 plugins/StoreApproval/.gitignore delete mode 100644 plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln delete mode 100644 plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings delete mode 100644 plugins/StoreApproval/common.props delete mode 100644 plugins/StoreApproval/docker-compose.migrations.yml delete mode 100644 plugins/StoreApproval/docker-compose.override.yml delete mode 100644 plugins/StoreApproval/docker-compose.yml delete mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj delete mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs delete mode 100644 plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs delete mode 100644 plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs diff --git a/plugins/ProductTag/.gitattributes b/plugins/ProductTag/.gitattributes deleted file mode 100644 index c941e526..00000000 --- a/plugins/ProductTag/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -**/wwwroot/libs/** linguist-vendored diff --git a/plugins/ProductTag/.gitignore b/plugins/ProductTag/.gitignore deleted file mode 100644 index 666ef8a0..00000000 --- a/plugins/ProductTag/.gitignore +++ /dev/null @@ -1,258 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# ProductTag -host/EasyAbp.EShop.Plugins.ProductTag.IdentityServer/Logs/logs.txt -host/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Host/Logs/logs.txt -host/EasyAbp.EShop.Plugins.ProductTag.Web.Host/Logs/logs.txt -host/EasyAbp.EShop.Plugins.ProductTag.Web.Unified/Logs/logs.txt diff --git a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln deleted file mode 100644 index b43e8329..00000000 --- a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln +++ /dev/null @@ -1,139 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29001.49 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain.Shared", "src\EasyAbp.EShop.Plugins.ProductTag.Domain.Shared\EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain", "src\EasyAbp.EShop.Plugins.ProductTag.Domain\EasyAbp.EShop.Plugins.ProductTag.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application.Contracts", "src\EasyAbp.EShop.Plugins.ProductTag.Application.Contracts\EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application", "src\EasyAbp.EShop.Plugins.ProductTag.Application\EasyAbp.EShop.Plugins.ProductTag.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.MongoDB", "src\EasyAbp.EShop.Plugins.ProductTag.MongoDB\EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi", "src\EasyAbp.EShop.Plugins.ProductTag.HttpApi\EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client", "src\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.TestBase", "test\EasyAbp.EShop.Plugins.ProductTag.TestBase\EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests\EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Domain.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.Domain.Tests\EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Application.Tests", "test\EasyAbp.EShop.Plugins.ProductTag.Application.Tests\EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Web", "src\EasyAbp.EShop.Plugins.ProductTag.Web\EasyAbp.EShop.Plugins.ProductTag.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.ProductTag.Host.Shared", "host\EasyAbp.EShop.Plugins.ProductTag.Host.Shared\EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} - EndGlobalSection -EndGlobal diff --git a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings b/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings deleted file mode 100644 index cb0b2c91..00000000 --- a/plugins/ProductTag/EasyAbp.EShop.Plugins.ProductTag.sln.DotSettings +++ /dev/null @@ -1,23 +0,0 @@ - - True - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - Required - Required - Required - Required - False - True - False - False - True - False - False - SQL - \ No newline at end of file diff --git a/plugins/ProductTag/common.props b/plugins/ProductTag/common.props deleted file mode 100644 index d9519ad8..00000000 --- a/plugins/ProductTag/common.props +++ /dev/null @@ -1,30 +0,0 @@ - - - latest - 0.1.0 - $(NoWarn);CS1591 - module - true - EasyAbp Team - An abp application module group that provides basic e-shop service. - https://avatars3.githubusercontent.com/u/58311641?s=128 - https://github.com/EasyAbp/EShop - https://github.com/EasyAbp/EShop - abp module easyabp EShop shopping shop ordering product payment store mall - EasyAbp - MIT - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - \ No newline at end of file diff --git a/plugins/ProductTag/docker-compose.migrations.yml b/plugins/ProductTag/docker-compose.migrations.yml deleted file mode 100644 index 5e7c2ed1..00000000 --- a/plugins/ProductTag/docker-compose.migrations.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '3.4' - -services: - migrations: - build: - context: ../../ - dockerfile: templates/service/database/Dockerfile - depends_on: - - sqlserver - environment: - - IdentityServer_DB=ProductTag_Identity - - ProductTag_DB=ProductTag_ModuleDb - - SA_PASSWORD=yourStrong(!)Password diff --git a/plugins/ProductTag/docker-compose.override.yml b/plugins/ProductTag/docker-compose.override.yml deleted file mode 100644 index d5d2a0e4..00000000 --- a/plugins/ProductTag/docker-compose.override.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3.4' - -services: - sqlserver: - environment: - - SA_PASSWORD=yourStrong(!)Password - - ACCEPT_EULA=Y - ports: - - "51599:1433" - - identity-server: - environment: - - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionStrings__Default=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=ProductTag_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - ports: - - "51600:80" - - product-tag: - environment: - - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionStrings__Default=Server=sqlserver;Database=ProductTag_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=ProductTag_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=ProductTag_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - AuthServer__Authority=http://identity-server - ports: - - "51601:80" \ No newline at end of file diff --git a/plugins/ProductTag/docker-compose.yml b/plugins/ProductTag/docker-compose.yml deleted file mode 100644 index 54ef5f29..00000000 --- a/plugins/ProductTag/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '3.4' - -services: - sqlserver: - image: mcr.microsoft.com/mssql/server - volumes: - - dbdata:/var/opt/mssql - - identity-server: - build: - context: ../../ - dockerfile: templates/service/host/IdentityServerHost/Dockerfile - depends_on: - - sqlserver - - product-tag: - build: - context: ../../ - dockerfile: templates/service/host/EasyAbp.EShop.Plugins.ProductTag.Host/Dockerfile - depends_on: - - sqlserver - - identity-server - -volumes: - dbdata: \ No newline at end of file diff --git a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj deleted file mode 100644 index d469bb9b..00000000 --- a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/EasyAbp.EShop.Plugins.ProductTag.Host.Shared.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - diff --git a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs deleted file mode 100644 index 4e271474..00000000 --- a/plugins/ProductTag/host/EasyAbp.EShop.Plugins.ProductTag.Host.Shared/MultiTenancy/MultiTenancyConsts.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.MultiTenancy -{ - public static class MultiTenancyConsts - { - /* Enable/disable multi-tenancy in a single point - * to test your module with multi-tenancy. - */ - public const bool IsEnabled = false; - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj deleted file mode 100644 index b953a1d8..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs deleted file mode 100644 index 2bcbcb33..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissionDefinitionProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Localization; - -namespace EasyAbp.EShop.Plugins.ProductTag.Permissions -{ - public class ProductTagPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var moduleGroup = context.AddGroup(ProductTagPermissions.GroupName, L("Permission:ProductTag")); - - var tags = moduleGroup.AddPermission(ProductTagPermissions.Tags.Default, L("Permission:Tag")); - tags.AddChild(ProductTagPermissions.Tags.Create, L("Permission:Create")); - tags.AddChild(ProductTagPermissions.Tags.Update, L("Permission:Update")); - tags.AddChild(ProductTagPermissions.Tags.Delete, L("Permission:Delete")); - } - - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs deleted file mode 100644 index ed8496ec..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Permissions/ProductTagPermissions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Volo.Abp.Reflection; - -namespace EasyAbp.EShop.Plugins.ProductTag.Permissions -{ - public class ProductTagPermissions - { - public const string GroupName = "EasyAbp.EShop.ProductTag"; - - public class Tags - { - public const string Default = GroupName + ".Tag"; - public const string Delete = Default + ".Delete"; - public const string Update = Default + ".Update"; - public const string Create = Default + ".Create"; - } - - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(ProductTagPermissions)); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs deleted file mode 100644 index 95a8ca02..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTagApplicationContractsModule.cs +++ /dev/null @@ -1,18 +0,0 @@ -using EasyAbp.EShop.Stores; -using Volo.Abp.Application; -using Volo.Abp.Modularity; -using Volo.Abp.Authorization; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagDomainSharedModule), - typeof(AbpDddApplicationContractsModule), - typeof(AbpAuthorizationModule), - typeof(EShopStoresDomainSharedModule) - )] - public class ProductTagApplicationContractsModule : AbpModule - { - - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs deleted file mode 100644 index 323f2e33..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/CreateUpdateProductTagsDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using Volo.Abp.ObjectExtending; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos -{ - public class CreateUpdateProductTagsDto : ExtensibleObject - { - public Guid StoreId { get; set; } - - public Guid ProductId { get; set; } - - public List TagIds { get; set; } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs deleted file mode 100644 index 00c63de1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/GetProductTagListDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using EasyAbp.EShop.Stores.Stores; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos -{ - public class GetProductTagListDto : PagedAndSortedResultRequestDto, IMultiStore - { - public Guid StoreId { get; set; } - - public Guid? TagId { get; set; } - - public Guid? ProductId { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs deleted file mode 100644 index 8083a1d2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/ProductTagDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos -{ - public class ProductTagDto : ExtensibleAuditedEntityDto - { - public Guid TagId { get; set; } - - public Guid ProductId { get; set; } - - public int DisplayOrder { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs deleted file mode 100644 index 194760d0..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/Dtos/UpdateProductTagDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos -{ - public class UpdateProductTagDto : ExtensibleEntityDto - { - public Guid TagId { get; set; } - - public Guid ProductId { get; set; } - - public int DisplayOrder { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs deleted file mode 100644 index 360a5bbc..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/ProductTags/IProductTagAppService.cs +++ /dev/null @@ -1,17 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - public interface IProductTagAppService : - IReadOnlyAppService< - ProductTagDto, - Guid, - GetProductTagListDto>, - IUpdateAppService - { - Task UpdateAsync(CreateUpdateProductTagsDto input); - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs deleted file mode 100644 index cb5ea626..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/CreateUpdateTagDto.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos -{ - public class UpdateTagDto : ExtensibleEntityDto - { - [DisplayName("TagParentId")] - public Guid? ParentId { get; set; } - - [Required] - [DisplayName("TagDisplayName")] - public string DisplayName { get; set; } - - [DisplayName("TagDescription")] - public string Description { get; set; } - - [DisplayName("TagMediaResources")] - public string MediaResources { get; set; } - } - - public class CreateTagDto : UpdateTagDto - { - [Required] - [DisplayName("TagStoreId")] - public Guid StoreId { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs deleted file mode 100644 index 6b397a7f..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/GetTagListDto.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using EasyAbp.EShop.Stores.Stores; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos -{ - public class GetTagListDto : PagedAndSortedResultRequestDto, IMultiStore - { - [Required] - public Guid StoreId { get; set; } - - public bool ShowHidden { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs deleted file mode 100644 index 934179e1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/Dtos/TagDto.cs +++ /dev/null @@ -1,26 +0,0 @@ -using EasyAbp.EShop.Stores.Stores; -using System; -using System.Collections.Generic; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos -{ - public class TagDto : ExtensibleFullAuditedEntityDto, IMultiStore - { - public Guid StoreId { get; set; } - - public Guid? ParentId { get; set; } - - public string Code { get; set; } - - public int Level { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } - - public string MediaResources { get; set; } - - public ICollection Children { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs deleted file mode 100644 index 33cebd33..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application.Contracts/Tags/ITagAppService.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - public interface ITagAppService : ICrudAppService< - TagDto, - Guid, - GetTagListDto, - CreateTagDto, - UpdateTagDto> - { - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj deleted file mode 100644 index 11bdb9a1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/EasyAbp.EShop.Plugins.ProductTag.Application.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs deleted file mode 100644 index 53b30d75..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagAppService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public abstract class ProductTagAppService : ApplicationService - { - protected ProductTagAppService() - { - LocalizationResource = typeof(ProductTagResource); - ObjectMapperContext = typeof(ProductTagApplicationModule); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs deleted file mode 100644 index e13e925e..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,25 +0,0 @@ -using AutoMapper; -using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public class ProductTagApplicationAutoMapperProfile : Profile - { - public ProductTagApplicationAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); - CreateMap(); - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); - - CreateMap(); - CreateMap(MemberList.Source); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs deleted file mode 100644 index be07ebcd..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTagApplicationModule.cs +++ /dev/null @@ -1,27 +0,0 @@ -using EasyAbp.EShop.Products; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.Application; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagDomainModule), - typeof(ProductTagApplicationContractsModule), - typeof(AbpDddApplicationModule), - typeof(AbpAutoMapperModule), - typeof(EShopProductsDomainModule) - )] - public class ProductTagApplicationModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddMaps(validate: true); - }); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs deleted file mode 100644 index f279118c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/ProductTags/ProductTagAppService.cs +++ /dev/null @@ -1,130 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using EasyAbp.EShop.Products.Permissions; -using EasyAbp.EShop.Products.ProductStores; -using EasyAbp.EShop.Stores.Permissions; -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Linq; -using System.Threading.Tasks; -using EasyAbp.EShop.Products.Products; -using Microsoft.AspNetCore.Authorization; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - public class ProductTagAppService : ReadOnlyAppService, - IProductTagAppService - { - private readonly IProductTagRepository _repository; - private readonly ITagRepository _tagRepository; - private readonly IProductStoreRepository _productStoreRepository; - - public ProductTagAppService(IProductTagRepository repository, - ITagRepository tagRepository, - IProductStoreRepository productStoreRepository) : base(repository) - { - _repository = repository; - _tagRepository = tagRepository; - _productStoreRepository = productStoreRepository; - } - - protected override string GetListPolicyName { get; set; } = ProductsPermissions.Products.Default; - protected string UpdatePolicyName { get; set; } = ProductsPermissions.Products.Update; - - [RemoteService(false)] - public override Task GetAsync(Guid id) - { - throw new NotSupportedException(); - } - - public override async Task> GetListAsync(GetProductTagListDto input) - { - await CheckGetListPolicyAsync(); - - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, GetListPolicyName); - - var query = CreateFilteredQuery(input); - - var totalCount = await AsyncExecuter.CountAsync(query); - - query = ApplySorting(query, input); - query = ApplyPaging(query, input); - - var entities = await AsyncExecuter.ToListAsync(query); - - return new PagedResultDto( - totalCount, - entities.Select(MapToGetListOutputDto).ToList()); - } - - protected override IQueryable CreateFilteredQuery(GetProductTagListDto input) - { - var queryable = Repository.AsQueryable(); - - queryable = queryable.Where(x => x.StoreId == input.StoreId); - - if (input.TagId.HasValue) - { - queryable = queryable.Where(x => x.TagId == input.TagId); - } - - if (input.ProductId.HasValue) - { - queryable = queryable.Where(x => x.ProductId == input.ProductId); - } - - return queryable; - } - - public async Task UpdateAsync(Guid id, UpdateProductTagDto input) - { - var entity = await GetEntityByIdAsync(id); - - await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, UpdatePolicyName); - - MapToEntity(input, entity); - await _repository.UpdateAsync(entity, autoSave: true); - - return MapToGetOutputDto(entity); - } - - public async Task UpdateAsync(CreateUpdateProductTagsDto input) - { - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, UpdatePolicyName); - - var productStore = await _productStoreRepository.GetAsync(input.ProductId, input.StoreId, false); - - if (!productStore.IsOwner) - { - throw new StoreIsNotProductOwnerException(input.ProductId, input.StoreId); - } - - input.TagIds ??= new List(); - - var storeTags = (await _tagRepository.GetListByAsync(input.StoreId)).Select(x => x.Id); - - var productTags = await _repository.GetListByProductIdAsync(input.ProductId, input.StoreId); - - foreach (var productTag in productTags.Where(x => !input.TagIds.Contains(x.TagId))) - { - await _repository.DeleteAsync(productTag, true); - } - - foreach (var tagId in input.TagIds.Except(productTags.Select(x => x.TagId).Concat(storeTags))) - { - await _repository.InsertAsync( - new ProductTag(GuidGenerator.Create(), CurrentTenant.Id, tagId, input.ProductId), true); - } - } - - protected virtual ProductTag MapToEntity(UpdateProductTagDto input, ProductTag entity) - { - return ObjectMapper.Map(input, entity); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs deleted file mode 100644 index 0ea57bb8..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Application/Tags/TagAppService.cs +++ /dev/null @@ -1,110 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Permissions; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; -using EasyAbp.EShop.Stores.Permissions; -using JetBrains.Annotations; -using System; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Linq; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - public class TagAppService : CrudAppService, - ITagAppService - { - private readonly IAsyncQueryableExecuter _asyncQueryableExecuter; - protected override string CreatePolicyName { get; set; } = ProductTagPermissions.Tags.Create; - protected override string DeletePolicyName { get; set; } = ProductTagPermissions.Tags.Delete; - protected override string UpdatePolicyName { get; set; } = ProductTagPermissions.Tags.Update; - protected override string GetPolicyName { get; set; } = ProductTagPermissions.Tags.Default; - protected override string GetListPolicyName { get; set; } = ProductTagPermissions.Tags.Default; - - public TagAppService(ITagRepository repository, - [NotNull] IAsyncQueryableExecuter asyncQueryableExecuter) : base(repository) - { - _asyncQueryableExecuter = asyncQueryableExecuter ?? throw new ArgumentNullException(nameof(asyncQueryableExecuter)); - } - - protected override IQueryable CreateFilteredQuery(GetTagListDto input) - { - var query = base.CreateFilteredQuery(input); - - query = query.Where(x => x.StoreId == input.StoreId); - - return input.ShowHidden ? query : query.Where(x => !x.IsHidden); - } - - public override async Task GetAsync(Guid id) - { - await CheckGetPolicyAsync(); - - var entity = await GetEntityByIdAsync(id); - - await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, GetPolicyName, entity); - - return MapToGetOutputDto(entity); - } - - public override async Task> GetListAsync(GetTagListDto input) - { - await CheckGetListPolicyAsync(); - - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId, GetListPolicyName); - - var query = CreateFilteredQuery(input); - - var totalCount = await _asyncQueryableExecuter.CountAsync(query); - - query = ApplySorting(query, input); - query = ApplyPaging(query, input); - - var entities = await _asyncQueryableExecuter.ToListAsync(query); - - return new PagedResultDto( - totalCount, - entities.Select(MapToGetListOutputDto).ToList()); - } - - public override async Task CreateAsync(CreateTagDto input) - { - await CheckCreatePolicyAsync(); - - var entity = MapToEntity(input); - - await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, CreatePolicyName, entity); - - TryToSetTenantId(entity); - - await Repository.InsertAsync(entity, autoSave: true); - - return MapToGetOutputDto(entity); - } - - public override async Task UpdateAsync(Guid id, UpdateTagDto input) - { - await CheckUpdatePolicyAsync(); - - var entity = await GetEntityByIdAsync(id); - - await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, UpdatePolicyName, entity); - - MapToEntity(input, entity); - await Repository.UpdateAsync(entity, autoSave: true); - - return MapToGetOutputDto(entity); - } - - public override async Task DeleteAsync(Guid id) - { - await CheckDeletePolicyAsync(); - - var entity = await GetEntityByIdAsync(id); - - await AuthorizationService.CheckStoreOwnerAsync(entity.StoreId, DeletePolicyName, entity); - - await DeleteByIdAsync(id); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj deleted file mode 100644 index 8e9296cb..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - true - - - - - - - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json deleted file mode 100644 index 081cdb8a..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/cs.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "culture": "cs", - "texts": { - "ManageYourProfile": "Spravovat profil", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json deleted file mode 100644 index 41833bb9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/en.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "culture": "en", - "texts": { - "ManageYourProfile": "Manage your profile", - "SamplePageMessage": "A sample page for the ProductTag module", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json deleted file mode 100644 index aa76992a..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pl-PL.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json deleted file mode 100644 index 7c6362cb..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/pt-BR.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json deleted file mode 100644 index 298da6dd..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/sl.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "culture": "sl", - "texts": { - "ManageYourProfile": "Upravljajte svojim profilom", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json deleted file mode 100644 index 34f9901c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/tr.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "culture": "tr", - "texts": { - "ManageYourProfile": "Profil yönetimi", - "SamplePageMessage": "ProductTag modulünden örnek bir sayfa", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json deleted file mode 100644 index 1319bc8d..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/vi.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "culture": "vi", - "texts": { - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json deleted file mode 100644 index 05a31078..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hans.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "culture": "zh-Hans", - "texts": { - "ManageYourProfile": "管理个人资料", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json deleted file mode 100644 index fd2b044a..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTag/zh-Hant.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "culture": "zh-Hant", - "texts": { - "ManageYourProfile": "管理個人資料", - "Menu:Tag": "MenuTag", - "Tag": "Tag", - "TagTenantId": "TagTenantId", - "TagStoreId": "TagStoreId", - "TagDisplayName": "TagDisplayName", - "TagDescription": "TagDescription", - "TagMediaResources": "TagMediaResources", - "CreateTag": "CreateTag", - "EditTag": "EditTag", - "TagDeletionConfirmationMessage": "Are you sure to delete the tag {0}?", - "Permission:ProductTag": "ProductTag", - "Permission:Tag": "Tag", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete" - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs deleted file mode 100644 index 8024441c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/Localization/ProductTagResource.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Volo.Abp.Localization; - -namespace EasyAbp.EShop.Plugins.ProductTag.Localization -{ - [LocalizationResourceName("ProductTag")] - public class ProductTagResource - { - - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs deleted file mode 100644 index d4b2ba4d..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagDomainSharedModule.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Volo.Abp.Modularity; -using Volo.Abp.Localization; -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.Localization.ExceptionHandling; -using Volo.Abp.Validation; -using Volo.Abp.Validation.Localization; -using Volo.Abp.VirtualFileSystem; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(AbpValidationModule) - )] - public class ProductTagDomainSharedModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - Configure(options => - { - options.Resources - .Add("en") - .AddBaseTypes(typeof(AbpValidationResource)) - .AddVirtualJson("/Localization/ProductTag"); - }); - - Configure(options => - { - options.MapCodeNamespace("ProductTag", typeof(ProductTagResource)); - }); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs deleted file mode 100644 index ff528d99..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain.Shared/ProductTagErrorCodes.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public static class ProductTagErrorCodes - { - //Add your business exception error codes here... - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj deleted file mode 100644 index c3a84dc7..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/EasyAbp.EShop.Plugins.ProductTag.Domain.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs deleted file mode 100644 index 70233f15..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDbProperties.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public static class ProductTagDbProperties - { - public static string DbTablePrefix { get; set; } = "ProductTag"; - - public static string DbSchema { get; set; } = null; - - public const string ConnectionStringName = "ProductTag"; - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs deleted file mode 100644 index ad1a21de..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTagDomainModule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using EasyAbp.Abp.Trees; -using EasyAbp.EShop.Stores; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagDomainSharedModule), - typeof(AbpTreesDomainModule), - typeof(EShopStoresDomainSharedModule) - )] - public class ProductTagDomainModule : AbpModule - { - - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs deleted file mode 100644 index e6d0168c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/IProductTagRepository.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - public interface IProductTagRepository : IRepository - { - Task> GetListByTagIdAsync(Guid tagId, Guid? storeId = null, CancellationToken cancellationToken = default); - - Task> GetListByProductIdAsync(Guid productId, Guid? storeId = null, CancellationToken cancellationToken = default); - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs deleted file mode 100644 index 570d3449..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/ProductTags/ProductTags.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - public class ProductTag : AuditedAggregateRoot, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - public virtual Guid StoreId { get; set; } - - public virtual Guid TagId { get; protected set; } - - public virtual Guid ProductId { get; protected set; } - - public virtual int DisplayOrder { get; protected set; } - - protected ProductTag() - { - } - - public ProductTag( - Guid id, - Guid? tenantId, - Guid tagId, - Guid productId, - int displayOrder = 0 - ) : base(id) - { - TenantId = tenantId; - TagId = tagId; - ProductId = productId; - DisplayOrder = displayOrder; - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs deleted file mode 100644 index 919c64ea..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettingDefinitionProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.Settings; - -namespace EasyAbp.EShop.Plugins.ProductTag.Settings -{ - public class ProductTagSettingDefinitionProvider : SettingDefinitionProvider - { - public override void Define(ISettingDefinitionContext context) - { - /* Define module settings here. - * Use names from ProductTagSettings class. - */ - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs deleted file mode 100644 index 40555821..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Settings/ProductTagSettings.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.Settings -{ - public static class ProductTagSettings - { - public const string GroupName = "ProductTag"; - - /* Add constants for setting names. Example: - * public const string MySettingName = GroupName + ".MySettingName"; - */ - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs deleted file mode 100644 index dfb32dfe..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/ITagRepository.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - public interface ITagRepository : IRepository - { - Task> GetListByAsync(Guid storeId, bool includeDetails = false, CancellationToken cancellationToken = default); - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs deleted file mode 100644 index 91ac332b..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Domain/Tags/Tag.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Collections.Generic; -using EasyAbp.Abp.Trees; -using EasyAbp.EShop.Stores.Stores; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - public class Tag : FullAuditedAggregateRoot, ITree, IMultiTenant, IMultiStore - { - public virtual Guid? TenantId { get; protected set; } - - public virtual Guid StoreId { get; protected set; } - - [CanBeNull] - public virtual string Description { get; protected set; } - - [CanBeNull] - public virtual string MediaResources { get; protected set; } - - public virtual bool IsHidden { get; protected set; } - - #region Properties of ITree - - [NotNull] - public virtual string DisplayName { get; set; } - - [NotNull] - public virtual string Code { get; set; } - - public virtual int Level { get; set; } - - public virtual Guid? ParentId { get; set; } - - public virtual Tag Parent { get; set; } - - public virtual ICollection Children { get; set; } - - #endregion - - protected Tag() - { - } - - public Tag( - Guid id, - Guid? tenantId, - Guid storeId, - Guid? parentId, - string displayName, - string description, - string mediaResources, - bool isHidden - ) : base(id) - { - TenantId = tenantId; - StoreId = storeId; - ParentId = parentId; - DisplayName = displayName; - Description = description; - MediaResources = mediaResources; - IsHidden = isHidden; - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj deleted file mode 100644 index db7d2960..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs deleted file mode 100644 index 8d481613..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/IProductTagDbContext.cs +++ /dev/null @@ -1,17 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] - public interface IProductTagDbContext : IEfCoreDbContext - { - /* Add DbSet for each Aggregate Root here. Example: - * DbSet Questions { get; } - */ - DbSet Tags { get; set; } - DbSet ProductTags { get; set; } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs deleted file mode 100644 index 19d93b2f..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContext.cs +++ /dev/null @@ -1,31 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] - public class ProductTagDbContext : AbpDbContext, IProductTagDbContext - { - /* Add DbSet for each Aggregate Root here. Example: - * public DbSet Questions { get; set; } - */ - - public DbSet Tags { get; set; } - public DbSet ProductTags { get; set; } - - public ProductTagDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - - builder.ConfigureProductTag(); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs deleted file mode 100644 index 01a377d1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagDbContextModelCreatingExtensions.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using Microsoft.EntityFrameworkCore; -using Volo.Abp; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - public static class ProductTagDbContextModelCreatingExtensions - { - public static void ConfigureProductTag( - this ModelBuilder builder, - Action optionsAction = null) - { - Check.NotNull(builder, nameof(builder)); - - var options = new ProductTagModelBuilderConfigurationOptions( - ProductTagDbProperties.DbTablePrefix, - ProductTagDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - /* Configure all entities here. Example: - - builder.Entity(b => - { - //Configure table & schema name - b.ToTable(options.TablePrefix + "Questions", options.Schema); - - b.ConfigureByConvention(); - - //Properties - b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); - - //Relations - b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); - - //Indexes - b.HasIndex(q => q.CreationTime); - }); - */ - - - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "Tags", options.Schema); - b.ConfigureByConvention(); - /* Configure more properties here */ - - b.HasIndex(x => x.StoreId); - }); - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "ProductTags", options.Schema); - b.ConfigureByConvention(); - /* Configure more properties here */ - - b.HasIndex(x => x.TagId); - b.HasIndex(x => x.ProductId); - }); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs deleted file mode 100644 index 6022e551..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,29 +0,0 @@ -using EasyAbp.Abp.Trees.EntityFrameworkCore; -using EasyAbp.EShop.Plugins.ProductTag.ProductTags; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - [DependsOn( - typeof(ProductTagDomainModule), - typeof(AbpEntityFrameworkCoreModule), - typeof(AbpTreesEntityFrameworkCoreModule) - )] - public class ProductTagEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAbpDbContext(options => - { - /* Add custom repositories here. Example: - * options.AddRepository(); - */ - options.AddRepository(); - options.AddRepository(); - }); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs deleted file mode 100644 index f234aee5..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/EntityFrameworkCore/ProductTagModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - public class ProductTagModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public ProductTagModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs deleted file mode 100644 index 052993ec..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/ProductTags/ProductTagRepository.cs +++ /dev/null @@ -1,43 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - public class ProductTagRepository : EfCoreRepository, IProductTagRepository - { - public ProductTagRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - - public virtual async Task> GetListByTagIdAsync(Guid categoryId, Guid? storeId = null, - CancellationToken cancellationToken = default) - { - var queryable = GetQueryable(); - if (storeId.HasValue) - { - queryable = queryable.Where(x => x.StoreId == storeId.Value); - } - - return await queryable.Where(pc => pc.TagId == categoryId).ToListAsync(cancellationToken); - } - - public virtual async Task> GetListByProductIdAsync(Guid productId, Guid? storeId = null, - CancellationToken cancellationToken = default) - { - var queryable = GetQueryable(); - if (storeId.HasValue) - { - queryable = queryable.Where(x => x.StoreId == storeId.Value); - } - - return await queryable.Where(pc => pc.ProductId == productId).ToListAsync(cancellationToken); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs deleted file mode 100644 index 2e528cab..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore/Tags/TagRepository.cs +++ /dev/null @@ -1,32 +0,0 @@ -using EasyAbp.Abp.Trees; -using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - public class TagRepository : EfCoreTreeRepository, ITagRepository - { - public TagRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - - public async Task> GetListByAsync(Guid storeId, bool includeDetails = false, CancellationToken cancellationToken = default) - { - return includeDetails - ? await WithDetails().Where(x => x.StoreId == storeId).ToListAsync(GetCancellationToken(cancellationToken)) - : await GetQueryable().Where(x => x.StoreId == storeId).ToListAsync(GetCancellationToken(cancellationToken)); - } - - [Obsolete("Should use GetListByAsync(Guid storeId, bool includeDetails, CancellationToken cancellationToken)")] - public override Task> GetListAsync(bool includeDetails = false, CancellationToken cancellationToken = new CancellationToken()) - { - return base.GetListAsync(includeDetails, cancellationToken); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj deleted file mode 100644 index 6d083269..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs deleted file mode 100644 index 264a411f..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client/ProductTagHttpApiClientModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagApplicationContractsModule), - typeof(AbpHttpClientModule))] - public class ProductTagHttpApiClientModule : AbpModule - { - public const string RemoteServiceName = "ProductTag"; - - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClientProxies( - typeof(ProductTagApplicationContractsModule).Assembly, - RemoteServiceName - ); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj deleted file mode 100644 index decfa3db..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/EasyAbp.EShop.Plugins.ProductTag.HttpApi.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs deleted file mode 100644 index 3d123e0c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagBaseController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.AspNetCore.Mvc; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public abstract class ProductTagBaseController : AbpController - { - protected ProductTagBaseController() - { - LocalizationResource = typeof(ProductTagResource); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs deleted file mode 100644 index 90825e4d..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTagHttpApiModule.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Localization.Resources.AbpUi; -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Localization; -using Volo.Abp.Modularity; -using Microsoft.Extensions.DependencyInjection; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule))] - public class ProductTagHttpApiModule : AbpModule - { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(ProductTagHttpApiModule).Assembly); - }); - } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpUiResource)); - }); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs deleted file mode 100644 index ab622bc1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/ProductTags/ProductTagController.cs +++ /dev/null @@ -1,48 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.ProductTags.Dtos; -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.ProductTags -{ - [RemoteService(Name = "ProductTagService")] - [Route("/api/eShop/products/productTag")] - public class ProductTagController : ProductTagBaseController, IProductTagAppService - { - private readonly IProductTagAppService _service; - - public ProductTagController(IProductTagAppService service) - { - _service = service; - } - - [HttpPut] - public virtual Task UpdateAsync(CreateUpdateProductTagsDto input) - { - return _service.UpdateAsync(input); - } - - [RemoteService(false)] - [NonAction] - public Task GetAsync(Guid id) - { - throw new NotSupportedException(); - } - - [HttpGet] - public Task> GetListAsync(GetProductTagListDto input) - { - return _service.GetListAsync(input); - } - - - [HttpPut] - [Route("{id}")] - public Task UpdateAsync(Guid id, UpdateProductTagDto input) - { - return _service.UpdateAsync(id, input); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs deleted file mode 100644 index c9acb3d2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.HttpApi/Tags/TagController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.Tags -{ - [RemoteService(Name = "TagService")] - [Route("/api/eShop/products/tag")] - public class TagController : ProductTagBaseController, ITagAppService - { - private readonly ITagAppService _service; - - public TagController(ITagAppService service) - { - _service = service; - } - - [HttpGet] - [Route("{id}")] - public Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - [HttpGet] - public Task> GetListAsync(GetTagListDto input) - { - return _service.GetListAsync(input); - } - - [HttpPost] - public Task CreateAsync(CreateTagDto input) - { - return _service.CreateAsync(input); - } - - [HttpPut] - [Route("{id}")] - public Task UpdateAsync(Guid id, UpdateTagDto input) - { - return _service.UpdateAsync(id, input); - } - - [HttpDelete] - [Route("{id}")] - public Task DeleteAsync(Guid id) - { - return _service.DeleteAsync(id); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj deleted file mode 100644 index 951ad0ea..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/EasyAbp.EShop.Plugins.ProductTag.MongoDB.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs deleted file mode 100644 index c82594b7..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/IProductTagMongoDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Data; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] - public interface IProductTagMongoDbContext : IAbpMongoDbContext - { - /* Define mongo collections here. Example: - * IMongoCollection Questions { get; } - */ - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs deleted file mode 100644 index 2bfe8f87..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContext.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Volo.Abp.Data; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - [ConnectionStringName(ProductTagDbProperties.ConnectionStringName)] - public class ProductTagMongoDbContext : AbpMongoDbContext, IProductTagMongoDbContext - { - /* Add mongo collections here. Example: - * public IMongoCollection Questions => Collection(); - */ - - protected override void CreateModel(IMongoModelBuilder modelBuilder) - { - base.CreateModel(modelBuilder); - - modelBuilder.ConfigureProductTag(); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs deleted file mode 100644 index 00b88801..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbContextExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Volo.Abp; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - public static class ProductTagMongoDbContextExtensions - { - public static void ConfigureProductTag( - this IMongoModelBuilder builder, - Action optionsAction = null) - { - Check.NotNull(builder, nameof(builder)); - - var options = new ProductTagMongoModelBuilderConfigurationOptions( - ProductTagDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs deleted file mode 100644 index 2b28a721..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoDbModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - [DependsOn( - typeof(ProductTagDomainModule), - typeof(AbpMongoDbModule) - )] - public class ProductTagMongoDbModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddMongoDbContext(options => - { - /* Add custom repositories here. Example: - * options.AddRepository(); - */ - }); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index b052723e..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.MongoDB/MongoDB/ProductTagMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - public class ProductTagMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public ProductTagMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj deleted file mode 100644 index 6a8d8589..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/EasyAbp.EShop.Plugins.ProductTag.Web.csproj +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - netcoreapp3.1 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - true - Library - EasyAbp.EShop.Plugins.ProductTag.Web - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs deleted file mode 100644 index 23344d33..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenuContributor.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using EasyAbp.EShop.Plugins.ProductTag.Permissions; -using EasyAbp.EShop.Products.Web.Menus; -using System.Threading.Tasks; -using Volo.Abp.UI.Navigation; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Menus -{ - public class ProductTagMenuContributor : IMenuContributor - { - public async Task ConfigureMenuAsync(MenuConfigurationContext context) - { - if (context.Menu.Name == StandardMenus.Main) - { - await ConfigureMainMenu(context); - } - } - - private async Task ConfigureMainMenu(MenuConfigurationContext context) - { - //Add main menu items. - var l = context.GetLocalizer(); - - var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == ProductsMenus.ModuleGroupPrefix, - () => new ApplicationMenuItem(ProductsMenus.ModuleGroupPrefix, l["Menu:EasyAbpEShop"])); - - var productManagementMenuItem = eShopMenuItem.Items.GetOrAdd(x => x.Name == ProductsMenus.Prefix, - () => new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"])); - - if (await context.IsGrantedAsync(ProductTagPermissions.Tags.Default)) - { - productManagementMenuItem.AddItem( - new ApplicationMenuItem(ProductTagMenus.Tag, l["Menu:Tag"], "/EShop/Products/Tags/Tag") - ); - } - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs deleted file mode 100644 index 9d59ae47..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Menus/ProductTagMenus.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Menus -{ - public class ProductTagMenus - { - private const string Prefix = "ProductTag"; - - //Add your menu items here... - //public const string Home = Prefix + ".MyNewMenuItem"; - - - public const string Tag = Prefix + ".Tag"; - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml deleted file mode 100644 index 85b85366..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using EasyAbp.EShop.Plugins.ProductTag.Localization -@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.ProductTag.IndexModel -@inject IStringLocalizer L -@{ -} -

ProductTag

-

@L["SamplePageMessage"]

diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs deleted file mode 100644 index c4fc906c..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/Index.cshtml.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.ProductTag -{ - public class IndexModel : ProductTagPageModel - { - public void OnGet() - { - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml deleted file mode 100644 index c1da1f5f..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/ProductTag/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml deleted file mode 100644 index 07cc44da..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml +++ /dev/null @@ -1,18 +0,0 @@ -@page -@using EasyAbp.EShop.Plugins.ProductTag.Localization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; -@inject IHtmlLocalizer L -@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.CreateModalModel -@{ - Layout = null; -} - - - - - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs deleted file mode 100644 index 134cb57e..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/CreateModal.cshtml.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; -using Microsoft.AspNetCore.Mvc; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag -{ - public class CreateModalModel : ProductTagPageModel - { - [BindProperty] - public CreateTagDto ViewModel { get; set; } - - private readonly ITagAppService _service; - - public CreateModalModel(ITagAppService service) - { - _service = service; - } - - public virtual async Task OnPostAsync() - { - await _service.CreateAsync(ViewModel); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml deleted file mode 100644 index ffb257f8..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml +++ /dev/null @@ -1,19 +0,0 @@ -@page -@using EasyAbp.EShop.Plugins.ProductTag.Localization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; -@inject IHtmlLocalizer L -@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.EditModalModel -@{ - Layout = null; -} - - - - - - - - - - diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs deleted file mode 100644 index 61595422..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/EditModal.cshtml.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.ProductTag.Tags; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; -using Microsoft.AspNetCore.Mvc; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag -{ - public class EditModalModel : ProductTagPageModel - { - [HiddenInput] - [BindProperty(SupportsGet = true)] - public Guid Id { get; set; } - - [BindProperty] - public UpdateTagDto ViewModel { get; set; } - - private readonly ITagAppService _service; - - public EditModalModel(ITagAppService service) - { - _service = service; - } - - public virtual async Task OnGetAsync() - { - var dto = await _service.GetAsync(Id); - ViewModel = ObjectMapper.Map(dto); - } - - public virtual async Task OnPostAsync() - { - await _service.UpdateAsync(Id, ViewModel); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml deleted file mode 100644 index 4de9187d..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml +++ /dev/null @@ -1,61 +0,0 @@ -@page -@using EasyAbp.EShop.Plugins.ProductTag.Localization -@using EasyAbp.EShop.Plugins.ProductTag.Web.Menus -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Layout -@model EasyAbp.EShop.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag.IndexModel -@inject IPageLayout PageLayout -@inject IHtmlLocalizer L -@{ - PageLayout.Content.Title = L["Tag"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:Tag"].Value); - PageLayout.Content.MenuItemName = ProductTagMenus.Tag; -} - -@section scripts -{ - -} -@section styles -{ - -} - - - - - - - @L["Tag"] - @Model.StoreName - - - - - - - - - - - @L["Actions"] - Id - @*@L["TagStoreId"]*@ - @L["TagDescription"] - @L["TagMediaResources"] - @*@L["TagIsHidden"]*@ - @L["TagDisplayName"] - @*@L["TagCode"]*@ - @*@L["TagLevel"]*@ - @L["TagParentId"] - @*@L["TagParent"] - @L["TagChildren"]*@ - - - - - \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs deleted file mode 100644 index ec5a07d9..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/Index.cshtml.cs +++ /dev/null @@ -1,51 +0,0 @@ -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.Plugins.ProductTag.Web.Pages.EShop.Products.Tags.Tag -{ - public class IndexModel : ProductTagPageModel - { - private readonly IStoreAppService _storeAppService; - private readonly IStoreOwnerAppService _storeOwnerAppService; - - [BindProperty(SupportsGet = true)] - public Guid? StoreId { get; set; } - - public string StoreName { get; set; } - - public IndexModel(IStoreAppService storeAppService, - IStoreOwnerAppService storeOwnerAppService) - { - _storeAppService = storeAppService; - _storeOwnerAppService = storeOwnerAppService; - } - - public virtual async Task OnGetAsync() - { - //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; - } - - //show default store - if (!StoreId.HasValue) - { - var defaultStore = await _storeAppService.GetDefaultAsync(); - StoreId = defaultStore.Id; - } - - StoreName = (await _storeAppService.GetAsync(StoreId.Value)).Name; - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js deleted file mode 100644 index 1617ed57..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/EShop/Products/Tags/Tag/index.js +++ /dev/null @@ -1,80 +0,0 @@ -$(function () { - - var l = abp.localization.getResource('Products'); - - var service = easyAbp.eShop.products.tags.tag; - var createModal = new abp.ModalManager(abp.appPath + 'EShop/Products/Tags/Tag/CreateModal'); - var editModal = new abp.ModalManager(abp.appPath + 'EShop/Products/Tags/Tag/EditModal'); - - var dataTable = $('#TagTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList, function () { - return { storeId: storeId, showHidden: true } - }), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Product'), - action: function (data) { - document.location.href = document.location.origin + - '/EShop/Products/Products/Product?StoreId=' + storeId + '&TagId=' + data.record.id; - } - }, - { - text: l('Edit'), - action: function (data) { - editModal.open({ id: data.record.id }); - } - }, - { - text: l('Delete'), - confirmMessage: function (data) { - return l('TagDeletionConfirmationMessage', data.record.id); - }, - action: function (data) { - service.delete(data.record.id) - .then(function () { - abp.notify.info(l('SuccessfullyDeleted')); - dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { data: "id"}, - //{ data: "storeId" }, - { data: "description" }, - { data: "mediaResources" }, - //{ data: "isHidden" }, - { data: "displayName" }, - //{ data: "code" }, - //{ data: "level" }, - { data: "parentId" }, - //{ data: "parent" }, - //{ data: "children" }, - ] - })); - - createModal.onResult(function () { - dataTable.ajax.reload(); - }); - - editModal.onResult(function () { - dataTable.ajax.reload(); - }); - - $('#NewTagButton').click(function (e) { - e.preventDefault(); - createModal.open(); - }); -}); \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs deleted file mode 100644 index 7cb25b39..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Pages/ProductTagPageModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web.Pages -{ - /* Inherit your PageModel classes from this class. - */ - public abstract class ProductTagPageModel : AbpPageModel - { - protected ProductTagPageModel() - { - LocalizationResourceType = typeof(ProductTagResource); - ObjectMapperContext = typeof(ProductTagWebModule); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs deleted file mode 100644 index e6196b15..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebAutoMapperProfile.cs +++ /dev/null @@ -1,18 +0,0 @@ -using AutoMapper; -using EasyAbp.EShop.Plugins.ProductTag.Tags.Dtos; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web -{ - public class ProductTagWebAutoMapperProfile : Profile - { - public ProductTagWebAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - - CreateMap(); - CreateMap(); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs deleted file mode 100644 index 79dbc117..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/ProductTagWebModule.cs +++ /dev/null @@ -1,58 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Localization; -using EasyAbp.EShop.Plugins.ProductTag.Web.Menus; -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.UI.Navigation; -using Volo.Abp.VirtualFileSystem; - -namespace EasyAbp.EShop.Plugins.ProductTag.Web -{ - [DependsOn( - typeof(ProductTagHttpApiModule), - typeof(AbpAspNetCoreMvcUiThemeSharedModule), - typeof(AbpAutoMapperModule) - )] - public class ProductTagWebModule : AbpModule - { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - context.Services.PreConfigure(options => - { - options.AddAssemblyResource(typeof(ProductTagResource), typeof(ProductTagWebModule).Assembly); - }); - - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(ProductTagWebModule).Assembly); - }); - } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.MenuContributors.Add(new ProductTagMenuContributor()); - }); - - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddMaps(validate: true); - }); - - Configure(options => - { - //Configure authorization. - }); - } - } -} diff --git a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json b/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json deleted file mode 100644 index 0f428ebe..00000000 --- a/plugins/ProductTag/src/EasyAbp.EShop.Plugins.ProductTag.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:1625/", - "sslPort": 44392 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "EasyAbp.EShop.Plugins.ProductTag.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj deleted file mode 100644 index 0d0e5054..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/EasyAbp.EShop.Plugins.ProductTag.Application.Tests.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs deleted file mode 100644 index aa019db8..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag -{ - /* Inherit from this class for your application layer tests. - * See SampleAppService_Tests for example. - */ - public abstract class ProductTagApplicationTestBase : ProductTagTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs deleted file mode 100644 index 662e0188..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/ProductTagApplicationTestModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagApplicationModule), - typeof(ProductTagDomainTestModule) - )] - public class ProductTagApplicationTestModule : AbpModule - { - - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs deleted file mode 100644 index 6e5f4666..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Application.Tests/Samples/SampleAppService_Tests.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace EasyAbp.EShop.Plugins.ProductTag.Samples -{ - public class SampleAppService_Tests : ProductTagApplicationTestBase - { - private readonly ISampleAppService _sampleAppService; - - public SampleAppService_Tests() - { - _sampleAppService = GetRequiredService(); - } - - [Fact] - public async Task GetAsync() - { - var result = await _sampleAppService.GetAsync(); - result.Value.ShouldBe(42); - } - - [Fact] - public async Task GetAuthorizedAsync() - { - var result = await _sampleAppService.GetAuthorizedAsync(); - result.Value.ShouldBe(42); - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj deleted file mode 100644 index 5ced1389..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs deleted file mode 100644 index 9ea5f5aa..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag -{ - /* Inherit from this class for your domain layer tests. - * See SampleManager_Tests for example. - */ - public abstract class ProductTagDomainTestBase : ProductTagTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs deleted file mode 100644 index a287e7b9..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/ProductTagDomainTestModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - /* Domain tests are configured to use the EF Core provider. - * You can switch to MongoDB, however your domain tests should be - * database independent anyway. - */ - [DependsOn( - typeof(ProductTagEntityFrameworkCoreTestModule) - )] - public class ProductTagDomainTestModule : AbpModule - { - - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs deleted file mode 100644 index 529935d2..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.Domain.Tests/Samples/SampleManager_Tests.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Xunit; - -namespace EasyAbp.EShop.Plugins.ProductTag.Samples -{ - public class SampleManager_Tests : ProductTagDomainTestBase - { - //private readonly SampleManager _sampleManager; - - public SampleManager_Tests() - { - //_sampleManager = GetRequiredService(); - } - - [Fact] - public async Task Method1Async() - { - - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index ae7e53ba..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs deleted file mode 100644 index daa009b6..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - /* This class can be used as a base class for EF Core integration tests, - * while SampleRepository_Tests uses a different approach. - */ - public abstract class ProductTagEntityFrameworkCoreTestBase : ProductTagTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs deleted file mode 100644 index 388da505..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTagEntityFrameworkCoreTestModule.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.Data.Sqlite; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Sqlite; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore -{ - [DependsOn( - typeof(ProductTagTestBaseModule), - typeof(ProductTagEntityFrameworkCoreModule), - typeof(AbpEntityFrameworkCoreSqliteModule) - )] - public class ProductTagEntityFrameworkCoreTestModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var sqliteConnection = CreateDatabaseAndGetConnection(); - - Configure(options => - { - options.Configure(abpDbContextConfigurationContext => - { - abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); - }); - }); - } - - private static SqliteConnection CreateDatabaseAndGetConnection() - { - var connection = new SqliteConnection("Data Source=:memory:"); - connection.Open(); - - new ProductTagDbContext( - new DbContextOptionsBuilder().UseSqlite(connection).Options - ).GetService().CreateTables(); - - return connection; - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs deleted file mode 100644 index 4b161b23..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Tests/EntityFrameworkCore/Samples/SampleRepository_Tests.cs +++ /dev/null @@ -1,12 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Samples; - -namespace EasyAbp.EShop.Plugins.ProductTag.EntityFrameworkCore.Samples -{ - public class SampleRepository_Tests : SampleRepository_Tests - { - /* Don't write custom repository tests here, instead write to - * the base class. - * One exception can be some specific tests related to EF core. - */ - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs deleted file mode 100644 index cffdd8fb..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs +++ /dev/null @@ -1,156 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; -using Microsoft.Extensions.Configuration; -using EasyAbp.EShop.Plugins.ProductTag.Samples; -using Volo.Abp.DependencyInjection; -using Volo.Abp.IdentityModel; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public class ClientDemoService : ITransientDependency - { - private readonly ISampleAppService _sampleAppService; - private readonly IIdentityModelAuthenticationService _authenticationService; - private readonly IConfiguration _configuration; - - public ClientDemoService( - ISampleAppService sampleAppService, - IIdentityModelAuthenticationService authenticationService, - IConfiguration configuration) - { - _sampleAppService = sampleAppService; - _authenticationService = authenticationService; - _configuration = configuration; - } - - public async Task RunAsync() - { - await TestWithDynamicProxiesAsync(); - await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); - await TestAllManuallyAsync(); - } - - /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy - * feature. It is just simple as calling a local service method. - * Authorization and HTTP request details are handled by the ABP framework. - */ - private async Task TestWithDynamicProxiesAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); - - var result = await _sampleAppService.GetAsync(); - Console.WriteLine("Result: " + result.Value); - - result = await _sampleAppService.GetAuthorizedAsync(); - Console.WriteLine("Result (authorized): " + result.Value); - } - - /* Shows how to use HttpClient to perform a request to the HTTP API. - * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. - */ - private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); - - //Get access token using ABP's IIdentityModelAuthenticationService - - var accessToken = await _authenticationService.GetAccessTokenAsync( - new IdentityClientConfiguration( - _configuration["IdentityClients:Default:Authority"], - _configuration["IdentityClients:Default:Scope"], - _configuration["IdentityClients:Default:ClientId"], - _configuration["IdentityClients:Default:ClientSecret"], - _configuration["IdentityClients:Default:GrantType"], - _configuration["IdentityClients:Default:UserName"], - _configuration["IdentityClients:Default:UserPassword"] - ) - ); - - //Perform the actual HTTP request - - using (var httpClient = new HttpClient()) - { - httpClient.SetBearerToken(accessToken); - - var url = _configuration["RemoteServices:ProductTag:BaseUrl"] + - "api/ProductTag/sample/authorized"; - - var responseMessage = await httpClient.GetAsync(url); - if (responseMessage.IsSuccessStatusCode) - { - var responseString = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine("Result: " + responseString); - } - else - { - throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); - } - } - } - - /* Shows how to use HttpClient to perform a request to the HTTP API. - * It obtains access token using IdentityServer's API. See its documentation: - * https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html - */ - private async Task TestAllManuallyAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); - - //Obtain access token from the IDS4 server - - // discover endpoints from metadata - var client = new HttpClient(); - var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); - if (disco.IsError) - { - Console.WriteLine(disco.Error); - return; - } - - // request token - var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest - { - Address = disco.TokenEndpoint, - ClientId = _configuration["IdentityClients:Default:ClientId"], - ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], - UserName = _configuration["IdentityClients:Default:UserName"], - Password = _configuration["IdentityClients:Default:UserPassword"], - Scope = _configuration["IdentityClients:Default:Scope"] - }); - - if (tokenResponse.IsError) - { - Console.WriteLine(tokenResponse.Error); - return; - } - - Console.WriteLine(tokenResponse.Json); - - //Perform the actual HTTP request - - using (var httpClient = new HttpClient()) - { - httpClient.SetBearerToken(tokenResponse.AccessToken); - - var url = _configuration["RemoteServices:ProductTag:BaseUrl"] + - "api/ProductTag/sample/authorized"; - - var responseMessage = await httpClient.GetAsync(url); - if (responseMessage.IsSuccessStatusCode) - { - var responseString = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine("Result: " + responseString); - } - else - { - throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); - } - } - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs deleted file mode 100644 index 06b96ffe..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.Hosting; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp -{ - public class ConsoleTestAppHostedService : IHostedService - { - public async Task StartAsync(CancellationToken cancellationToken) - { - using (var application = AbpApplicationFactory.Create()) - { - application.Initialize(); - - var demo = application.ServiceProvider.GetRequiredService(); - await demo.RunAsync(); - - application.Shutdown(); - } - } - - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj deleted file mode 100644 index 99cf34c2..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - Exe - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - - PreserveNewest - Always - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs deleted file mode 100644 index 00c5cb52..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/ProductTagConsoleApiClientModule.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.Http.Client.IdentityModel; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(ProductTagHttpApiClientModule), - typeof(AbpHttpClientIdentityModelModule) - )] - public class ProductTagConsoleApiClientModule : AbpModule - { - - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs deleted file mode 100644 index 282fb945..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp -{ - class Program - { - static async Task Main(string[] args) - { - await CreateHostBuilder(args).RunConsoleAsync(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - }); - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json deleted file mode 100644 index 220d40f5..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.HttpApi.Client.ConsoleTestApp/appsettings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "RemoteServices": { - "Default": { - "BaseUrl": "https://localhost:44362/" - }, - "ProductTag": { - "BaseUrl": "https://localhost:44375/" - } - }, - "IdentityClients": { - "Default": { - "GrantType": "password", - "ClientId": "ProductTag_ConsoleTestApp", - "ClientSecret": "1q2w3e*", - "UserName": "admin", - "UserPassword": "1q2w3E*", - "Authority": "https://localhost:44362/", - "Scope": "ProductTag" - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj deleted file mode 100644 index d0f972bf..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs deleted file mode 100644 index 7e1890b4..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoDbFixture.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Mongo2Go; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - public class MongoDbFixture : IDisposable - { - private static readonly MongoDbRunner MongoDbRunner; - public static readonly string ConnectionString; - - static MongoDbFixture() - { - MongoDbRunner = MongoDbRunner.Start(); - ConnectionString = MongoDbRunner.ConnectionString; - } - - public void Dispose() - { - MongoDbRunner?.Dispose(); - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs deleted file mode 100644 index 5021a6fe..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/MongoTestCollection.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Xunit; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - [CollectionDefinition(Name)] - public class MongoTestCollection : ICollectionFixture - { - public const string Name = "MongoDB Collection"; - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs deleted file mode 100644 index b4814cc2..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - /* This class can be used as a base class for MongoDB integration tests, - * while SampleRepository_Tests uses a different approach. - */ - public abstract class ProductTagMongoDbTestBase : ProductTagTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs deleted file mode 100644 index f77a5e40..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/ProductTagMongoDbTestModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Volo.Abp.Data; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB -{ - [DependsOn( - typeof(ProductTagTestBaseModule), - typeof(ProductTagMongoDbModule) - )] - public class ProductTagMongoDbTestModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); - - Configure(options => - { - options.ConnectionStrings.Default = connectionString; - }); - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs deleted file mode 100644 index 0c1e9333..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.MongoDB.Tests/MongoDB/Samples/SampleRepository_Tests.cs +++ /dev/null @@ -1,14 +0,0 @@ -using EasyAbp.EShop.Plugins.ProductTag.Samples; -using Xunit; - -namespace EasyAbp.EShop.Plugins.ProductTag.MongoDB.Samples -{ - [Collection(MongoTestCollection.Name)] - public class SampleRepository_Tests : SampleRepository_Tests - { - /* Don't write custom repository tests here, instead write to - * the base class. - * One exception can be some specific tests related to MongoDB. - */ - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj deleted file mode 100644 index d8c26cfe..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/EasyAbp.EShop.Plugins.ProductTag.TestBase.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.ProductTag - - - - - - - - - - - - - - - - diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs deleted file mode 100644 index 5ee6714a..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagDataSeedContributor.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - public class ProductTagDataSeedContributor : IDataSeedContributor, ITransientDependency - { - private readonly IGuidGenerator _guidGenerator; - - public ProductTagDataSeedContributor( - IGuidGenerator guidGenerator) - { - _guidGenerator = guidGenerator; - } - - public Task SeedAsync(DataSeedContext context) - { - /* Instead of returning the Task.CompletedTask, you can insert your test data - * at this point! - */ - - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs deleted file mode 100644 index ffc27da7..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBase.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Modularity; -using Volo.Abp.Uow; -using Volo.Abp.Testing; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - /* All test classes are derived from this class, directly or indirectly. */ - public abstract class ProductTagTestBase : AbpIntegratedTest - where TStartupModule : IAbpModule - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual Task WithUnitOfWorkAsync(Func func) - { - return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); - } - - protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - await action(); - - await uow.CompleteAsync(); - } - } - } - - protected virtual Task WithUnitOfWorkAsync(Func> func) - { - return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); - } - - protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = await func(); - await uow.CompleteAsync(); - return result; - } - } - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs deleted file mode 100644 index f7c7e7a6..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/ProductTagTestBaseModule.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Authorization; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.Modularity; -using Volo.Abp.Threading; - -namespace EasyAbp.EShop.Plugins.ProductTag -{ - [DependsOn( - typeof(AbpAutofacModule), - typeof(AbpTestBaseModule), - typeof(AbpAuthorizationModule), - typeof(ProductTagDomainModule) - )] - public class ProductTagTestBaseModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAlwaysAllowAuthorization(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - AsyncHelper.RunSync(async () => - { - using (var scope = context.ServiceProvider.CreateScope()) - { - await scope.ServiceProvider - .GetRequiredService() - .SeedAsync(); - } - }); - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs deleted file mode 100644 index f2eeae67..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Samples/SampleRepository_Tests.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Modularity; -using Xunit; - -namespace EasyAbp.EShop.Plugins.ProductTag.Samples -{ - /* Write your custom repository tests like that, in this project, as abstract classes. - * Then inherit these abstract classes from EF Core & MongoDB test projects. - * In this way, both database providers are tests with the same set tests. - */ - public abstract class SampleRepository_Tests : ProductTagTestBase - where TStartupModule : IAbpModule - { - //private readonly ISampleRepository _sampleRepository; - - protected SampleRepository_Tests() - { - //_sampleRepository = GetRequiredService(); - } - - [Fact] - public async Task Method1Async() - { - - } - } -} diff --git a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs deleted file mode 100644 index 25bd2a26..00000000 --- a/plugins/ProductTag/test/EasyAbp.EShop.Plugins.ProductTag.TestBase/Security/FakeCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using System.Security.Claims; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Security.Claims; - -namespace EasyAbp.EShop.Plugins.ProductTag.Security -{ - [Dependency(ReplaceServices = true)] - public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor - { - protected override ClaimsPrincipal GetClaimsPrincipal() - { - return GetPrincipal(); - } - - private ClaimsPrincipal _principal; - - private ClaimsPrincipal GetPrincipal() - { - if (_principal == null) - { - lock (this) - { - if (_principal == null) - { - _principal = new ClaimsPrincipal( - new ClaimsIdentity( - new List - { - new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), - new Claim(AbpClaimTypes.UserName,"admin"), - new Claim(AbpClaimTypes.Email,"admin@abp.io") - } - ) - ); - } - } - } - - return _principal; - } - } -} diff --git a/plugins/StoreApproval/.gitattributes b/plugins/StoreApproval/.gitattributes deleted file mode 100644 index c941e526..00000000 --- a/plugins/StoreApproval/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -**/wwwroot/libs/** linguist-vendored diff --git a/plugins/StoreApproval/.gitignore b/plugins/StoreApproval/.gitignore deleted file mode 100644 index 8a6cac80..00000000 --- a/plugins/StoreApproval/.gitignore +++ /dev/null @@ -1,258 +0,0 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# StoreApproval -host/EasyAbp.EShop.Plugins.StoreApproval.IdentityServer/Logs/logs.txt -host/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Host/Logs/logs.txt -host/EasyAbp.EShop.Plugins.StoreApproval.Web.Host/Logs/logs.txt -host/EasyAbp.EShop.Plugins.StoreApproval.Web.Unified/Logs/logs.txt diff --git a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln deleted file mode 100644 index 7de6603e..00000000 --- a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln +++ /dev/null @@ -1,144 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.29001.49 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared", "src\EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared\EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain", "src\EasyAbp.EShop.Plugins.StoreApproval.Domain\EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts", "src\EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts\EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application", "src\EasyAbp.EShop.Plugins.StoreApproval.Application\EasyAbp.EShop.Plugins.StoreApproval.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.MongoDB", "src\EasyAbp.EShop.Plugins.StoreApproval.MongoDB\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi", "src\EasyAbp.EShop.Plugins.StoreApproval.HttpApi\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client", "src\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.TestBase", "test\EasyAbp.EShop.Plugins.StoreApproval.TestBase\EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests\EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests\EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Application.Tests", "test\EasyAbp.EShop.Plugins.StoreApproval.Application.Tests\EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Web", "src\EasyAbp.EShop.Plugins.StoreApproval.Web\EasyAbp.EShop.Plugins.StoreApproval.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.StoreApproval.Host.Shared", "host\EasyAbp.EShop.Plugins.StoreApproval.Host.Shared\EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{654F3755-D4A8-4C3A-9BB6-339D757EBC20}" - ProjectSection(SolutionItems) = preProject - common.props = common.props - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU - {077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} - {1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} - {F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} - EndGlobalSection -EndGlobal diff --git a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings b/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings deleted file mode 100644 index 8572f56c..00000000 --- a/plugins/StoreApproval/EasyAbp.EShop.Plugins.StoreApproval.sln.DotSettings +++ /dev/null @@ -1,25 +0,0 @@ - - True - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - WARNING - Required - Required - Required - Required - False - True - False - False - True - False - False - SQL - True - True - \ No newline at end of file diff --git a/plugins/StoreApproval/common.props b/plugins/StoreApproval/common.props deleted file mode 100644 index d9519ad8..00000000 --- a/plugins/StoreApproval/common.props +++ /dev/null @@ -1,30 +0,0 @@ - - - latest - 0.1.0 - $(NoWarn);CS1591 - module - true - EasyAbp Team - An abp application module group that provides basic e-shop service. - https://avatars3.githubusercontent.com/u/58311641?s=128 - https://github.com/EasyAbp/EShop - https://github.com/EasyAbp/EShop - abp module easyabp EShop shopping shop ordering product payment store mall - EasyAbp - MIT - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/docker-compose.migrations.yml b/plugins/StoreApproval/docker-compose.migrations.yml deleted file mode 100644 index c753f66f..00000000 --- a/plugins/StoreApproval/docker-compose.migrations.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '3.4' - -services: - migrations: - build: - context: ../../ - dockerfile: templates/service/database/Dockerfile - depends_on: - - sqlserver - environment: - - IdentityServer_DB=StoreApproval_Identity - - StoreApproval_DB=StoreApproval_ModuleDb - - SA_PASSWORD=yourStrong(!)Password diff --git a/plugins/StoreApproval/docker-compose.override.yml b/plugins/StoreApproval/docker-compose.override.yml deleted file mode 100644 index a9c8aece..00000000 --- a/plugins/StoreApproval/docker-compose.override.yml +++ /dev/null @@ -1,29 +0,0 @@ -version: '3.4' - -services: - sqlserver: - environment: - - SA_PASSWORD=yourStrong(!)Password - - ACCEPT_EULA=Y - ports: - - "51599:1433" - - identity-server: - environment: - - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionStrings__Default=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=StoreApproval_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - ports: - - "51600:80" - - store-approval: - environment: - - ASPNETCORE_URLS=http://0.0.0.0:80 - - ConnectionStrings__Default=Server=sqlserver;Database=StoreApproval_ModuleDb;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=StoreApproval_Identity;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - ConnectionStrings__SqlServerCache=Server=sqlserver;Database=StoreApproval_Cache;Trusted_Connection=True;MultipleActiveResultSets=true;User=sa;Password=yourStrong(!)Password;Integrated Security=false - - AuthServer__Authority=http://identity-server - ports: - - "51601:80" \ No newline at end of file diff --git a/plugins/StoreApproval/docker-compose.yml b/plugins/StoreApproval/docker-compose.yml deleted file mode 100644 index f327a3e6..00000000 --- a/plugins/StoreApproval/docker-compose.yml +++ /dev/null @@ -1,25 +0,0 @@ -version: '3.4' - -services: - sqlserver: - image: mcr.microsoft.com/mssql/server - volumes: - - dbdata:/var/opt/mssql - - identity-server: - build: - context: ../../ - dockerfile: templates/service/host/IdentityServerHost/Dockerfile - depends_on: - - sqlserver - - store-approval: - build: - context: ../../ - dockerfile: templates/service/host/EasyAbp.EShop.Plugins.StoreApproval.Host/Dockerfile - depends_on: - - sqlserver - - identity-server - -volumes: - dbdata: \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj deleted file mode 100644 index 79121eff..00000000 --- a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs deleted file mode 100644 index 2afcefc5..00000000 --- a/plugins/StoreApproval/host/EasyAbp.EShop.Plugins.StoreApproval.Host.Shared/MultiTenancy/MultiTenancyConsts.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.MultiTenancy -{ - public static class MultiTenancyConsts - { - /* Enable/disable multi-tenancy in a single point - * to test your module with multi-tenancy. - */ - public const bool IsEnabled = false; - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj deleted file mode 100644 index bca008da..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml deleted file mode 100644 index bd6def33..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs deleted file mode 100644 index 944dbb18..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissionDefinitionProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.Authorization.Permissions; -using Volo.Abp.Localization; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Permissions -{ - public class StoreApprovalPermissionDefinitionProvider : PermissionDefinitionProvider - { - public override void Define(IPermissionDefinitionContext context) - { - var myGroup = context.AddGroup(StoreApprovalPermissions.GroupName, L("Permission:StoreApproval")); - - var storeApplicationPermission = myGroup.AddPermission(StoreApprovalPermissions.StoreApplication.Default, L("Permission:StoreApplication")); - storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Create, L("Permission:Create")); - storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Update, L("Permission:Update")); - storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Delete, L("Permission:Delete")); - storeApplicationPermission.AddChild(StoreApprovalPermissions.StoreApplication.Approval, L("Permission:Approval")); - } - - private static LocalizableString L(string name) - { - return LocalizableString.Create(name); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs deleted file mode 100644 index c526c6da..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/Permissions/StoreApprovalPermissions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Volo.Abp.Reflection; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Permissions -{ - public class StoreApprovalPermissions - { - public const string GroupName = "StoreApproval"; - - public static string[] GetAll() - { - return ReflectionHelper.GetPublicConstantsRecursively(typeof(StoreApprovalPermissions)); - } - - public class StoreApplication - { - public const string Default = GroupName + ".StoreApplication"; - public const string Update = Default + ".Update"; - public const string Create = Default + ".Create"; - public const string Delete = Default + ".Delete"; - public const string Approval = Default + ".Approval"; - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs deleted file mode 100644 index bbad0b85..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/CreateUpdateStoreApplicationDto.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using Volo.Abp.Validation; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos -{ - [Serializable] - public class CreateStoreApplicationDto : UpdateStoreApplicationDto - { - [Required] - public Guid ApplicantId { get; set; } - } - - [Serializable] - public class UpdateStoreApplicationDto - { - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string StoreName { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string BusinessCategory { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxAddressLength))] - public string Address { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string UnifiedCreditCode { get; set; } - - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string HouseNumber { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] - public string BusinessLicenseImage { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string Name { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNameLength))] - public string IdNumber { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] - public string IdCardFrontImage { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] - public string IdCardBackImage { get; set; } - - [Required] - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxImageResourcesLength))] - public string StoreImage { get; set; } - - [DynamicMaxLength(typeof(StoreApplicationConsts), nameof(StoreApplicationConsts.MaxNoteLength))] - public string Note { get; set; } - } - -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs deleted file mode 100644 index 8d89b5d6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/GetStoreApplicationListDto.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos -{ - public class GetStoreApplicationListDto : PagedAndSortedResultRequestDto - { - public Guid? ApplicantId { get; set; } - - public string StoreName { get; set; } - - public string BusinessCategory { get; protected set; } - - public string UnifiedCreditCode { get; protected set; } - - public string Name { get; protected set; } - - public string IdNumber { get; protected set; } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs deleted file mode 100644 index add16dab..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/Dtos/StoreApplicationDto.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos -{ - [Serializable] - public class StoreApplicationDto : FullAuditedEntityDto - { - public Guid ApplicantId { get; set; } - - public ApprovalStatusType ApprovalStatus { get; set; } - - public string StoreName { get; set; } - - public string BusinessCategory { get; set; } - - public string Address { get; set; } - - public string UnifiedCreditCode { get; set; } - - public string HouseNumber { get; set; } - - public string BusinessLicenseImage { get; set; } - - public string Name { get; set; } - - public string IdNumber { get; set; } - - public string IdCardFrontImage { get; set; } - - public string IdCardBackImage { get; set; } - - public string StoreImage { get; set; } - - public string Note { get; set; } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs deleted file mode 100644 index 08d8b37d..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApplications/IStoreApplicationAppService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public interface IStoreApplicationAppService : - ICrudAppService< - StoreApplicationDto, - Guid, - GetStoreApplicationListDto, - CreateStoreApplicationDto, - UpdateStoreApplicationDto> - { - Task SubmitAsync(Guid id); - - Task ApproveAsync(Guid id); - - Task RejectAsync(Guid id); - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs deleted file mode 100644 index d41877b2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application.Contracts/StoreApprovalApplicationContractsModule.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Volo.Abp.Application; -using Volo.Abp.Modularity; -using Volo.Abp.Authorization; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalDomainSharedModule), - typeof(AbpDddApplicationContractsModule), - typeof(AbpAuthorizationModule) - )] - public class StoreApprovalApplicationContractsModule : AbpModule - { - - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj deleted file mode 100644 index 8903c456..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/EasyAbp.EShop.Plugins.StoreApproval.Application.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs deleted file mode 100644 index 234be2aa..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApplications/StoreApplicationAppService.cs +++ /dev/null @@ -1,118 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.Permissions; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using System; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.Identity; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationAppService : CrudAppService, - IStoreApplicationAppService - { - protected IdentityUserManager UserManager; - protected override string GetPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Default; - protected override string GetListPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Default; - protected override string CreatePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Create; - protected override string UpdatePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Update; - protected override string DeletePolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Delete; - protected virtual string ApprovalPolicyName { get; set; } = StoreApprovalPermissions.StoreApplication.Approval; - - public StoreApplicationAppService(IRepository repository, - IdentityUserManager userManager) : base(repository) - { - UserManager = userManager; - } - - protected override IQueryable CreateFilteredQuery(GetStoreApplicationListDto input) - { - var queryable = base.CreateFilteredQuery(input); - - if (input.ApplicantId.HasValue) - { - queryable = queryable.Where(x => x.ApplicantId == input.ApplicantId.Value); - } - - if (!input.Name.IsNullOrWhiteSpace()) - { - queryable = queryable.Where(x => x.Name == input.Name); - } - - if (!input.StoreName.IsNullOrWhiteSpace()) - { - queryable = queryable.Where(x => x.StoreName == input.StoreName); - } - - if (!input.BusinessCategory.IsNullOrWhiteSpace()) - { - queryable = queryable.Where(x => x.BusinessCategory == input.BusinessCategory); - } - - if (!input.IdNumber.IsNullOrWhiteSpace()) - { - queryable = queryable.Where(x => x.IdNumber == input.IdNumber); - } - - if (!input.UnifiedCreditCode.IsNullOrWhiteSpace()) - { - queryable = queryable.Where(x => x.UnifiedCreditCode == input.UnifiedCreditCode); - } - - return queryable; - } - - public override async Task CreateAsync(CreateStoreApplicationDto input) - { - await CheckCreatePolicyAsync(); - - var user = await UserManager.GetByIdAsync(input.ApplicantId); - - var entity = MapToEntity(input); - - TryToSetTenantId(entity); - - await Repository.InsertAsync(entity, autoSave: true); - - return MapToGetOutputDto(entity); - } - - public async Task SubmitAsync(Guid id) - { - await CheckCreatePolicyAsync(); - - var entity = await GetEntityByIdAsync(id); - entity.Submit(); - - await Repository.UpdateAsync(entity); - - return ObjectMapper.Map(entity); - } - - public async Task ApproveAsync(Guid id) - { - await CheckPolicyAsync(ApprovalPolicyName); - - var entity = await GetEntityByIdAsync(id); - entity.Approve(); - - await Repository.UpdateAsync(entity); - - return ObjectMapper.Map(entity); - } - - public async Task RejectAsync(Guid id) - { - await CheckPolicyAsync(ApprovalPolicyName); - - var entity = await GetEntityByIdAsync(id); - entity.Reject(); - - await Repository.UpdateAsync(entity); - - return ObjectMapper.Map(entity); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs deleted file mode 100644 index cc5eb9b7..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalAppService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public abstract class StoreApprovalAppService : ApplicationService - { - protected StoreApprovalAppService() - { - LocalizationResource = typeof(StoreApprovalResource); - ObjectMapperContext = typeof(StoreApprovalApplicationModule); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs deleted file mode 100644 index a1f6cab9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationAutoMapperProfile.cs +++ /dev/null @@ -1,19 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using AutoMapper; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public class StoreApprovalApplicationAutoMapperProfile : Profile - { - public StoreApprovalApplicationAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(MemberList.Source); - CreateMap(MemberList.Source); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs deleted file mode 100644 index d1bb4c05..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Application/StoreApprovalApplicationModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.Application; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalDomainModule), - typeof(StoreApprovalApplicationContractsModule), - typeof(AbpDddApplicationModule), - typeof(AbpAutoMapperModule) - )] - public class StoreApprovalApplicationModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddMaps(validate: true); - }); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj deleted file mode 100644 index d478ff43..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - true - - - - - - - - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json deleted file mode 100644 index c6271538..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/cs.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "culture": "cs", - "texts": { - "ManageYourProfile": "Spravovat profil", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json deleted file mode 100644 index 8d4fc4b6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/en.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "culture": "en", - "texts": { - "ManageYourProfile": "Manage your profile", - "SamplePageMessage": "A sample page for the StoreApproval module", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json deleted file mode 100644 index 4cb155d4..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pl-PL.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "culture": "pl-PL", - "texts": { - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json deleted file mode 100644 index faf80305..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/pt-BR.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "culture": "pt-BR", - "texts": { - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json deleted file mode 100644 index 6b4e8b9b..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/sl.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "culture": "sl", - "texts": { - "ManageYourProfile": "Upravljajte svojim profilom", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json deleted file mode 100644 index 74815d15..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/tr.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "culture": "tr", - "texts": { - "ManageYourProfile": "Profil yönetimi", - "SamplePageMessage": "StoreApproval modulünden örnek bir sayfa", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json deleted file mode 100644 index ced4802f..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/vi.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "culture": "vi", - "texts": { - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json deleted file mode 100644 index 05987cbc..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hans.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "culture": "zh-Hans", - "texts": { - "ManageYourProfile": "管理个人资料", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json deleted file mode 100644 index f04735e8..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApproval/zh-Hant.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "culture": "zh-Hant", - "texts": { - "ManageYourProfile": "管理個人資料", - "Permission:StoreApplication": "StoreApplication", - "Permission:Create": "Create", - "Permission:Update": "Update", - "Permission:Delete": "Delete", - "Permission:Approval": "Approval", - "Menu:StoreApplication": "MenuStoreApplication", - "StoreApplication": "StoreApplication", - "StoreApplicationApplicantId": "StoreApplicationApplicantId", - "StoreApplicationApprovalStatus": "StoreApplicationApprovalStatus", - "StoreApplicationStoreName": "StoreApplicationStoreName", - "StoreApplicationBusinessCategory": "StoreApplicationBusinessCategory", - "StoreApplicationAddress": "StoreApplicationAddress", - "StoreApplicationUnifiedCreditCode": "StoreApplicationUnifiedCreditCode", - "StoreApplicationHouseNumber": "StoreApplicationHouseNumber", - "StoreApplicationBusinessLicenseImage": "StoreApplicationBusinessLicenseImage", - "StoreApplicationName": "StoreApplicationName", - "StoreApplicationIdNumber": "StoreApplicationIdNumber", - "StoreApplicationIdCardFrontImage": "StoreApplicationIdCardFrontImage", - "StoreApplicationIdCardBackImage": "StoreApplicationIdCardBackImage", - "StoreApplicationStoreImage": "StoreApplicationStoreImage", - "StoreApplicationNote": "StoreApplicationNote", - "CreateStoreApplication": "CreateStoreApplication", - "EditStoreApplication": "EditStoreApplication", - "StoreApplicationDeletionConfirmationMessage": "Are you sure to delete the storeApplication {0}?", - "SuccessfullyDeleted": "Successfully deleted" - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs deleted file mode 100644 index 2154af53..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/Localization/StoreApprovalResource.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Volo.Abp.Localization; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Localization -{ - [LocalizationResourceName("StoreApproval")] - public class StoreApprovalResource - { - - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs deleted file mode 100644 index 1287a974..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/ApprovalStatusType.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public enum ApprovalStatusType - { - Preparing, - - ReadyForReview, - - Rejected, - - Approved, - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs deleted file mode 100644 index b12397d3..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApplications/StoreApplicationConsts.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public static class StoreApplicationConsts - { - public static int MaxNameLength { get; set; } = 32; - - public static int MaxAddressLength { get; set; } = 128; - - public static int MaxImageResourcesLength { get; set; } = 64; - - public static int MaxNoteLength { get; set; } = 1024; - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs deleted file mode 100644 index ade9b92f..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalDomainSharedModule.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Volo.Abp.Modularity; -using Volo.Abp.Localization; -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.Localization.ExceptionHandling; -using Volo.Abp.Validation; -using Volo.Abp.Validation.Localization; -using Volo.Abp.VirtualFileSystem; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(AbpValidationModule) - )] - public class StoreApprovalDomainSharedModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - Configure(options => - { - options.Resources - .Add("en") - .AddBaseTypes(typeof(AbpValidationResource)) - .AddVirtualJson("/Localization/StoreApproval"); - }); - - Configure(options => - { - options.MapCodeNamespace("StoreApproval", typeof(StoreApprovalResource)); - }); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs deleted file mode 100644 index 1a8dd2a7..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain.Shared/StoreApprovalErrorCodes.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public static class StoreApprovalErrorCodes - { - public const string Namespace = "EasyAbp.EShop.Plugins.StoreApproval"; - - public const string AlreadySubmitted = Namespace + ":" + "000001"; - public const string AlreadyApproved = Namespace + ":" + "000002"; - public const string NotSubmitted = Namespace + ":" + "000003"; - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj deleted file mode 100644 index ab0263a4..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/EasyAbp.EShop.Plugins.StoreApproval.Domain.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs deleted file mode 100644 index b4bab658..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettingDefinitionProvider.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.Settings; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Settings -{ - public class StoreApprovalSettingDefinitionProvider : SettingDefinitionProvider - { - public override void Define(ISettingDefinitionContext context) - { - /* Define module settings here. - * Use names from StoreApprovalSettings class. - */ - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs deleted file mode 100644 index b1a9cf84..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/Settings/StoreApprovalSettings.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.Settings -{ - public static class StoreApprovalSettings - { - public const string GroupName = "StoreApproval"; - - /* Add constants for setting names. Example: - * public const string MySettingName = GroupName + ".MySettingName"; - */ - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs deleted file mode 100644 index e1dea6d8..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/IStoreApplicationRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public interface IStoreApplicationRepository : IRepository - { - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs deleted file mode 100644 index 735e7217..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplication.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplication : FullAuditedAggregateRoot, IMultiTenant - { - public virtual Guid? TenantId { get; protected set; } - - public virtual Guid ApplicantId { get; protected set; } - - public virtual ApprovalStatusType ApprovalStatus { get; protected set; } - - [NotNull] - public virtual string StoreName { get; protected set; } - - [NotNull] - public virtual string BusinessCategory { get; protected set; } - - [NotNull] - public virtual string Address { get; protected set; } - - [NotNull] - public virtual string UnifiedCreditCode { get; protected set; } - - [CanBeNull] - public virtual string HouseNumber { get; protected set; } - - [NotNull] - public virtual string BusinessLicenseImage { get; protected set; } - - [NotNull] - public virtual string Name { get; protected set; } - - [NotNull] - public virtual string IdNumber { get; protected set; } - - [NotNull] - public virtual string IdCardFrontImage { get; protected set; } - - [NotNull] - public virtual string IdCardBackImage { get; protected set; } - - [NotNull] - public virtual string StoreImage { get; protected set; } - - [CanBeNull] - public virtual string Note { get; protected set; } - - protected StoreApplication() - { - } - - public StoreApplication(Guid id, Guid? tenantId, Guid applicantId, ApprovalStatusType approvalStatus, string storeName, string businessCategory, string address, string unifiedCreditCode, string houseNumber, string businessLicenseImage, string name, string idNumber, string idCardFrontImage, string idCardBackImage, string storeImage, string note) : base(id) - { - TenantId = tenantId; - ApplicantId = applicantId; - ApprovalStatus = approvalStatus; - StoreName = storeName; - BusinessCategory = businessCategory; - Address = address; - UnifiedCreditCode = unifiedCreditCode; - HouseNumber = houseNumber; - BusinessLicenseImage = businessLicenseImage; - Name = name; - IdNumber = idNumber; - IdCardFrontImage = idCardFrontImage; - IdCardBackImage = idCardBackImage; - StoreImage = storeImage; - Note = note; - } - - public void Submit() - { - switch (ApprovalStatus) - { - case ApprovalStatusType.Preparing: - case ApprovalStatusType.Rejected: - ApprovalStatus = ApprovalStatusType.ReadyForReview; - //TODO event - break; - case ApprovalStatusType.ReadyForReview: - throw new StoreApplicationAlreadySubmittedException(); - case ApprovalStatusType.Approved: - throw new StoreApplicationAlreadyApprovedException(); - default: - throw new ArgumentOutOfRangeException(); - } - } - - public void Approve() - { - switch (ApprovalStatus) - { - case ApprovalStatusType.ReadyForReview: - ApprovalStatus = ApprovalStatusType.Approved; - //TODO event - break; - case ApprovalStatusType.Preparing: - case ApprovalStatusType.Rejected: - throw new StoreApplicationNotSubmittedException(); - case ApprovalStatusType.Approved: - throw new StoreApplicationAlreadyApprovedException(); - default: - throw new ArgumentOutOfRangeException(); - } - } - - public void Reject() - { - switch (ApprovalStatus) - { - case ApprovalStatusType.ReadyForReview: - ApprovalStatus = ApprovalStatusType.Rejected; - //TODO event - break; - case ApprovalStatusType.Preparing: - case ApprovalStatusType.Rejected: - throw new StoreApplicationNotSubmittedException(); - case ApprovalStatusType.Approved: - throw new StoreApplicationAlreadyApprovedException(); - default: - throw new ArgumentOutOfRangeException(); - } - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs deleted file mode 100644 index f0e1ea8d..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadyApprovedException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationAlreadyApprovedException : BusinessException - { - public StoreApplicationAlreadyApprovedException() - :base(StoreApprovalErrorCodes.AlreadyApproved) - { - - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs deleted file mode 100644 index 08d65acb..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationAlreadySubmittedException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationAlreadySubmittedException : BusinessException - { - public StoreApplicationAlreadySubmittedException() - : base(StoreApprovalErrorCodes.AlreadySubmitted) - { - - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs deleted file mode 100644 index eb2e24f0..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationNotSubmittedException.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationNotSubmittedException : BusinessException - { - public StoreApplicationNotSubmittedException() - : base(StoreApprovalErrorCodes.NotSubmitted) - { - - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs deleted file mode 100644 index e6eedabe..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApplications/StoreApplicationUpdatedEventHandler.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Stores; -using Microsoft.AspNetCore.Identity; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities.Events; -using Volo.Abp.EventBus; -using Volo.Abp.Guids; -using Volo.Abp.Identity; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationUpdatedEventHandler - : ILocalEventHandler>, - ITransientDependency - { - private readonly IStoreManager _storeManager; - private readonly IGuidGenerator _guidGenerator; - private readonly ICurrentTenant _currentTenant; - private readonly IdentityUserManager _userManager; - - public StoreApplicationUpdatedEventHandler(IStoreManager storeManager, - IGuidGenerator guidGenerator, - ICurrentTenant currentTenant, - IdentityUserManager userManager) - { - _storeManager = storeManager; - _guidGenerator = guidGenerator; - _currentTenant = currentTenant; - _userManager = userManager; - } - - public async Task HandleEventAsync( - EntityUpdatedEventData eventData) - { - switch (eventData.Entity.ApprovalStatus) - { - case ApprovalStatusType.Preparing: - case ApprovalStatusType.ReadyForReview: - case ApprovalStatusType.Rejected: - break; - case ApprovalStatusType.Approved: - await CreateStore(eventData.Entity.StoreName, eventData.Entity.ApplicantId); - break; - default: - throw new ArgumentOutOfRangeException(); - } - } - - private async Task CreateStore(string storeName, Guid userId) - { - const string merchant = nameof(merchant); - - var user = await _userManager.GetByIdAsync(userId); - - var store = await _storeManager.CreateAsync(new Store( - _guidGenerator.Create(), - _currentTenant.Id, - storeName), new []{ userId }); - - (await _userManager.SetRolesAsync(user, new []{ merchant })).CheckErrors(); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs deleted file mode 100644 index 4ec63638..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDbProperties.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public static class StoreApprovalDbProperties - { - public static string DbTablePrefix { get; set; } = "StoreApproval"; - - public static string DbSchema { get; set; } = null; - - public const string ConnectionStringName = "StoreApproval"; - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs deleted file mode 100644 index 109dc1ce..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Domain/StoreApprovalDomainModule.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalDomainSharedModule) - )] - public class StoreApprovalDomainModule : AbpModule - { - - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj deleted file mode 100644 index 67bb7fac..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs deleted file mode 100644 index 3903b575..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/IStoreApprovalDbContext.cs +++ /dev/null @@ -1,16 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] - public interface IStoreApprovalDbContext : IEfCoreDbContext - { - /* Add DbSet for each Aggregate Root here. Example: - * DbSet Questions { get; } - */ - DbSet StoreApplications { get; set; } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs deleted file mode 100644 index 6283c96b..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContext.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Volo.Abp.Data; -using Volo.Abp.EntityFrameworkCore; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] - public class StoreApprovalDbContext : AbpDbContext, IStoreApprovalDbContext - { - /* Add DbSet for each Aggregate Root here. Example: - * public DbSet Questions { get; set; } - */ - public DbSet StoreApplications { get; set; } - - public StoreApprovalDbContext(DbContextOptions options) - : base(options) - { - - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - - builder.ConfigureStoreApproval(); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs deleted file mode 100644 index d5b5245e..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalDbContextModelCreatingExtensions.cs +++ /dev/null @@ -1,54 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using System; -using Microsoft.EntityFrameworkCore; -using Volo.Abp; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - public static class StoreApprovalDbContextModelCreatingExtensions - { - public static void ConfigureStoreApproval( - this ModelBuilder builder, - Action optionsAction = null) - { - Check.NotNull(builder, nameof(builder)); - - var options = new StoreApprovalModelBuilderConfigurationOptions( - StoreApprovalDbProperties.DbTablePrefix, - StoreApprovalDbProperties.DbSchema - ); - - optionsAction?.Invoke(options); - - /* Configure all entities here. Example: - - builder.Entity(b => - { - //Configure table & schema name - b.ToTable(options.TablePrefix + "Questions", options.Schema); - - b.ConfigureByConvention(); - - //Properties - b.Property(q => q.Title).IsRequired().HasMaxLength(QuestionConsts.MaxTitleLength); - - //Relations - b.HasMany(question => question.Tags).WithOne().HasForeignKey(qt => qt.QuestionId); - - //Indexes - b.HasIndex(q => q.CreationTime); - }); - */ - - - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "StoreApplications", options.Schema); - b.ConfigureByConvention(); - - /* Configure more properties here */ - }); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs deleted file mode 100644 index 1d98af3b..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreModule.cs +++ /dev/null @@ -1,26 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - [DependsOn( - typeof(StoreApprovalDomainModule), - typeof(AbpEntityFrameworkCoreModule) - )] - public class StoreApprovalEntityFrameworkCoreModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAbpDbContext(options => - { - /* Add custom repositories here. Example: - * options.AddRepository(); - */ - - options.AddRepository(); - }); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs deleted file mode 100644 index 49fb4601..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/EntityFrameworkCore/StoreApprovalModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.EntityFrameworkCore.Modeling; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - public class StoreApprovalModelBuilderConfigurationOptions : AbpModelBuilderConfigurationOptions - { - public StoreApprovalModelBuilderConfigurationOptions( - [NotNull] string tablePrefix = "", - [CanBeNull] string schema = null) - : base( - tablePrefix, - schema) - { - - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs deleted file mode 100644 index eb6652a6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore/StoreApplications/EfCoreStoreApplicationRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore; -using System; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class EfCoreStoreApplicationRepository : EfCoreRepository, IStoreApplicationRepository - { - public EfCoreStoreApplicationRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj deleted file mode 100644 index fab85913..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netstandard2.0 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs deleted file mode 100644 index d6b739f8..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client/StoreApprovalHttpApiClientModule.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Http.Client; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalApplicationContractsModule), - typeof(AbpHttpClientModule))] - public class StoreApprovalHttpApiClientModule : AbpModule - { - public const string RemoteServiceName = "StoreApproval"; - - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddHttpClientProxies( - typeof(StoreApprovalApplicationContractsModule).Assembly, - RemoteServiceName - ); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj deleted file mode 100644 index fce884bd..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs deleted file mode 100644 index 076e8c32..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApplications/StoreApplicationController.cs +++ /dev/null @@ -1,75 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using Volo.Abp.Application.Dtos; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - [RemoteService(Name = "StoreApprovalStoreApplication")] - [Route("/api/eShop/storeApproval/storeApplication")] - public class StoreApplicationController : StoreApprovalController, IStoreApplicationAppService - { - private readonly IStoreApplicationAppService _service; - - public StoreApplicationController(IStoreApplicationAppService service) - { - _service = service; - } - - [HttpGet] - [Route("{id}")] - public virtual Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - [HttpGet] - public virtual Task> GetListAsync(GetStoreApplicationListDto input) - { - return _service.GetListAsync(input); - } - - [HttpPost] - public virtual Task CreateAsync(CreateStoreApplicationDto input) - { - return _service.CreateAsync(input); - } - - [HttpPut] - [Route("{id}")] - public virtual Task UpdateAsync(Guid id, UpdateStoreApplicationDto input) - { - return _service.UpdateAsync(id, input); - } - - [HttpDelete] - [Route("{id}")] - public virtual Task DeleteAsync(Guid id) - { - return _service.DeleteAsync(id); - } - - [HttpPost] - [Route("{id}/submit")] - public virtual Task SubmitAsync(Guid id) - { - return _service.SubmitAsync(id); - } - - [HttpPost] - [Route("{id}/approve")] - public virtual Task ApproveAsync(Guid id) - { - return _service.ApproveAsync(id); - } - - [HttpPost] - [Route("{id}/reject")] - public virtual Task RejectAsync(Guid id) - { - return _service.RejectAsync(id); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs deleted file mode 100644 index ae77fa33..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalController.cs +++ /dev/null @@ -1,13 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.AspNetCore.Mvc; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public abstract class StoreApprovalController : AbpController - { - protected StoreApprovalController() - { - LocalizationResource = typeof(StoreApprovalResource); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs deleted file mode 100644 index 15809319..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.HttpApi/StoreApprovalHttpApiModule.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Localization.Resources.AbpUi; -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.AspNetCore.Mvc; -using Volo.Abp.Localization; -using Volo.Abp.Modularity; -using Microsoft.Extensions.DependencyInjection; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalApplicationContractsModule), - typeof(AbpAspNetCoreMvcModule))] - public class StoreApprovalHttpApiModule : AbpModule - { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(StoreApprovalHttpApiModule).Assembly); - }); - } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.Resources - .Get() - .AddBaseTypes(typeof(AbpUiResource)); - }); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj deleted file mode 100644 index 57314e99..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml deleted file mode 100644 index 00e1d9a1..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs deleted file mode 100644 index 37a35ac2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/IStoreApprovalMongoDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Data; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] - public interface IStoreApprovalMongoDbContext : IAbpMongoDbContext - { - /* Define mongo collections here. Example: - * IMongoCollection Questions { get; } - */ - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs deleted file mode 100644 index d46fd9a3..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContext.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Volo.Abp.Data; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - [ConnectionStringName(StoreApprovalDbProperties.ConnectionStringName)] - public class StoreApprovalMongoDbContext : AbpMongoDbContext, IStoreApprovalMongoDbContext - { - /* Add mongo collections here. Example: - * public IMongoCollection Questions => Collection(); - */ - - protected override void CreateModel(IMongoModelBuilder modelBuilder) - { - base.CreateModel(modelBuilder); - - modelBuilder.ConfigureStoreApproval(); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs deleted file mode 100644 index 9778a881..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbContextExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Volo.Abp; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - public static class StoreApprovalMongoDbContextExtensions - { - public static void ConfigureStoreApproval( - this IMongoModelBuilder builder, - Action optionsAction = null) - { - Check.NotNull(builder, nameof(builder)); - - var options = new StoreApprovalMongoModelBuilderConfigurationOptions( - StoreApprovalDbProperties.DbTablePrefix - ); - - optionsAction?.Invoke(options); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs deleted file mode 100644 index d951e3c6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoDbModule.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Modularity; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - [DependsOn( - typeof(StoreApprovalDomainModule), - typeof(AbpMongoDbModule) - )] - public class StoreApprovalMongoDbModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddMongoDbContext(options => - { - /* Add custom repositories here. Example: - * options.AddRepository(); - */ - }); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs deleted file mode 100644 index ce957c4e..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.MongoDB/MongoDB/StoreApprovalMongoModelBuilderConfigurationOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using JetBrains.Annotations; -using Volo.Abp.MongoDB; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - public class StoreApprovalMongoModelBuilderConfigurationOptions : AbpMongoModelBuilderConfigurationOptions - { - public StoreApprovalMongoModelBuilderConfigurationOptions( - [NotNull] string collectionPrefix = "") - : base(collectionPrefix) - { - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj deleted file mode 100644 index 344202a2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/EasyAbp.EShop.Plugins.StoreApproval.Web.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - netcoreapp3.1 - $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; - true - Library - EasyAbp.EShop.Plugins.StoreApproval.Web - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs deleted file mode 100644 index b4ca5328..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenuContributor.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using EasyAbp.EShop.Plugins.StoreApproval.Permissions; -using Volo.Abp.UI.Navigation; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Menus -{ - public class StoreApprovalMenuContributor : IMenuContributor - { - public async Task ConfigureMenuAsync(MenuConfigurationContext context) - { - if (context.Menu.Name == StandardMenus.Main) - { - await ConfigureMainMenu(context); - } - } - - private async Task ConfigureMainMenu(MenuConfigurationContext context) - { - var l = context.GetLocalizer(); - //Add main menu items. - - if (await context.IsGrantedAsync(StoreApprovalPermissions.StoreApplication.Default)) - { - context.Menu.AddItem( - new ApplicationMenuItem("StoreApplication", l["Menu:StoreApplication"], "/StoreApproval/StoreApplications/StoreApplication") - ); - } - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs deleted file mode 100644 index 505b82b6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Menus/StoreApprovalMenus.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Menus -{ - public class StoreApprovalMenus - { - private const string Prefix = "StoreApproval"; - - //Add your menu items here... - //public const string Home = Prefix + ".MyNewMenuItem"; - - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml deleted file mode 100644 index cb63a652..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml +++ /dev/null @@ -1,9 +0,0 @@ -@page -@using Microsoft.Extensions.Localization -@using EasyAbp.EShop.Plugins.StoreApproval.Localization -@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.IndexModel -@inject IStringLocalizer L -@{ -} -

StoreApproval

-

@L["SamplePageMessage"]

diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs deleted file mode 100644 index 82edeb48..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/Index.cshtml.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval -{ - public class IndexModel : StoreApprovalPageModel - { - public void OnGet() - { - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml deleted file mode 100644 index ac8353dd..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml +++ /dev/null @@ -1,18 +0,0 @@ -@page -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; -@using EasyAbp.EShop.Plugins.StoreApproval.Localization -@inject IHtmlLocalizer L -@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.CreateModalModel -@{ - Layout = null; -} - - - - - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs deleted file mode 100644 index 316bc9c0..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/CreateModal.cshtml.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication -{ - public class CreateModalModel : StoreApprovalPageModel - { - [BindProperty] - public CreateStoreApplicationViewModel ViewModel { get; set; } - - private readonly IStoreApplicationAppService _service; - - public CreateModalModel(IStoreApplicationAppService service) - { - _service = service; - } - - public virtual async Task OnPostAsync() - { - var dto = ObjectMapper.Map(ViewModel); - await _service.CreateAsync(dto); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml deleted file mode 100644 index 6604d450..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml +++ /dev/null @@ -1,19 +0,0 @@ -@page -@using EasyAbp.EShop.Plugins.StoreApproval.Localization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; -@inject IHtmlLocalizer L -@model EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.EditModalModel -@{ - Layout = null; -} - - - - - - - - - - diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs deleted file mode 100644 index 0e2d2251..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/EditModal.cshtml.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication -{ - public class EditModalModel : StoreApprovalPageModel - { - [HiddenInput] - [BindProperty(SupportsGet = true)] - public Guid Id { get; set; } - - [BindProperty] - public EditStoreApplicationViewModel ViewModel { get; set; } - - private readonly IStoreApplicationAppService _service; - - public EditModalModel(IStoreApplicationAppService service) - { - _service = service; - } - - public virtual async Task OnGetAsync() - { - var dto = await _service.GetAsync(Id); - ViewModel = ObjectMapper.Map(dto); - } - - public virtual async Task OnPostAsync() - { - var dto = ObjectMapper.Map(ViewModel); - await _service.UpdateAsync(Id, dto); - return NoContent(); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml deleted file mode 100644 index a51241d6..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml +++ /dev/null @@ -1,67 +0,0 @@ -@page -@using EasyAbp.EShop.Plugins.StoreApproval.Permissions -@using Microsoft.AspNetCore.Authorization -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Layout -@using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication -@using EasyAbp.EShop.Plugins.StoreApproval.Localization -@model IndexModel -@inject IPageLayout PageLayout -@inject IHtmlLocalizer L -@inject IAuthorizationService Authorization -@{ - PageLayout.Content.Title = L["StoreApplication"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:StoreApplication"].Value); - PageLayout.Content.MenuItemName = "StoreApplication"; -} - -@section scripts -{ - -} -@section styles -{ - -} - - - - - - @L["StoreApplication"] - - - @if (await Authorization.IsGrantedAsync(StoreApprovalPermissions.StoreApplication.Create)) - { - - } - - - - - - - - @L["Actions"] - @L["StoreApplicationApplicantId"] - @L["StoreApplicationApprovalStatus"] - @L["StoreApplicationStoreName"] - @L["StoreApplicationBusinessCategory"] - @L["StoreApplicationAddress"] - @L["StoreApplicationUnifiedCreditCode"] - @L["StoreApplicationHouseNumber"] - @L["StoreApplicationBusinessLicenseImage"] - @L["StoreApplicationName"] - @L["StoreApplicationIdNumber"] - @L["StoreApplicationIdCardFrontImage"] - @L["StoreApplicationIdCardBackImage"] - @L["StoreApplicationStoreImage"] - @L["StoreApplicationNote"] - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs deleted file mode 100644 index f2f427cc..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication -{ - public class IndexModel : StoreApprovalPageModel - { - public virtual async Task OnGetAsync() - { - await Task.CompletedTask; - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs deleted file mode 100644 index 2487a804..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/ViewModels/CreateEditStoreApplicationViewModel.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels -{ - public class CreateStoreApplicationViewModel : EditStoreApplicationViewModel - { - [Display(Name = "StoreApplicationApplicantId")] - public Guid ApplicantId { get; set; } - } - - public class EditStoreApplicationViewModel - { - [Display(Name = "StoreApplicationApplicantId")] - public Guid ApplicantId { get; set; } - - [Display(Name = "StoreApplicationStoreName")] - public string StoreName { get; set; } - - [Display(Name = "StoreApplicationBusinessCategory")] - public string BusinessCategory { get; set; } - - [Display(Name = "StoreApplicationAddress")] - public string Address { get; set; } - - [Display(Name = "StoreApplicationUnifiedCreditCode")] - public string UnifiedCreditCode { get; set; } - - [Display(Name = "StoreApplicationHouseNumber")] - public string HouseNumber { get; set; } - - [Display(Name = "StoreApplicationBusinessLicenseImage")] - public string BusinessLicenseImage { get; set; } - - [Display(Name = "StoreApplicationName")] - public string Name { get; set; } - - [Display(Name = "StoreApplicationIdNumber")] - public string IdNumber { get; set; } - - [Display(Name = "StoreApplicationIdCardFrontImage")] - public string IdCardFrontImage { get; set; } - - [Display(Name = "StoreApplicationIdCardBackImage")] - public string IdCardBackImage { get; set; } - - [Display(Name = "StoreApplicationStoreImage")] - public string StoreImage { get; set; } - - [Display(Name = "StoreApplicationNote")] - public string Note { get; set; } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js deleted file mode 100644 index 922de5e1..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/StoreApplications/StoreApplication/index.js +++ /dev/null @@ -1,76 +0,0 @@ -$(function () { - - var l = abp.localization.getResource('StoreApproval'); - - var service = easyAbp.eShop.plugins.storeApproval.storeApplications.storeApplication; - var createModal = new abp.ModalManager(abp.appPath + 'StoreApproval/StoreApplications/StoreApplication/CreateModal'); - var editModal = new abp.ModalManager(abp.appPath + 'StoreApproval/StoreApplications/StoreApplication/EditModal'); - - var dataTable = $('#StoreApplicationTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList), - columnDefs: [ - { - rowAction: { - items: - [ - { - text: l('Edit'), - visible: abp.auth.isGranted('StoreApproval.StoreApplication.Update'), - action: function (data) { - editModal.open({ id: data.record.id }); - } - }, - { - text: l('Delete'), - visible: abp.auth.isGranted('StoreApproval.StoreApplication.Delete'), - confirmMessage: function (data) { - return l('StoreApplicationDeletionConfirmationMessage', data.record.id); - }, - action: function (data) { - service.delete(data.record.id) - .then(function () { - abp.notify.info(l('SuccessfullyDeleted')); - dataTable.ajax.reload(); - }); - } - } - ] - } - }, - { data: "applicantId" }, - { data: "approvalStatus" }, - { data: "storeName" }, - { data: "businessCategory" }, - { data: "address" }, - { data: "unifiedCreditCode" }, - { data: "houseNumber" }, - { data: "businessLicenseImage" }, - { data: "name" }, - { data: "idNumber" }, - { data: "idCardFrontImage" }, - { data: "idCardBackImage" }, - { data: "storeImage" }, - { data: "note" }, - ] - })); - - createModal.onResult(function () { - dataTable.ajax.reload(); - }); - - editModal.onResult(function () { - dataTable.ajax.reload(); - }); - - $('#NewStoreApplicationButton').click(function (e) { - e.preventDefault(); - createModal.open(); - }); -}); \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml deleted file mode 100644 index c1da1f5f..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApproval/_ViewImports.cshtml +++ /dev/null @@ -1,4 +0,0 @@ -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bootstrap -@addTagHelper *, Volo.Abp.AspNetCore.Mvc.UI.Bundling \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs deleted file mode 100644 index 9ffc9e7f..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Pages/StoreApprovalPageModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web.Pages -{ - /* Inherit your PageModel classes from this class. - */ - public abstract class StoreApprovalPageModel : AbpPageModel - { - protected StoreApprovalPageModel() - { - LocalizationResourceType = typeof(StoreApprovalResource); - ObjectMapperContext = typeof(StoreApprovalWebModule); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json deleted file mode 100644 index 610ee0c0..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/Properties/launchSettings.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:5733/", - "sslPort": 44304 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "EasyAbp.EShop.Plugins.StoreApproval.Web": { - "commandName": "Project", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - }, - "applicationUrl": "https://localhost:5001;http://localhost:5000" - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs deleted file mode 100644 index 991d2f47..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebAutoMapperProfile.cs +++ /dev/null @@ -1,19 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications.Dtos; -using EasyAbp.EShop.Plugins.StoreApproval.Web.Pages.StoreApproval.StoreApplications.StoreApplication.ViewModels; -using AutoMapper; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web -{ - public class StoreApprovalWebAutoMapperProfile : Profile - { - public StoreApprovalWebAutoMapperProfile() - { - /* You can configure your AutoMapper mapping configuration here. - * Alternatively, you can split your mapping configurations - * into multiple profile classes for a better organization. */ - CreateMap(); - CreateMap(); - CreateMap(); - } - } -} diff --git a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs b/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs deleted file mode 100644 index 005030dc..00000000 --- a/plugins/StoreApproval/src/EasyAbp.EShop.Plugins.StoreApproval.Web/StoreApprovalWebModule.cs +++ /dev/null @@ -1,59 +0,0 @@ -using Microsoft.AspNetCore.Mvc.RazorPages; -using Microsoft.Extensions.DependencyInjection; -using EasyAbp.EShop.Plugins.StoreApproval.Localization; -using EasyAbp.EShop.Plugins.StoreApproval.Web.Menus; -using Volo.Abp.AspNetCore.Mvc.Localization; -using Volo.Abp.AspNetCore.Mvc.UI.Theme.Shared; -using Volo.Abp.AutoMapper; -using Volo.Abp.Modularity; -using Volo.Abp.UI.Navigation; -using Volo.Abp.VirtualFileSystem; -using EasyAbp.EShop.Plugins.StoreApproval.Permissions; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Web -{ - [DependsOn( - typeof(StoreApprovalHttpApiModule), - typeof(AbpAspNetCoreMvcUiThemeSharedModule), - typeof(AbpAutoMapperModule) - )] - public class StoreApprovalWebModule : AbpModule - { - public override void PreConfigureServices(ServiceConfigurationContext context) - { - context.Services.PreConfigure(options => - { - options.AddAssemblyResource(typeof(StoreApprovalResource), typeof(StoreApprovalWebModule).Assembly); - }); - - PreConfigure(mvcBuilder => - { - mvcBuilder.AddApplicationPartIfNotExists(typeof(StoreApprovalWebModule).Assembly); - }); - } - - public override void ConfigureServices(ServiceConfigurationContext context) - { - Configure(options => - { - options.MenuContributors.Add(new StoreApprovalMenuContributor()); - }); - - Configure(options => - { - options.FileSets.AddEmbedded(); - }); - - context.Services.AddAutoMapperObjectMapper(); - Configure(options => - { - options.AddMaps(validate: true); - }); - - Configure(options => - { - //Configure authorization. - }); - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj deleted file mode 100644 index 36a44182..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml deleted file mode 100644 index be0de3a9..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs deleted file mode 100644 index 29741b2f..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApplications/StoreApplicationAppServiceTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Shouldly; -using System.Threading.Tasks; -using Xunit; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationAppServiceTests : StoreApprovalApplicationTestBase - { - private readonly IStoreApplicationAppService _storeApplicationAppService; - - public StoreApplicationAppServiceTests() - { - _storeApplicationAppService = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Act - - // Assert - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs deleted file mode 100644 index ae6ac519..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - /* Inherit from this class for your application layer tests. - * See SampleAppService_Tests for example. - */ - public abstract class StoreApprovalApplicationTestBase : StoreApprovalTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs deleted file mode 100644 index b69fcdd7..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Application.Tests/StoreApprovalApplicationTestModule.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalApplicationModule), - typeof(StoreApprovalDomainTestModule) - )] - public class StoreApprovalApplicationTestModule : AbpModule - { - - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj deleted file mode 100644 index 3f05fd71..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml deleted file mode 100644 index bd7fba1b..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs deleted file mode 100644 index 3d63e5f3..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApplications/StoreApplicationDomainTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace EasyAbp.EShop.Plugins.StoreApproval.StoreApplications -{ - public class StoreApplicationDomainTests : StoreApprovalDomainTestBase - { - public StoreApplicationDomainTests() - { - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Assert - - // Assert - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs deleted file mode 100644 index 8470fe57..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - /* Inherit from this class for your domain layer tests. - * See SampleManager_Tests for example. - */ - public abstract class StoreApprovalDomainTestBase : StoreApprovalTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs deleted file mode 100644 index 2ac79e91..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.Domain.Tests/StoreApprovalDomainTestModule.cs +++ /dev/null @@ -1,17 +0,0 @@ -using EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - /* Domain tests are configured to use the EF Core provider. - * You can switch to MongoDB, however your domain tests should be - * database independent anyway. - */ - [DependsOn( - typeof(StoreApprovalEntityFrameworkCoreTestModule) - )] - public class StoreApprovalDomainTestModule : AbpModule - { - - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index 2b828a1a..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs deleted file mode 100644 index 3b432fa7..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApplications/StoreApplicationRepositoryTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Plugins.StoreApproval.StoreApplications; -using Volo.Abp.Domain.Repositories; -using Xunit; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.StoreApplications -{ - public class StoreApplicationRepositoryTests : StoreApprovalEntityFrameworkCoreTestBase - { - private readonly IRepository _storeApplicationRepository; - - public StoreApplicationRepositoryTests() - { - _storeApplicationRepository = GetRequiredService>(); - } - - [Fact] - public async Task Test1() - { - await WithUnitOfWorkAsync(async () => - { - // Arrange - - // Act - - //Assert - }); - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs deleted file mode 100644 index 0246008c..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - /* This class can be used as a base class for EF Core integration tests, - * while SampleRepository_Tests uses a different approach. - */ - public abstract class StoreApprovalEntityFrameworkCoreTestBase : StoreApprovalTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs deleted file mode 100644 index e8ac8d6c..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/EntityFrameworkCore/StoreApprovalEntityFrameworkCoreTestModule.cs +++ /dev/null @@ -1,43 +0,0 @@ -using Microsoft.Data.Sqlite; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage; -using Volo.Abp.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore.Sqlite; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore -{ - [DependsOn( - typeof(StoreApprovalTestBaseModule), - typeof(StoreApprovalEntityFrameworkCoreModule), - typeof(AbpEntityFrameworkCoreSqliteModule) - )] - public class StoreApprovalEntityFrameworkCoreTestModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var sqliteConnection = CreateDatabaseAndGetConnection(); - - Configure(options => - { - options.Configure(abpDbContextConfigurationContext => - { - abpDbContextConfigurationContext.DbContextOptions.UseSqlite(sqliteConnection); - }); - }); - } - - private static SqliteConnection CreateDatabaseAndGetConnection() - { - var connection = new SqliteConnection("Data Source=:memory:"); - connection.Open(); - - new StoreApprovalDbContext( - new DbContextOptionsBuilder().UseSqlite(connection).Options - ).GetService().CreateTables(); - - return connection; - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml deleted file mode 100644 index bd7fba1b..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.EntityFrameworkCore.Tests/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs deleted file mode 100644 index e6c31760..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using System.Net.Http; -using System.Threading.Tasks; -using IdentityModel.Client; -using Microsoft.Extensions.Configuration; -using Volo.Abp.DependencyInjection; -using Volo.Abp.IdentityModel; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public class ClientDemoService : ITransientDependency - { - private readonly IIdentityModelAuthenticationService _authenticationService; - private readonly IConfiguration _configuration; - - public ClientDemoService( - IIdentityModelAuthenticationService authenticationService, - IConfiguration configuration) - { - _authenticationService = authenticationService; - _configuration = configuration; - } - - public async Task RunAsync() - { - await TestWithDynamicProxiesAsync(); - await TestWithHttpClientAndIdentityModelAuthenticationServiceAsync(); - await TestAllManuallyAsync(); - } - - /* Shows how to perform an HTTP request to the API using ABP's dynamic c# proxy - * feature. It is just simple as calling a local service method. - * Authorization and HTTP request details are handled by the ABP framework. - */ - private Task TestWithDynamicProxiesAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); - - return Task.CompletedTask; - - //var result = await _sampleAppService.GetAsync(); - //Console.WriteLine("Result: " + result.Value); - - //result = await _sampleAppService.GetAuthorizedAsync(); - //Console.WriteLine("Result (authorized): " + result.Value); - } - - /* Shows how to use HttpClient to perform a request to the HTTP API. - * It uses ABP's IIdentityModelAuthenticationService to simplify obtaining access tokens. - */ - private async Task TestWithHttpClientAndIdentityModelAuthenticationServiceAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestWithHttpClientAndIdentityModelAuthenticationServiceAsync)} *****"); - - //Get access token using ABP's IIdentityModelAuthenticationService - - var accessToken = await _authenticationService.GetAccessTokenAsync( - new IdentityClientConfiguration( - _configuration["IdentityClients:Default:Authority"], - _configuration["IdentityClients:Default:Scope"], - _configuration["IdentityClients:Default:ClientId"], - _configuration["IdentityClients:Default:ClientSecret"], - _configuration["IdentityClients:Default:GrantType"], - _configuration["IdentityClients:Default:UserName"], - _configuration["IdentityClients:Default:UserPassword"] - ) - ); - - //Perform the actual HTTP request - - using (var httpClient = new HttpClient()) - { - httpClient.SetBearerToken(accessToken); - - var url = _configuration["RemoteServices:StoreApproval:BaseUrl"] + - "api/StoreApproval/sample/authorized"; - - var responseMessage = await httpClient.GetAsync(url); - if (responseMessage.IsSuccessStatusCode) - { - var responseString = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine("Result: " + responseString); - } - else - { - throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); - } - } - } - - /* Shows how to use HttpClient to perform a request to the HTTP API. - * It obtains access token using IdentityServer's API. See its documentation: - * https://identityserver4.readthedocs.io/en/latest/quickstarts/2_resource_owner_passwords.html - */ - private async Task TestAllManuallyAsync() - { - Console.WriteLine(); - Console.WriteLine($"***** {nameof(TestAllManuallyAsync)} *****"); - - //Obtain access token from the IDS4 server - - // discover endpoints from metadata - var client = new HttpClient(); - var disco = await client.GetDiscoveryDocumentAsync(_configuration["IdentityClients:Default:Authority"]); - if (disco.IsError) - { - Console.WriteLine(disco.Error); - return; - } - - // request token - var tokenResponse = await client.RequestPasswordTokenAsync(new PasswordTokenRequest - { - Address = disco.TokenEndpoint, - ClientId = _configuration["IdentityClients:Default:ClientId"], - ClientSecret = _configuration["IdentityClients:Default:ClientSecret"], - UserName = _configuration["IdentityClients:Default:UserName"], - Password = _configuration["IdentityClients:Default:UserPassword"], - Scope = _configuration["IdentityClients:Default:Scope"] - }); - - if (tokenResponse.IsError) - { - Console.WriteLine(tokenResponse.Error); - return; - } - - Console.WriteLine(tokenResponse.Json); - - //Perform the actual HTTP request - - using (var httpClient = new HttpClient()) - { - httpClient.SetBearerToken(tokenResponse.AccessToken); - - var url = _configuration["RemoteServices:StoreApproval:BaseUrl"] + - "api/StoreApproval/sample/authorized"; - - var responseMessage = await httpClient.GetAsync(url); - if (responseMessage.IsSuccessStatusCode) - { - var responseString = await responseMessage.Content.ReadAsStringAsync(); - Console.WriteLine("Result: " + responseString); - } - else - { - throw new Exception("Remote server returns error code: " + responseMessage.StatusCode); - } - } - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs deleted file mode 100644 index cd95e937..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Microsoft.Extensions.Hosting; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; - -namespace EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp -{ - public class ConsoleTestAppHostedService : IHostedService - { - public async Task StartAsync(CancellationToken cancellationToken) - { - using (var application = AbpApplicationFactory.Create()) - { - application.Initialize(); - - var demo = application.ServiceProvider.GetRequiredService(); - await demo.RunAsync(); - - application.Shutdown(); - } - } - - public Task StopAsync(CancellationToken cancellationToken) => Task.CompletedTask; - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj deleted file mode 100644 index 8d97fa66..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - Exe - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - - PreserveNewest - Always - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs deleted file mode 100644 index 24e88dd5..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp -{ - class Program - { - static async Task Main(string[] args) - { - await CreateHostBuilder(args).RunConsoleAsync(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - }); - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs deleted file mode 100644 index 850afaeb..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/StoreApprovalConsoleApiClientModule.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Volo.Abp.Http.Client.IdentityModel; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(StoreApprovalHttpApiClientModule), - typeof(AbpHttpClientIdentityModelModule) - )] - public class StoreApprovalConsoleApiClientModule : AbpModule - { - - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json deleted file mode 100644 index a505774e..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.HttpApi.Client.ConsoleTestApp/appsettings.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "RemoteServices": { - "Default": { - "BaseUrl": "https://localhost:44339/" - }, - "StoreApproval": { - "BaseUrl": "https://localhost:44383/" - } - }, - "IdentityClients": { - "Default": { - "GrantType": "password", - "ClientId": "StoreApproval_ConsoleTestApp", - "ClientSecret": "1q2w3e*", - "UserName": "admin", - "UserPassword": "1q2w3E*", - "Authority": "https://localhost:44339/", - "Scope": "StoreApproval" - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj deleted file mode 100644 index 2c28533c..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml deleted file mode 100644 index bd7fba1b..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs deleted file mode 100644 index 844fedd6..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoDbFixture.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Mongo2Go; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - public class MongoDbFixture : IDisposable - { - private static readonly MongoDbRunner MongoDbRunner; - public static readonly string ConnectionString; - - static MongoDbFixture() - { - MongoDbRunner = MongoDbRunner.Start(); - ConnectionString = MongoDbRunner.ConnectionString; - } - - public void Dispose() - { - MongoDbRunner?.Dispose(); - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs deleted file mode 100644 index a9c4161e..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/MongoTestCollection.cs +++ /dev/null @@ -1,10 +0,0 @@ -using Xunit; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - [CollectionDefinition(Name)] - public class MongoTestCollection : ICollectionFixture - { - public const string Name = "MongoDB Collection"; - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs deleted file mode 100644 index 2a4ac974..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestBase.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - /* This class can be used as a base class for MongoDB integration tests, - * while SampleRepository_Tests uses a different approach. - */ - public abstract class StoreApprovalMongoDbTestBase : StoreApprovalTestBase - { - - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs deleted file mode 100644 index a44846e4..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.MongoDB.Tests/MongoDB/StoreApprovalMongoDbTestModule.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using Volo.Abp.Data; -using Volo.Abp.Modularity; - -namespace EasyAbp.EShop.Plugins.StoreApproval.MongoDB -{ - [DependsOn( - typeof(StoreApprovalTestBaseModule), - typeof(StoreApprovalMongoDbModule) - )] - public class StoreApprovalMongoDbTestModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - var connectionString = MongoDbFixture.ConnectionString.EnsureEndsWith('/') + - "Db_" + - Guid.NewGuid().ToString("N"); - - Configure(options => - { - options.ConnectionStrings.Default = connectionString; - }); - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj deleted file mode 100644 index 506c5a91..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/EasyAbp.EShop.Plugins.StoreApproval.TestBase.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - netcoreapp3.1 - EasyAbp.EShop.Plugins.StoreApproval - - - - - - - - - - - - - - - - diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml deleted file mode 100644 index bd7fba1b..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd deleted file mode 100644 index 3f3946e2..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/FodyWeavers.xsd +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - - 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. - - - - - A comma-separated list of error codes that can be safely ignored in assembly verification. - - - - - 'false' to turn off automatic generation of the XML Schema file. - - - - - \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs deleted file mode 100644 index 8d7534f3..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/Security/FakeCurrentPrincipalAccessor.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Collections.Generic; -using System.Security.Claims; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Security.Claims; - -namespace EasyAbp.EShop.Plugins.StoreApproval.Security -{ - [Dependency(ReplaceServices = true)] - public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor - { - protected override ClaimsPrincipal GetClaimsPrincipal() - { - return GetPrincipal(); - } - - private ClaimsPrincipal _principal; - - private ClaimsPrincipal GetPrincipal() - { - if (_principal == null) - { - lock (this) - { - if (_principal == null) - { - _principal = new ClaimsPrincipal( - new ClaimsIdentity( - new List - { - new Claim(AbpClaimTypes.UserId,"2e701e62-0953-4dd3-910b-dc6cc93ccb0d"), - new Claim(AbpClaimTypes.UserName,"admin"), - new Claim(AbpClaimTypes.Email,"admin@abp.io") - } - ) - ); - } - } - } - - return _principal; - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs deleted file mode 100644 index 47ddeb77..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalDataSeedContributor.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - public class StoreApprovalDataSeedContributor : IDataSeedContributor, ITransientDependency - { - private readonly IGuidGenerator _guidGenerator; - - public StoreApprovalDataSeedContributor( - IGuidGenerator guidGenerator) - { - _guidGenerator = guidGenerator; - } - - public Task SeedAsync(DataSeedContext context) - { - /* Instead of returning the Task.CompletedTask, you can insert your test data - * at this point! - */ - - return Task.CompletedTask; - } - } -} \ No newline at end of file diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs deleted file mode 100644 index e2861157..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBase.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Modularity; -using Volo.Abp.Uow; -using Volo.Abp.Testing; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - /* All test classes are derived from this class, directly or indirectly. */ - public abstract class StoreApprovalTestBase : AbpIntegratedTest - where TStartupModule : IAbpModule - { - protected override void SetAbpApplicationCreationOptions(AbpApplicationCreationOptions options) - { - options.UseAutofac(); - } - - protected virtual Task WithUnitOfWorkAsync(Func func) - { - return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); - } - - protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func action) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - await action(); - - await uow.CompleteAsync(); - } - } - } - - protected virtual Task WithUnitOfWorkAsync(Func> func) - { - return WithUnitOfWorkAsync(new AbpUnitOfWorkOptions(), func); - } - - protected virtual async Task WithUnitOfWorkAsync(AbpUnitOfWorkOptions options, Func> func) - { - using (var scope = ServiceProvider.CreateScope()) - { - var uowManager = scope.ServiceProvider.GetRequiredService(); - - using (var uow = uowManager.Begin(options)) - { - var result = await func(); - await uow.CompleteAsync(); - return result; - } - } - } - } -} diff --git a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs b/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs deleted file mode 100644 index 82e41262..00000000 --- a/plugins/StoreApproval/test/EasyAbp.EShop.Plugins.StoreApproval.TestBase/StoreApprovalTestBaseModule.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp; -using Volo.Abp.Authorization; -using Volo.Abp.Autofac; -using Volo.Abp.Data; -using Volo.Abp.Modularity; -using Volo.Abp.Threading; - -namespace EasyAbp.EShop.Plugins.StoreApproval -{ - [DependsOn( - typeof(AbpAutofacModule), - typeof(AbpTestBaseModule), - typeof(AbpAuthorizationModule), - typeof(StoreApprovalDomainModule) - )] - public class StoreApprovalTestBaseModule : AbpModule - { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddAlwaysAllowAuthorization(); - } - - public override void OnApplicationInitialization(ApplicationInitializationContext context) - { - SeedTestData(context); - } - - private static void SeedTestData(ApplicationInitializationContext context) - { - AsyncHelper.RunSync(async () => - { - using (var scope = context.ServiceProvider.CreateScope()) - { - await scope.ServiceProvider - .GetRequiredService() - .SeedAsync(); - } - }); - } - } -} From b3369d0f9a0a1164bbd79ce886b90dd358052af1 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Wed, 5 Aug 2020 20:07:00 +0800 Subject: [PATCH 03/24] remove unnecessary changes --- .../Orders/BasicPurchasableCheckProvider.cs | 3 ++- .../EShop/Orders/Orders/INewOrderGenerator.cs | 3 ++- .../Orders/IPurchasableCheckProvider.cs | 5 ++-- .../Orders/Orders/IPurchasableChecker.cs | 5 ++-- .../EShop/Orders/Orders/NewOrderGenerator.cs | 8 ++++--- .../EShop/Orders/Orders/OrderAppService.cs | 12 ++++++---- .../EShop/Orders/Orders/PurchasableChecker.cs | 5 ++-- .../Orders/Orders/IOrderDiscountProvider.cs | 2 +- .../EShop/Orders/Orders/IOrderManager.cs | 1 + .../EShop/Orders/Orders/OrderManager.cs | 4 ++-- .../Payments/Payments/PaymentAppService.cs | 17 +++++++++----- .../Products/Categories/CategoryAppService.cs | 1 + .../EShop/Products/Products/ProductManager.cs | 23 ++++++++----------- .../Products/Products/ProductController.cs | 7 +++--- .../Menus/ProductsMenus.cs | 2 +- .../Products/Product/CreateModal.cshtml.cs | 9 +------- .../Products/Product/EditModal.cshtml.cs | 2 -- .../Products/Products/Product/Index.cshtml | 1 - .../Products/Products/Product/Index.cshtml.cs | 3 --- .../ViewModels/CreateEditProductViewModel.cs | 4 ---- .../EShop/Products/Products/Product/index.js | 4 ++-- .../ProductsWebAutoMapperProfile.cs | 5 ++-- .../StoreOwners/StoreOwnerAppService.cs | 2 +- 23 files changed, 62 insertions(+), 66 deletions(-) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs index 8c9252d4..e0da78f4 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/BasicPurchasableCheckProvider.cs @@ -11,7 +11,8 @@ namespace EasyAbp.EShop.Orders.Orders { public class BasicPurchasableCheckProvider : IPurchasableCheckProvider, ITransientDependency { - public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict) + public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict, + Dictionary orderExtraProperties) { await CheckProductsPublishedAsync(input, productDict); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs index efbbd6b1..fe653e10 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/INewOrderGenerator.cs @@ -8,6 +8,7 @@ namespace EasyAbp.EShop.Orders.Orders { public interface INewOrderGenerator { - Task GenerateAsync(CreateOrderDto input, Dictionary productDict); + Task GenerateAsync(CreateOrderDto input, Dictionary productDict, + Dictionary orderExtraProperties); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs index 3bdf79d9..572cf8a8 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs @@ -6,8 +6,9 @@ using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Orders.Orders { - public interface IPurchasableCheckProvider + public interface IPurchasableChecker { - Task CheckAsync(CreateOrderDto input, Dictionary productDict); + Task CheckAsync(CreateOrderDto input, Dictionary productDict, + Dictionary orderExtraProperties); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs index f6c92292..98b3c1d1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs @@ -6,8 +6,9 @@ using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Orders.Orders { - public interface IPurchasableChecker + public interface IPurchasableCheckProvider { - Task CheckAsync(CreateOrderDto input, Dictionary productDict); + Task CheckAsync(CreateOrderDto input, Dictionary productDict, + Dictionary orderExtraProperties); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index 1f67cb94..31e97994 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -12,7 +12,6 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Guids; using Volo.Abp.Json; using Volo.Abp.MultiTenancy; -using Volo.Abp.ObjectExtending; using Volo.Abp.Users; namespace EasyAbp.EShop.Orders.Orders @@ -39,7 +38,7 @@ namespace EasyAbp.EShop.Orders.Orders _productSkuDescriptionProvider = productSkuDescriptionProvider; } - public virtual async Task GenerateAsync(CreateOrderDto input, Dictionary productDict) + public virtual async Task GenerateAsync(CreateOrderDto input, Dictionary productDict, Dictionary orderExtraProperties) { var orderLines = new List(); @@ -62,7 +61,10 @@ namespace EasyAbp.EShop.Orders.Orders refundedAmount: 0, customerRemark: input.CustomerRemark); - input.MapExtraPropertiesTo(order, MappingPropertyDefinitionChecks.Both); + foreach (var orderExtraProperty in orderExtraProperties) + { + order.SetProperty(orderExtraProperty.Key, orderExtraProperty.Value); + } order.SetOrderLines(orderLines); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index 0681894a..c2b395fd 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -68,7 +68,7 @@ namespace EasyAbp.EShop.Orders.Orders if (input.StoreId.HasValue) { - await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId.Value, + await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, OrdersPermissions.Orders.Manage); } else @@ -104,11 +104,13 @@ namespace EasyAbp.EShop.Orders.Orders var productDict = await GetProductDictionaryAsync(input.OrderLines.Select(dto => dto.ProductId).ToList(), input.StoreId); - await _purchasableChecker.CheckAsync(input, productDict); + var orderExtraProperties = new Dictionary(); - var order = await _newOrderGenerator.GenerateAsync(input, productDict); + await _purchasableChecker.CheckAsync(input, productDict, orderExtraProperties); + + var order = await _newOrderGenerator.GenerateAsync(input, productDict, orderExtraProperties); - await _orderManager.DiscountAsync(order); + await _orderManager.DiscountAsync(order, input.ExtraProperties); await Repository.InsertAsync(order, autoSave: true); @@ -133,7 +135,7 @@ namespace EasyAbp.EShop.Orders.Orders { throw new NotSupportedException(); } - + [RemoteService(false)] public override Task DeleteAsync(Guid id) { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs index 4648a1f5..ed1bbf19 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/PurchasableChecker.cs @@ -17,13 +17,14 @@ namespace EasyAbp.EShop.Orders.Orders _serviceProvider = serviceProvider; } - public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict) + public virtual async Task CheckAsync(CreateOrderDto input, Dictionary productDict, + Dictionary orderExtraProperties) { var providers = _serviceProvider.GetServices(); foreach (var provider in providers) { - await provider.CheckAsync(input, productDict); + await provider.CheckAsync(input, productDict, orderExtraProperties); } } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs index 2fd6dd4b..e3f85c61 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderDiscountProvider.cs @@ -5,6 +5,6 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrderDiscountProvider { - Task DiscountAsync(Order order); + Task DiscountAsync(Order order, Dictionary inputExtraProperties); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs index f5e3ce6b..00bd58ef 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs @@ -6,6 +6,7 @@ namespace EasyAbp.EShop.Orders.Orders { public interface IOrderManager : IDomainService { + Task DiscountAsync(Order order, Dictionary inputExtraProperties); Task DiscountAsync(Order order); Task CompleteAsync(Order order); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs index a8bf7622..bb0000fa 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs @@ -19,11 +19,11 @@ namespace EasyAbp.EShop.Orders.Orders _orderRepository = orderRepository; } - public virtual async Task DiscountAsync(Order order) + public virtual async Task DiscountAsync(Order order, Dictionary inputExtraProperties) { foreach (var provider in ServiceProvider.GetServices()) { - await provider.DiscountAsync(order); + await provider.DiscountAsync(order, inputExtraProperties); } return order; diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs index a5acd0b5..8f4752ee 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -42,17 +42,22 @@ namespace EasyAbp.EShop.Payments.Payments { var payment = await base.GetAsync(id); + await AuthorizationService.CheckAsync(GetPolicyName); + if (payment.UserId != CurrentUser.GetId()) { if (payment.StoreId.HasValue) { - await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value, - PaymentsPermissions.Payments.Manage); - } - else - { - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); + if (await AuthorizationService.IsStoreOwnerGrantedAsync(payment.StoreId.Value, + PaymentsPermissions.Payments.Manage)) + { + return payment; + } + + await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.CrossStore); } + + await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); } return payment; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs index 40ad6d57..11b246a1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Products.Categories.Dtos; using EasyAbp.EShop.Products.Permissions; +using EasyAbp.EShop.Stores.Permissions; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs index 698ed8e0..a15d09c9 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs @@ -1,10 +1,10 @@ -using EasyAbp.EShop.Products.ProductCategories; -using EasyAbp.EShop.Products.ProductStores; -using Microsoft.Extensions.DependencyInjection; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EasyAbp.EShop.Products.ProductCategories; +using EasyAbp.EShop.Products.ProductStores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Domain.Services; namespace EasyAbp.EShop.Products.Products @@ -51,8 +51,7 @@ namespace EasyAbp.EShop.Products.Products return product; } - public virtual async Task UpdateAsync(Product product, - IEnumerable categoryIds = null) + public virtual async Task UpdateAsync(Product product, IEnumerable categoryIds = null) { await CheckProductCodeUniqueAsync(product); @@ -169,16 +168,14 @@ namespace EasyAbp.EShop.Products.Products protected virtual async Task UpdateProductCategoriesAsync(Guid productId, IEnumerable categoryIds) { - categoryIds ??= new List(); + await _productCategoryRepository.DeleteAsync(x => x.ProductId.Equals(productId)); - var productCategories = await _productCategoryRepository.GetListByProductIdAsync(productId); - - foreach (var productCategory in productCategories.Where(x => !categoryIds.Contains(x.CategoryId))) + if (categoryIds == null) { - await _productCategoryRepository.DeleteAsync(productCategory, true); + return; } - - foreach (var categoryId in categoryIds.Except(productCategories.Select(x => x.CategoryId))) + + foreach (var categoryId in categoryIds) { await _productCategoryRepository.InsertAsync( new ProductCategory(GuidGenerator.Create(), CurrentTenant.Id, categoryId, productId), true); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs index b806d0af..aa9bda8c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs @@ -18,9 +18,9 @@ namespace EasyAbp.EShop.Products.Products _service = service; } - [Route("{id}")] + [HttpGet] + [Route("{id}/abandoned")] [RemoteService(false)] - [NonAction] public Task GetAsync(Guid id) { return _service.GetAsync(id); @@ -45,7 +45,8 @@ namespace EasyAbp.EShop.Products.Products return _service.UpdateAsync(id, input); } - [NonAction] + [HttpDelete] + [Route("{id}/abandoned")] [RemoteService(false)] public Task DeleteAsync(Guid id) { diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs index 90f85536..ef679742 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs @@ -9,7 +9,7 @@ public const string ProductType = Prefix + ".ProductType"; public const string Category = Prefix + ".Category"; - + public const string Product = Prefix + ".Product"; //Add your menu items here... diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs index 20e67951..a2980c13 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs @@ -28,8 +28,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product public ICollection Categories { get; set; } - public ICollection Tags { get; set; } - private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; @@ -47,7 +45,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product _service = service; } - public virtual async Task OnGetAsync(Guid? categoryId, Guid? tagId) + public virtual async Task OnGetAsync(Guid? categoryId) { ProductTypes = (await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto @@ -72,11 +70,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product { Product.CategoryIds = new List(new[] { categoryId.Value }); } - - if (tagId.HasValue) - { - Product.TagIds = new List(new[] { tagId.Value }); - } } public virtual async Task OnPostAsync() diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs index 55fc1270..f5779624 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs @@ -31,8 +31,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product public ICollection Categories { get; set; } - public ICollection Tags { get; set; } - private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml index 548ba20d..c5ef3d60 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml @@ -24,7 +24,6 @@ diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs index fd6f9ecc..4c3023fe 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs @@ -19,9 +19,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product [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, diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs index e1ed5a60..2ea2f6ae 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs @@ -24,10 +24,6 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM [Display(Name = "ProductCategory")] public List CategoryIds { get; set; } - [SelectItems("Tags")] - [Display(Name = "ProductTag")] - public List TagIds { get; set; } - [Display(Name = "ProductUniqueName")] public string UniqueName { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js index 6f049fd2..99b0f255 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js @@ -15,7 +15,7 @@ $(function () { scrollCollapse: true, order: [[1, "asc"]], ajax: abp.libs.datatables.createAjax(service.getList, function () { - return { storeId: storeId, categoryId: categoryId, tagId: tagId, showHidden: true } + return { storeId: storeId, categoryId: categoryId, showHidden: true } }), columnDefs: [ { @@ -69,6 +69,6 @@ $(function () { $('#NewProductButton').click(function (e) { e.preventDefault(); - createModal.open({ storeId: storeId, categoryId: categoryId, tagId: tagId }); + createModal.open({ storeId: storeId, categoryId: categoryId }); }); }); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs index b1dc8a78..55bec86f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/ProductsWebAutoMapperProfile.cs @@ -20,7 +20,6 @@ namespace EasyAbp.EShop.Products.Web * into multiple profile classes for a better organization. */ CreateMap() .Ignore(model => model.CategoryIds) - .Ignore(model => model.TagIds) .Ignore(model => model.ProductDetail) .Ignore(model => model.StoreId) .ForSourceMember(dto => dto.Sold, opt => opt.DoNotValidate()) @@ -42,11 +41,11 @@ namespace EasyAbp.EShop.Products.Web x.ProductAttributeNames.Split(",", StringSplitOptions.RemoveEmptyEntries).Select((s, i) => new CreateUpdateProductAttributeDto { - DisplayName = s.Trim(), + DisplayName = s, ProductAttributeOptions = new List( x.ProductAttributeOptionNames.SplitToLines(StringSplitOptions.RemoveEmptyEntries)[i] .Split(",", StringSplitOptions.RemoveEmptyEntries).Select(o => - new CreateUpdateProductAttributeOptionDto {DisplayName = o.Trim()})) + new CreateUpdateProductAttributeOptionDto {DisplayName = o})) }))); CreateMap() .Ignore(model => model.StoreId); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index bb7009d7..454b9c75 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -11,7 +11,7 @@ namespace EasyAbp.EShop.Stores.StoreOwners public class StoreOwnerAppService : ReadOnlyAppService, IStoreOwnerAppService { - protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Default; + protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Manage; private readonly IStoreOwnerRepository _repository; From 530f82e0615542ab86bea22dd7d109037eb1d2c7 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Thu, 13 Aug 2020 08:38:44 +0800 Subject: [PATCH 04/24] make StoreOwner has its own application service and management pages --- .../EShop/Orders/Orders/IOrderManager.cs | 1 - .../Payments/Payments/PaymentAppService.cs | 41 ++------- .../Payments/Refunds/RefundAppService.cs | 25 +----- ...asicStorePermissionAuthorizationHandler.cs | 8 +- .../Stores/StoreOwners/Dtos/StoreOwnerDto.cs | 5 +- .../StoreOwners/IStoreOwnerAppService.cs | 3 +- .../StoreOwnerDuplicatedException.cs | 13 +++ .../Stores/Dtos/CreateUpdateStoreDto.cs | 5 +- .../EShop/Stores/Stores/Dtos/StoreDto.cs | 2 + .../StoreOwners/StoreOwnerAppService.cs | 32 +++---- .../EShop/Stores/Stores/StoreAppService.cs | 43 +++------ .../StoresApplicationAutoMapperProfile.cs | 9 +- .../EShop/Stores/Localization/Stores/cs.json | 7 +- .../EShop/Stores/Localization/Stores/en.json | 7 +- .../EShop/Stores/Localization/Stores/pl.json | 7 +- .../Stores/Localization/Stores/pt-BR.json | 7 +- .../EShop/Stores/Localization/Stores/sl.json | 7 +- .../EShop/Stores/Localization/Stores/tr.json | 7 +- .../EShop/Stores/Localization/Stores/vi.json | 7 +- .../Stores/Localization/Stores/zh-Hans.json | 7 +- .../Stores/Localization/Stores/zh-Hant.json | 7 +- .../Stores/StoreOwners/IStoreOwnerStore.cs | 10 +++ .../EasyAbp.EShop.Stores.Domain.csproj | 1 + .../StoreOwners/IStoreOwnerRepository.cs | 4 +- .../Stores/StoreOwners/StoreOwnerCacheItem.cs | 24 +++++ .../Stores/StoreOwners/StoreOwnerStore.cs | 81 +++++++++++++++++ .../EShop/Stores/Stores/IStoreManager.cs | 14 --- .../EShop/Stores/Stores/StoreManager.cs | 58 ------------- .../StoresDbContextModelCreatingExtensions.cs | 3 + .../StoreOwners/StoreOwnerRepository.cs | 15 +++- .../StoreOwners/StoreOwnerController.cs | 30 +++++-- .../EasyAbp.EShop.Stores.Web.csproj | 34 ++++++++ .../Menus/StoresMenuContributor.cs | 7 ++ .../Menus/StoresMenus.cs | 2 + .../StoreOwners/StoreOwner/CreateModal.cshtml | 19 ++++ .../StoreOwner/CreateModal.cshtml.cs | 46 ++++++++++ .../StoreOwners/StoreOwner/EditModal.cshtml | 20 +++++ .../StoreOwner/EditModal.cshtml.cs | 53 +++++++++++ .../StoreOwners/StoreOwner/Index.cshtml | 61 +++++++++++++ .../StoreOwners/StoreOwner/Index.cshtml.cs | 21 +++++ .../Stores/StoreOwners/StoreOwner/Index.css | 0 .../Stores/StoreOwners/StoreOwner/Index.js | 87 +++++++++++++++++++ .../ViewModels/CreateStoreOwnerViewModel.cs | 17 ++++ .../Stores/Stores/Store/CreateModal.cshtml.cs | 2 +- .../Stores/Stores/Store/EditModal.cshtml.cs | 21 +---- .../EShop/Stores/Stores/Store/Index.cshtml | 4 +- .../ViewModels/CreateEditStoreViewModel.cs | 5 -- .../StoresWebAutoMapperProfile.cs | 12 ++- 48 files changed, 662 insertions(+), 239 deletions(-) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerStore.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItem.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs delete mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs delete mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.css create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs index 00bd58ef..ff6afc69 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderManager.cs @@ -7,7 +7,6 @@ namespace EasyAbp.EShop.Orders.Orders public interface IOrderManager : IDomainService { Task DiscountAsync(Order order, Dictionary inputExtraProperties); - Task DiscountAsync(Order order); Task CompleteAsync(Order order); } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs index 3c98ccc5..c25a47fd 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -26,7 +26,8 @@ namespace EasyAbp.EShop.Payments.Payments private readonly IPayableChecker _payableChecker; private readonly IDistributedEventBus _distributedEventBus; private readonly IOrderAppService _orderAppService; - + private readonly IPaymentRepository _repository; + public PaymentAppService( IPayableChecker payableChecker, IDistributedEventBus distributedEventBus, @@ -36,33 +37,21 @@ namespace EasyAbp.EShop.Payments.Payments _payableChecker = payableChecker; _distributedEventBus = distributedEventBus; _orderAppService = orderAppService; + _repository = repository; } public override async Task GetAsync(Guid id) { var payment = await base.GetAsync(id); - await AuthorizationService.CheckAsync(GetPolicyName); - if (payment.UserId != CurrentUser.GetId()) { - if (payment.StoreId.HasValue) - { - if (await AuthorizationService.IsStoreOwnerGrantedAsync(payment.StoreId.Value, - PaymentsPermissions.Payments.Manage)) - { - return payment; - } - - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.CrossStore); - } - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); } return payment; } - + protected override IQueryable CreateFilteredQuery(GetPaymentListDto input) { var query = base.CreateFilteredQuery(input); @@ -80,40 +69,24 @@ namespace EasyAbp.EShop.Payments.Payments if (input.UserId != CurrentUser.GetId()) { await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); - - if (input.StoreId.HasValue) - { - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, - PaymentsPermissions.Payments.Manage); - } - else - { - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.CrossStore); - } } return await base.GetListAsync(input); } - + [Authorize(PaymentsPermissions.Payments.Create)] public virtual async Task CreateAsync(CreatePaymentDto input) { // Todo: should avoid duplicate creations. (concurrent lock) var orders = new List(); - + foreach (var orderId in input.OrderIds) { orders.Add(await _orderAppService.GetAsync(orderId)); } - var extraProperties = new Dictionary { { "StoreId", orders.First().StoreId } }; - - await _payableChecker.CheckAsync(input, orders, extraProperties); - - // Todo: should avoid duplicate creations. - - await _distributedEventBus.PublishAsync(new CreatePaymentEto + var createPaymentEto = new CreatePaymentEto { TenantId = CurrentTenant.Id, UserId = CurrentUser.GetId(), diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs index 249a943d..cc21d5ca 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs @@ -21,7 +21,7 @@ namespace EasyAbp.EShop.Payments.Refunds private readonly IPaymentRepository _paymentRepository; private readonly IRefundRepository _repository; - + public RefundAppService( IPaymentRepository paymentRepository, IRefundRepository repository) : base(repository) @@ -35,22 +35,15 @@ namespace EasyAbp.EShop.Payments.Refunds var refund = await base.GetAsync(id); var payment = await _paymentRepository.GetAsync(refund.PaymentId); - + if (payment.UserId != CurrentUser.GetId()) { - if (payment.StoreId.HasValue) - { - await AuthorizationService.CheckStoreOwnerAsync(payment.StoreId.Value, PaymentsPermissions.Refunds.Manage); - } - else - { - await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); - } + await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); } return refund; } - + protected override IQueryable CreateFilteredQuery(GetRefundListDto input) { var query = input.UserId.HasValue ? _repository.GetQueryableByUserId(input.UserId.Value) : _repository; @@ -63,16 +56,6 @@ namespace EasyAbp.EShop.Payments.Refunds if (input.UserId != CurrentUser.GetId()) { await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); - - if (input.StoreId.HasValue) - { - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, - PaymentsPermissions.Refunds.Manage); - } - else - { - await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.CrossStore); - } } return await base.GetListAsync(input); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs index 5215bcbb..d1b52d89 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs @@ -9,13 +9,13 @@ namespace EasyAbp.EShop.Stores.Permissions { public class BasicStorePermissionAuthorizationHandler : AuthorizationHandler { - private readonly IStoreOwnerAppService _storeOwnerAppService; + private readonly IStoreOwnerStore _storeOwnerStore; private readonly IPermissionChecker _permissionChecker; - public BasicStorePermissionAuthorizationHandler(IStoreOwnerAppService storeOwnerAppService, + public BasicStorePermissionAuthorizationHandler(IStoreOwnerStore storeOwnerStore, IPermissionChecker permissionChecker) { - _storeOwnerAppService = storeOwnerAppService; + _storeOwnerStore = storeOwnerStore; _permissionChecker = permissionChecker; } @@ -24,7 +24,7 @@ namespace EasyAbp.EShop.Stores.Permissions var userId = context.User?.FindUserId(); if (userId.HasValue) { - var isStoreOwner = await _storeOwnerAppService.IsStoreOwnerAsync(requirement.StoreId, userId.Value); + var isStoreOwner = await _storeOwnerStore.IsStoreOwnerAsync(requirement.StoreId, userId.Value); if (isStoreOwner) { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs index 31157a32..e95dc870 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs @@ -1,12 +1,15 @@ using System; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners.Dtos { - public class StoreOwnerDto : AuditedEntityDto + public class StoreOwnerDto : ExtensibleFullAuditedEntityDto { + [Required] public Guid StoreId { get; set; } + [Required] public Guid OwnerId { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs index c6223354..48c2f740 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs @@ -6,11 +6,10 @@ using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Stores.StoreOwners { public interface IStoreOwnerAppService : - IReadOnlyAppService< + ICrudAppService< StoreOwnerDto, Guid, GetStoreOwnerListDto> { - Task IsStoreOwnerAsync(Guid storeId, Guid userId); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs new file mode 100644 index 00000000..1aec6071 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs @@ -0,0 +1,13 @@ +using System; +using Volo.Abp; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwnerDuplicatedException : BusinessException + { + public StoreOwnerDuplicatedException(Guid storeId, Guid ownerId) : base( + message: $"Owner {ownerId} is duplicate for the store {storeId}") + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs index 209fad58..c463f482 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs @@ -10,9 +10,6 @@ namespace EasyAbp.EShop.Stores.Stores.Dtos { [Required] [DisplayName("StoreName")] - public string Name { get; set; } - - [DisplayName("StoreOwner")] - public ICollection OwnerIds { get; set; } + public string Name { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs index f4e247ac..24d11fd8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs @@ -1,10 +1,12 @@ using System; +using System.ComponentModel.DataAnnotations; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.Stores.Dtos { public class StoreDto : ExtensibleAuditedEntityDto { + [Required] public string Name { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index 454b9c75..8d9ab163 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -8,9 +8,13 @@ using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Stores.StoreOwners { - public class StoreOwnerAppService : ReadOnlyAppService, + public class StoreOwnerAppService : CrudAppService, IStoreOwnerAppService { + protected override string CreatePolicyName { get; set; } = StoresPermissions.Stores.Manage; + protected override string DeletePolicyName { get; set; } = StoresPermissions.Stores.Manage; + protected override string UpdatePolicyName { get; set; } = StoresPermissions.Stores.Manage; + protected override string GetPolicyName { get; set; } = StoresPermissions.Stores.Manage; protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Manage; private readonly IStoreOwnerRepository _repository; @@ -20,6 +24,16 @@ namespace EasyAbp.EShop.Stores.StoreOwners _repository = repository; } + public override async Task CreateAsync(StoreOwnerDto input) + { + if (await _repository.IsExistAsync(input.StoreId, input.OwnerId)) + { + throw new StoreOwnerDuplicatedException(input.StoreId, input.OwnerId); + } + + return await base.CreateAsync(input); + } + protected override IQueryable CreateFilteredQuery(GetStoreOwnerListDto input) { var queryable = Repository.AsQueryable(); @@ -36,19 +50,5 @@ namespace EasyAbp.EShop.Stores.StoreOwners return queryable; } - - [RemoteService(false)] - public override Task GetAsync(Guid id) - { - throw new NotSupportedException(); - } - - [RemoteService(false)] - public async Task IsStoreOwnerAsync(Guid storeId, Guid userId) - { - var storeOwner = await _repository.FindAsync(x => x.OwnerId == userId && x.StoreId == storeId, false); - - return storeOwner != null; - } } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs index 55cb8fd1..1dca0f80 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/StoreAppService.cs @@ -1,22 +1,27 @@ -using EasyAbp.EShop.Stores.Stores.Dtos; using System; using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Stores.Dtos; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Stores.Stores { - public class StoreAppService : CrudAppService, + public class StoreAppService : CrudAppService, IStoreAppService { + protected override string CreatePolicyName { get; set; } = StoresPermissions.Stores.Create; + protected override string DeletePolicyName { get; set; } = StoresPermissions.Stores.Delete; + protected override string UpdatePolicyName { get; set; } = StoresPermissions.Stores.Update; + protected override string GetPolicyName { get; set; } = StoresPermissions.Stores.Default; + protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Default; + private readonly IStoreRepository _repository; - private readonly IStoreManager _storeManager; - public StoreAppService(IStoreRepository repository, - IStoreManager storeManager) : base(repository) + public StoreAppService(IStoreRepository repository) : base(repository) { _repository = repository; - _storeManager = storeManager; } public async Task GetDefaultAsync() @@ -24,31 +29,5 @@ namespace EasyAbp.EShop.Stores.Stores // Todo: need to be improved return ObjectMapper.Map(await _repository.FindDefaultStoreAsync()); } - - public override async Task CreateAsync(CreateUpdateStoreDto input) - { - await CheckCreatePolicyAsync(); - - var entity = MapToEntity(input); - - TryToSetTenantId(entity); - - entity = await _storeManager.CreateAsync(entity, input.OwnerIds); - - return MapToGetOutputDto(entity); - } - - public override async Task UpdateAsync(Guid id, CreateUpdateStoreDto input) - { - await CheckUpdatePolicyAsync(); - - var entity = await GetEntityByIdAsync(id); - - MapToEntity(input, entity); - - entity = await _storeManager.UpdateAsync(entity, input.OwnerIds); - - return MapToGetOutputDto(entity); - } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs index ccb37257..a1ab280a 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs @@ -17,11 +17,12 @@ namespace EasyAbp.EShop.Stores CreateMap() .MapExtraProperties(MappingPropertyDefinitionChecks.Both); CreateMap(MemberList.Source) - .MapExtraProperties(MappingPropertyDefinitionChecks.Both) - .ForSourceMember(x => x.OwnerIds, opt => opt.DoNotValidate()); - - CreateMap(); + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(MemberList.Source) + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json index 35015df9..fee46139 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json @@ -7,6 +7,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json index 88eb274d..0e45fd75 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json @@ -8,6 +8,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json index 5b85c8c4..88fb5d97 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json @@ -7,6 +7,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json index 774c1c9e..ce88c998 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json @@ -7,6 +7,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json index cf6c73d7..be095251 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json @@ -8,6 +8,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json index 1cd9bcde..03a99240 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json @@ -8,6 +8,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json index 4a8b2d0b..4d44ef7e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json @@ -7,6 +7,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json index fdcac995..5f1e7414 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json @@ -8,6 +8,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json index 33b25c6c..ab03f468 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json @@ -8,6 +8,11 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "StoreOwner": "StoreOwner", + "Menu:StoreOwner": "MenuStoreOwner", + "CreateStoreOwner": "CreateStoreOwner", + "EditStoreOwner": "EditStoreOwner", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerStore.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerStore.cs new file mode 100644 index 00000000..d207047f --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerStore.cs @@ -0,0 +1,10 @@ +using System; +using System.Threading.Tasks; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public interface IStoreOwnerStore + { + Task IsStoreOwnerAsync(Guid storeId, Guid userId); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj index 485f6190..1aa06f22 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj @@ -8,6 +8,7 @@ + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs index 57da4bb7..61dd6e4b 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs @@ -11,5 +11,7 @@ namespace EasyAbp.EShop.Stores.StoreOwners Task> GetListByStoreIdAsync(Guid storeId, CancellationToken cancellationToken = default); Task> GetListByOwnerIdAsync(Guid ownerId, CancellationToken cancellationToken = default); + + Task IsExistAsync(Guid storeId, Guid ownerId, CancellationToken cancellationToken = default); } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItem.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItem.cs new file mode 100644 index 00000000..9d3edf00 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItem.cs @@ -0,0 +1,24 @@ +using System; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + [Serializable] + public class StoreOwnerCacheItem + { + public bool IsOwner { get; set; } + + public StoreOwnerCacheItem() + { + } + + public StoreOwnerCacheItem(bool isOwner) + { + IsOwner = isOwner; + } + + public static string CalculateCacheKey(Guid storeId, Guid userId) + { + return "s:" + storeId.ToString("D") + ",u:" + userId.ToString("D"); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs new file mode 100644 index 00000000..bed38fcb --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs @@ -0,0 +1,81 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwnerStore : IStoreOwnerStore, ITransientDependency + { + protected ILogger Logger { get; } + protected IStoreOwnerRepository StoreOwnerRepository { get; } + protected IDistributedCache Cache { get; } + + public StoreOwnerStore(ILogger logger, + IStoreOwnerRepository storeOwnerRepository, + IDistributedCache cache) + { + StoreOwnerRepository = storeOwnerRepository; + Cache = cache; + Logger = logger ?? NullLogger.Instance; + } + + public async Task IsStoreOwnerAsync(Guid storeId, Guid userId) + { + return (await GetCacheItemAsync(storeId, userId)).IsOwner; + } + + protected virtual async Task GetCacheItemAsync(Guid storeId, Guid userId) + { + var cacheKey = CalculateCacheKey(storeId, userId); + Logger.LogDebug($"StoreOwnerStore.GetCacheItemAsync: {cacheKey}"); + + var cacheItem = await Cache.GetAsync(cacheKey); + if (cacheItem != null) + { + Logger.LogDebug($"Found in the cache: {cacheKey}"); + return cacheItem; + } + + Logger.LogDebug($"Not found in the cache: {cacheKey}"); + cacheItem = new StoreOwnerCacheItem(false); + + await SetCacheItemsAsync(storeId, userId, cacheItem); + return cacheItem; + } + + protected virtual async Task SetCacheItemsAsync( + Guid storeId, Guid userId, + StoreOwnerCacheItem currentCacheItem) + { + var storeOwners = await StoreOwnerRepository.GetListByStoreIdAsync(storeId); + Logger.LogDebug( + $"Getting all store owner in store: {storeId}"); + + Logger.LogDebug($"Setting the cache items. Count: {storeOwners.Count}"); + + var cacheItems = new Dictionary(); + foreach (var storeOwner in storeOwners) + { + cacheItems.Add(CalculateCacheKey(storeOwner.StoreId, storeOwner.OwnerId), + new StoreOwnerCacheItem(true)); + + if (storeOwner.StoreId == storeId && storeOwner.OwnerId == userId) + { + currentCacheItem.IsOwner = true; + } + } + + await Cache.SetManyAsync(cacheItems); + Logger.LogDebug($"Finished setting the cache items. Count: {storeOwners.Count}"); + } + + protected virtual string CalculateCacheKey(Guid storeId, Guid userId) + { + return StoreOwnerCacheItem.CalculateCacheKey(storeId, userId); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs deleted file mode 100644 index 40a4cecb..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/IStoreManager.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading.Tasks; -using Volo.Abp.Domain.Services; - -namespace EasyAbp.EShop.Stores.Stores -{ - public interface IStoreManager : IDomainService - { - Task CreateAsync(Store store, IEnumerable ownerIds = null); - - Task UpdateAsync(Store store, IEnumerable ownerIds = null); - } -} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs deleted file mode 100644 index 2f8e66e7..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Stores/StoreManager.cs +++ /dev/null @@ -1,58 +0,0 @@ -using EasyAbp.EShop.Stores.StoreOwners; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Volo.Abp.Domain.Services; - -namespace EasyAbp.EShop.Stores.Stores -{ - public class StoreManager : DomainService, IStoreManager - { - private readonly IStoreRepository _storeRepository; - private readonly IStoreOwnerRepository _storeOwnerRepository; - - public StoreManager(IStoreRepository storeRepository, - IStoreOwnerRepository storeOwnerRepository) - { - _storeRepository = storeRepository; - _storeOwnerRepository = storeOwnerRepository; - } - - public async Task CreateAsync(Store store, IEnumerable ownerIds = null) - { - store = await _storeRepository.InsertAsync(store); - - await UpdateStoreOwnersAsync(store.Id, ownerIds); - - return store; - } - - public async Task UpdateAsync(Store store, IEnumerable ownerIds = null) - { - store = await _storeRepository.UpdateAsync(store); - - await UpdateStoreOwnersAsync(store.Id, ownerIds); - - return store; - } - - protected virtual async Task UpdateStoreOwnersAsync(Guid storeId, IEnumerable ownerIds) - { - ownerIds ??= new List(); - - var storeOwners = await _storeOwnerRepository.GetListByStoreIdAsync(storeId); - - foreach (var storeOwner in storeOwners.Where(x => !ownerIds.Contains(x.OwnerId)).ToList()) - { - await _storeOwnerRepository.DeleteAsync(storeOwner, true); - } - - foreach (var ownerId in ownerIds.Except(storeOwners.Select(x => x.OwnerId).ToList())) - { - await _storeOwnerRepository.InsertAsync( - new StoreOwner(GuidGenerator.Create(), storeId, ownerId, CurrentTenant.Id), true); - } - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs index f9b97b84..20e50c5d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs @@ -54,6 +54,9 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore b.ToTable(options.TablePrefix + "StoreOwners", options.Schema); b.ConfigureByConvention(); /* Configure more properties here */ + + b.HasIndex(x => new {x.StoreId, x.OwnerId}) + .IsUnique(); }); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs index 760b63be..22c096f8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs @@ -16,14 +16,25 @@ namespace EasyAbp.EShop.Stores.StoreOwners { } - public async Task> GetListByStoreIdAsync(Guid storeId, CancellationToken cancellationToken = default) + public async Task> GetListByStoreIdAsync(Guid storeId, + CancellationToken cancellationToken = default) { return await GetQueryable().Where(pc => pc.StoreId == storeId).ToListAsync(cancellationToken); } - public async Task> GetListByOwnerIdAsync(Guid ownerId, CancellationToken cancellationToken = default) + public async Task> GetListByOwnerIdAsync(Guid ownerId, + CancellationToken cancellationToken = default) { return await GetQueryable().Where(pc => pc.OwnerId == ownerId).ToListAsync(cancellationToken); } + + public async Task IsExistAsync(Guid storeId, Guid ownerId, CancellationToken cancellationToken = default) + { + var storeOwner = await GetQueryable().FirstOrDefaultAsync( + x => x.StoreId == storeId && x.OwnerId == ownerId, + cancellationToken: cancellationToken); + + return storeOwner != null; + } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs index 81d232b2..74cc09af 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs @@ -1,13 +1,13 @@ -using EasyAbp.EShop.Stores.StoreOwners.Dtos; -using Microsoft.AspNetCore.Mvc; using System; using System.Threading.Tasks; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using Microsoft.AspNetCore.Mvc; using Volo.Abp; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners { - [RemoteService(Name = "EShopStores")] + [RemoteService(Name = "EShopStoreOwners")] [Route("/api/eShop/stores/storeOwner")] public class StoreOwnerController : StoresController { @@ -18,8 +18,8 @@ namespace EasyAbp.EShop.Stores.StoreOwners _service = service; } - [NonAction] - [RemoteService(false)] + [HttpGet] + [Route("{id}")] public Task GetAsync(Guid id) { return _service.GetAsync(id); @@ -30,5 +30,25 @@ namespace EasyAbp.EShop.Stores.StoreOwners { return _service.GetListAsync(input); } + + [HttpPost] + public Task CreateAsync(StoreOwnerDto input) + { + return _service.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public Task UpdateAsync(Guid id, StoreOwnerDto input) + { + return _service.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public Task DeleteAsync(Guid id) + { + return _service.DeleteAsync(id); + } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj index 5657a4f8..01386386 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj @@ -32,10 +32,44 @@ + + true + PreserveNewest + + + true + PreserveNewest + + + true + PreserveNewest +
+ + + + CreateModal.cshtml + + + EditModal.cshtml + + + Index.cshtml + + + CreateModal.cshtml + + + EditModal.cshtml + + + Index.cshtml + + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs index fb91ec4c..a347b8d8 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs @@ -29,6 +29,13 @@ namespace EasyAbp.EShop.Stores.Web.Menus ); } + if (await context.IsGrantedAsync(StoresPermissions.Stores.Manage)) + { + storeManagementMenuItem.AddItem( + new ApplicationMenuItem(StoresMenus.StoreOwner, l["Menu:StoreOwner"], "/EShop/Stores/StoreOwners/StoreOwner") + ); + } + if (!storeManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == StoresMenus.ModuleGroupPrefix, diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs index fc6bf9ec..8147b6a2 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs @@ -7,6 +7,8 @@ public const string Prefix = ModuleGroupPrefix + ".Stores"; public const string Store = Prefix + ".Store"; + + public const string StoreOwner = Prefix + ".StoreOwner"; //Add your menu items here... //public const string Home = Prefix + ".MyNewMenuItem"; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml new file mode 100644 index 00000000..b7055758 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.EShop.Stores.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@inject IHtmlLocalizer L +@model CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs new file mode 100644 index 00000000..55e7f58c --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.StoreOwners; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using EasyAbp.EShop.Stores.Stores; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Identity; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +{ + public class CreateModalModel : StoresPageModel + { + [BindProperty] + public CreateEditStoreOwnerViewModel StoreOwner { get; set; } + + private readonly IStoreAppService _storeService; + private readonly IIdentityUserAppService _userAppService; + private readonly IStoreOwnerAppService _storeOwnerAppService; + + public CreateModalModel(IStoreAppService storeService, + IIdentityUserAppService userAppService, + IStoreOwnerAppService storeOwnerAppService) + { + _storeService = storeService; + _userAppService = userAppService; + _storeOwnerAppService = storeOwnerAppService; + } + + public virtual Task OnGetAsync() + { + return Task.CompletedTask; + } + + public async Task OnPostAsync() + { + var createDto = ObjectMapper.Map(StoreOwner); + var storeOwner = await _storeOwnerAppService.CreateAsync(createDto); + + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml new file mode 100644 index 00000000..caba590b --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml @@ -0,0 +1,20 @@ +@page +@using EasyAbp.EShop.Stores.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal +@using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +@inject IHtmlLocalizer L +@model EditModalModel +@{ + Layout = null; +} + + + + + + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs new file mode 100644 index 00000000..e4baa4d0 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.StoreOwners; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using EasyAbp.EShop.Stores.Stores; +using EasyAbp.EShop.Stores.Stores.Dtos; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Rendering; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Identity; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +{ + public class EditModalModel : StoresPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] public CreateEditStoreOwnerViewModel StoreOwner { get; set; } + + private readonly IStoreAppService _storeService; + private readonly IIdentityUserAppService _userAppService; + private readonly IStoreOwnerAppService _storeOwnerAppService; + + public EditModalModel(IStoreAppService storeService, + IIdentityUserAppService userAppService, + IStoreOwnerAppService storeOwnerAppService) + { + _storeService = storeService; + _userAppService = userAppService; + _storeOwnerAppService = storeOwnerAppService; + } + + public async Task OnGetAsync() + { + + var dto = await _storeOwnerAppService.GetAsync(Id); + StoreOwner = ObjectMapper.Map(dto); + } + + public async Task OnPostAsync() + { + await _storeOwnerAppService.UpdateAsync(Id, + ObjectMapper.Map( StoreOwner)); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml new file mode 100644 index 00000000..c628fd00 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml @@ -0,0 +1,61 @@ +@page +@using EasyAbp.EShop.Stores.Permissions +@using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +@using EasyAbp.EShop.Stores.Localization +@using EasyAbp.EShop.Stores.Web.Menus +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@model IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["StoreOwner"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:StoreOwner"].Value); + PageLayout.Content.MenuItemName = StoresMenus.StoreOwner; +} + +@section scripts +{ + +} + +@section styles +{ + +} + + + + + + + + @L["StoreOwner"] + + + @if (await Authorization.IsGrantedAsync(StoresPermissions.Stores.Manage)) + { + + } + + + + + + + + @L["Actions"] + @L["StoreName"] + @L["OwnerName"] + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml.cs new file mode 100644 index 00000000..e9c80c50 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.cshtml.cs @@ -0,0 +1,21 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner +{ + public class IndexModel : StoresPageModel + { + [BindProperty(SupportsGet = true)] + public Guid? StoreId { get; set; } + + public IndexModel() + { + } + + public Task OnGetAsync() + { + return Task.CompletedTask; + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.css b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.css new file mode 100644 index 00000000..e69de29b diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js new file mode 100644 index 00000000..b4930ca6 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js @@ -0,0 +1,87 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpEShopStores'); + + var service = easyAbp.eShop.stores.storeOwners.storeOwner; + var storeService = easyAbp.eShop.stores.stores.store; + var userService = volo.abp.identity.identityUser; + var createModal = new abp.ModalManager(abp.appPath + 'EShop/Stores/StoreOwners/StoreOwner/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'EShop/Stores/StoreOwners/StoreOwner/EditModal'); + + var dataTable = $('#StoreOwnerTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return {storeId: storeId} + }), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Edit'), + action: function (data) { + editModal.open({id: data.record.id}); + } + }, + { + text: l('Delete'), + confirmMessage: function (data) { + return l('StoreDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { + data: "storeId", + render: function (data, type, row, meta) { + var currentCell = $("#StoreOwnerTable").DataTable().cells({"row":meta.row, "column":meta.col}).nodes(0); + storeService.get(data).then( + x => { + $(currentCell).html(x.name); + }); + return '...'; + } + }, + { + data: "ownerId", + render: function (data, type, row, meta) { + var currentCell = $("#StoreOwnerTable").DataTable().cells({"row":meta.row, "column":meta.col}).nodes(0); + userService.get(data).then( + x=>{ + $(currentCell).html(x.userName); + } + ); + return '...'; + } + } + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewStoreOwnerButton').click(function (e) { + e.preventDefault(); + createModal.open({storeId: storeId}); + }); +}); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs new file mode 100644 index 00000000..70a202a0 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs @@ -0,0 +1,17 @@ +using System; +using System.ComponentModel.DataAnnotations; +using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Form; +using Volo.Abp.ObjectExtending; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels +{ + public class CreateEditStoreOwnerViewModel : ExtensibleObject + { + [Required] + public Guid StoreId { get; set; } + + + [Required] + public Guid OwnerId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs index 315e88dc..a0c2a3e0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs @@ -39,7 +39,7 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store public async Task OnPostAsync() { var createDto = ObjectMapper.Map(Store); - var product = await _service.CreateAsync(createDto); + var store = await _service.CreateAsync(createDto); return NoContent(); } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs index 77e07738..de233e00 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/EditModal.cshtml.cs @@ -23,36 +23,17 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store [BindProperty] public CreateEditStoreViewModel Store { get; set; } - public ICollection StoreOwners { get; set; } - private readonly IStoreAppService _service; - private readonly IIdentityUserAppService _userAppService; - private readonly IStoreOwnerAppService _storeOwnerAppService; - public EditModalModel(IStoreAppService service, - IIdentityUserAppService userAppService, - IStoreOwnerAppService storeOwnerAppService) + public EditModalModel(IStoreAppService service) { _service = service; - _userAppService = userAppService; - _storeOwnerAppService = storeOwnerAppService; } public async Task OnGetAsync() { - StoreOwners = - (await _userAppService.GetListAsync(new GetIdentityUsersInput - { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items - .Select(x => new SelectListItem(x.UserName, x.Id.ToString())).ToList(); - var dto = await _service.GetAsync(Id); Store = ObjectMapper.Map(dto); - - Store.OwnerIds = (await _storeOwnerAppService.GetListAsync(new GetStoreOwnerListDto - { - StoreId = Id, - MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount - })).Items.Select(x => x.OwnerId).ToList(); } public async Task OnPostAsync() diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml index ffecf74d..20576000 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/Index.cshtml @@ -11,8 +11,8 @@ @inject IHtmlLocalizer L @inject IAuthorizationService Authorization @{ - PageLayout.Content.Title = L["BasketItem"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:BasketItem"].Value); + PageLayout.Content.Title = L["Store"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Store"].Value); PageLayout.Content.MenuItemName = StoresMenus.Store; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs index cddc2499..87dc5aa0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs @@ -11,10 +11,5 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels [Required] [Display(Name = "StoreName")] public string Name { get; set; } - - - [SelectItems("StoreOwners")] - [Display(Name = "StoreOwner")] - public List OwnerIds { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs index beb7bfc1..62674ee0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs @@ -1,5 +1,7 @@ using EasyAbp.EShop.Stores.Stores.Dtos; using AutoMapper; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; using Volo.Abp.AutoMapper; using Volo.Abp.ObjectExtending; @@ -14,9 +16,13 @@ namespace EasyAbp.EShop.Stores.Web * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both) - .Ignore(x=>x.OwnerIds); - CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(MemberList.Source) + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + + CreateMap() + .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(MemberList.Source) .MapExtraProperties(MappingPropertyDefinitionChecks.Both); } } From 16d99b296cd11cc5f662acdd28027b3dc9d6e9bb Mon Sep 17 00:00:00 2001 From: RayMMond Date: Sat, 15 Aug 2020 17:41:54 +0800 Subject: [PATCH 05/24] Add multi store crud app service base classes, remove unnecessary service injections --- .../Orders/Orders/Dtos/CreateOrderDto.cs | 3 +- .../EasyAbp.EShop.Orders.Application.csproj | 2 +- .../Orders/IPurchasableCheckProvider.cs | 2 +- .../Orders/Orders/IPurchasableChecker.cs | 2 +- .../EShop/Orders/Orders/OrderAppService.cs | 30 +-- .../EasyAbp/EShop/Orders/Orders/Order.cs | 1 + .../Payments/Payments/PaymentAppService.cs | 9 +- .../Payments/Refunds/RefundAppService.cs | 8 +- .../StoreOwnerAuthorizationExtensions.cs | 4 +- ...StorePermissionAuthorizationRequirement.cs | 2 +- .../StoreOwners/Dtos/GetStoreOwnerListDto.cs | 1 + .../Stores/StoreOwners/Dtos/StoreOwnerDto.cs | 3 +- .../StoreOwners/StoreOwnerAppService.cs | 12 +- .../MultiStoreAbstractKeyCrudAppService.cs | 211 ++++++++++++++++ ...MultiStoreAbstractKeyReadOnlyAppService.cs | 236 ++++++++++++++++++ .../Stores/Stores/MultiStoreCrudAppService.cs | 116 +++++++++ .../Stores/MultiStoreReadOnlyAppService.cs | 64 +++++ .../EShop/Stores/StoreOwners/StoreOwner.cs | 3 +- .../StoreOwner/CreateModal.cshtml.cs | 14 +- .../StoreOwner/EditModal.cshtml.cs | 19 +- .../Stores/Stores/Store/CreateModal.cshtml.cs | 21 +- 21 files changed, 678 insertions(+), 85 deletions(-) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs index a43a76b5..e6447e0f 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/CreateOrderDto.cs @@ -3,11 +3,12 @@ using System.Collections.Generic; using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.Linq; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Data; namespace EasyAbp.EShop.Orders.Orders.Dtos { - public class CreateOrderDto : IHasExtraProperties, IValidatableObject + public class CreateOrderDto : IHasExtraProperties, IValidatableObject, IMultiStore { [DisplayName("OrderStoreId")] public Guid StoreId { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj index d7268683..c55a2f15 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj @@ -11,7 +11,7 @@ - +
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs index 572cf8a8..98b3c1d1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableCheckProvider.cs @@ -6,7 +6,7 @@ using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Orders.Orders { - public interface IPurchasableChecker + public interface IPurchasableCheckProvider { Task CheckAsync(CreateOrderDto input, Dictionary productDict, Dictionary orderExtraProperties); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs index 98b3c1d1..572cf8a8 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/IPurchasableChecker.cs @@ -6,7 +6,7 @@ using EasyAbp.EShop.Products.Products.Dtos; namespace EasyAbp.EShop.Orders.Orders { - public interface IPurchasableCheckProvider + public interface IPurchasableChecker { Task CheckAsync(CreateOrderDto input, Dictionary productDict, Dictionary orderExtraProperties); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index 82cc678a..4d62e17a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -7,21 +7,24 @@ using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Stores; using Microsoft.AspNetCore.Authorization; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Authorization; using Volo.Abp.Users; namespace EasyAbp.EShop.Orders.Orders { [Authorize] - public class OrderAppService : CrudAppService, + public class OrderAppService : MultiStoreCrudAppService, IOrderAppService { protected override string CreatePolicyName { get; set; } = OrdersPermissions.Orders.Create; - protected override string GetPolicyName { get; set; } = OrdersPermissions.Orders.Default; - protected override string GetListPolicyName { get; set; } = OrdersPermissions.Orders.Default; + protected override string GetPolicyName { get; set; } = OrdersPermissions.Orders.Manage; + protected override string GetListPolicyName { get; set; } = OrdersPermissions.Orders.Manage; + protected override string CrossStorePolicyName { get; set; } = OrdersPermissions.Orders.CrossStore; private readonly INewOrderGenerator _newOrderGenerator; private readonly IProductAppService _productAppService; @@ -64,16 +67,14 @@ namespace EasyAbp.EShop.Orders.Orders { if (input.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(OrdersPermissions.Orders.Manage); - if (input.StoreId.HasValue) { - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, - OrdersPermissions.Orders.Manage); + await CheckMultiStorePolicyAsync(input.StoreId.Value, GetListPolicyName); } else { - await AuthorizationService.CheckAsync(OrdersPermissions.Orders.CrossStore); + throw new AbpAuthorizationException("Authorization failed! Given policy has not granted: " + + GetListPolicyName); } } @@ -82,14 +83,11 @@ namespace EasyAbp.EShop.Orders.Orders public override async Task GetAsync(Guid id) { - await CheckGetPolicyAsync(); - var order = await GetEntityByIdAsync(id); if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, - OrdersPermissions.Orders.Manage); + await CheckMultiStorePolicyAsync(order.StoreId, GetPolicyName); } return MapToGetOutputDto(order); @@ -97,7 +95,7 @@ namespace EasyAbp.EShop.Orders.Orders public override async Task CreateAsync(CreateOrderDto input) { - await CheckCreatePolicyAsync(); + await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); // Todo: Check if the store is open. @@ -107,7 +105,7 @@ namespace EasyAbp.EShop.Orders.Orders var orderExtraProperties = new Dictionary(); await _purchasableChecker.CheckAsync(input, productDict, orderExtraProperties); - + var order = await _newOrderGenerator.GenerateAsync(input, productDict, orderExtraProperties); await _orderManager.DiscountAsync(order, input.ExtraProperties); @@ -135,7 +133,7 @@ namespace EasyAbp.EShop.Orders.Orders { throw new NotSupportedException(); } - + [RemoteService(false)] public override Task DeleteAsync(Guid id) { @@ -144,8 +142,6 @@ namespace EasyAbp.EShop.Orders.Orders public virtual async Task GetByOrderNumberAsync(string orderNumber) { - await CheckGetPolicyAsync(); - var order = await _repository.GetAsync(x => x.OrderNumber == orderNumber); if (order.CustomerUserId != CurrentUser.GetId()) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs index 53dca4cf..73efb8f9 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using EasyAbp.EShop.Stores.Stores; using JetBrains.Annotations; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs index c25a47fd..522eb2fa 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -9,6 +9,7 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.EventBus.Distributed; @@ -20,8 +21,8 @@ namespace EasyAbp.EShop.Payments.Payments public class PaymentAppService : ReadOnlyAppService, IPaymentAppService { - protected override string GetPolicyName { get; set; } = PaymentsPermissions.Payments.Default; - protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Payments.Default; + protected override string GetPolicyName { get; set; } = PaymentsPermissions.Payments.Manage; + protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Payments.Manage; private readonly IPayableChecker _payableChecker; private readonly IDistributedEventBus _distributedEventBus; @@ -46,7 +47,7 @@ namespace EasyAbp.EShop.Payments.Payments if (payment.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); + await CheckPolicyAsync(GetPolicyName); } return payment; @@ -68,7 +69,7 @@ namespace EasyAbp.EShop.Payments.Payments { if (input.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Payments.Manage); + await CheckPolicyAsync(GetListPolicyName); } return await base.GetListAsync(input); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs index cc21d5ca..34e5cb10 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs @@ -16,8 +16,8 @@ namespace EasyAbp.EShop.Payments.Refunds public class RefundAppService : ReadOnlyAppService, IRefundAppService { - protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; - protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Default; + protected override string GetPolicyName { get; set; } = PaymentsPermissions.Refunds.Manage; + protected override string GetListPolicyName { get; set; } = PaymentsPermissions.Refunds.Manage; private readonly IPaymentRepository _paymentRepository; private readonly IRefundRepository _repository; @@ -38,7 +38,7 @@ namespace EasyAbp.EShop.Payments.Refunds if (payment.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); + await CheckPolicyAsync(GetPolicyName); } return refund; @@ -55,7 +55,7 @@ namespace EasyAbp.EShop.Payments.Refunds { if (input.UserId != CurrentUser.GetId()) { - await AuthorizationService.CheckAsync(PaymentsPermissions.Refunds.Manage); + await CheckPolicyAsync(GetListPolicyName); } return await base.GetListAsync(input); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs index b0172516..36f2b450 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs @@ -7,14 +7,14 @@ namespace EasyAbp.EShop.Stores.Permissions public static class StoreOwnerAuthorizationExtensions { public static Task IsStoreOwnerGrantedAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName, object resource = null) + Guid storeId, string policyName = null, object resource = null) { return authorizationService.IsGrantedAsync(resource, new StorePermissionAuthorizationRequirement(storeId, policyName)); } public static Task CheckStoreOwnerAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName, object resource = null) + Guid storeId, string policyName = null, object resource = null) { return authorizationService.CheckAsync(resource, new StorePermissionAuthorizationRequirement(storeId, policyName)); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs index 56a6459a..bc3b087e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs @@ -5,7 +5,7 @@ namespace EasyAbp.EShop.Stores.Permissions { public class StorePermissionAuthorizationRequirement : IAuthorizationRequirement { - internal StorePermissionAuthorizationRequirement(Guid storeId, string policyName = null) + public StorePermissionAuthorizationRequirement(Guid storeId, string policyName = null) { StoreId = storeId; PolicyName = policyName; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs index 2d98b1d9..7272053f 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs @@ -1,4 +1,5 @@ using System; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners.Dtos diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs index e95dc870..d2f0bce0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs @@ -1,10 +1,11 @@ using System; using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners.Dtos { - public class StoreOwnerDto : ExtensibleFullAuditedEntityDto + public class StoreOwnerDto : ExtensibleFullAuditedEntityDto, IMultiStore { [Required] public Guid StoreId { get; set; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index 8d9ab163..ad2024e4 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -1,14 +1,13 @@ -using EasyAbp.EShop.Stores.Permissions; -using EasyAbp.EShop.Stores.StoreOwners.Dtos; -using System; +using System; using System.Linq; using System.Threading.Tasks; -using Volo.Abp; -using Volo.Abp.Application.Services; +using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.StoreOwners.Dtos; +using EasyAbp.EShop.Stores.Stores; namespace EasyAbp.EShop.Stores.StoreOwners { - public class StoreOwnerAppService : CrudAppService, + public class StoreOwnerAppService : MultiStoreCrudAppService, IStoreOwnerAppService { protected override string CreatePolicyName { get; set; } = StoresPermissions.Stores.Manage; @@ -16,6 +15,7 @@ namespace EasyAbp.EShop.Stores.StoreOwners protected override string UpdatePolicyName { get; set; } = StoresPermissions.Stores.Manage; protected override string GetPolicyName { get; set; } = StoresPermissions.Stores.Manage; protected override string GetListPolicyName { get; set; } = StoresPermissions.Stores.Manage; + protected override string CrossStorePolicyName { get; set; } = StoresPermissions.Stores.CrossStore; private readonly IStoreOwnerRepository _repository; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs new file mode 100644 index 00000000..cc16d491 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -0,0 +1,211 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.MultiTenancy; +using Volo.Abp.ObjectMapping; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + + protected override Task MapToGetListOutputDtoAsync(TEntity entity) + { + return MapToGetOutputDtoAsync(entity); + } + + protected override TEntityDto MapToGetListOutputDto(TEntity entity) + { + return MapToGetOutputDto(entity); + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyReadOnlyAppService, + ICrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected IRepository Repository { get; } + + protected virtual string CreatePolicyName { get; set; } + + protected virtual string UpdatePolicyName { get; set; } + + protected virtual string DeletePolicyName { get; set; } + + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + Repository = repository; + } + + public virtual async Task CreateAsync(TCreateInput input) + { + await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); + + var entity = await MapToEntityAsync(input); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return await MapToGetOutputDtoAsync(entity); + } + + public virtual async Task UpdateAsync(TKey id, TUpdateInput input) + { + var entity = await GetEntityByIdAsync(id); + await CheckMultiStorePolicyAsync(entity.StoreId, UpdatePolicyName); + //TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise + await MapToEntityAsync(input, entity); + await Repository.UpdateAsync(entity, autoSave: true); + + return await MapToGetOutputDtoAsync(entity); + } + + public virtual async Task DeleteAsync(TKey id) + { + var entity = await GetEntityByIdAsync(id); + await CheckMultiStorePolicyAsync(entity.StoreId, DeletePolicyName); + + await DeleteByIdAsync(id); + } + + protected abstract Task DeleteByIdAsync(TKey id); + + /// + /// Maps to to create a new entity. + /// It uses by default. + /// It can be overriden for custom mapping. + /// Overriding this has higher priority than overriding the + /// + protected virtual Task MapToEntityAsync(TCreateInput createInput) + { + return Task.FromResult(MapToEntity(createInput)); + } + + /// + /// Maps to to create a new entity. + /// It uses by default. + /// It can be overriden for custom mapping. + /// + protected virtual TEntity MapToEntity(TCreateInput createInput) + { + var entity = ObjectMapper.Map(createInput); + SetIdForGuids(entity); + return entity; + } + + /// + /// Sets Id value for the entity if is . + /// It's used while creating a new entity. + /// + protected virtual void SetIdForGuids(TEntity entity) + { + if (entity is IEntity entityWithGuidId && entityWithGuidId.Id == Guid.Empty) + { + EntityHelper.TrySetId( + entityWithGuidId, + () => GuidGenerator.Create(), + true + ); + } + } + + /// + /// Maps to to update the entity. + /// It uses by default. + /// It can be overriden for custom mapping. + /// Overriding this has higher priority than overriding the + /// + protected virtual Task MapToEntityAsync(TUpdateInput updateInput, TEntity entity) + { + MapToEntity(updateInput, entity); + return Task.CompletedTask; + } + + /// + /// Maps to to update the entity. + /// It uses by default. + /// It can be overriden for custom mapping. + /// + protected virtual void MapToEntity(TUpdateInput updateInput, TEntity entity) + { + ObjectMapper.Map(updateInput, entity); + } + + protected virtual void TryToSetTenantId(TEntity entity) + { + if (entity is IMultiTenant && HasTenantIdProperty(entity)) + { + var tenantId = CurrentTenant.Id; + + if (!tenantId.HasValue) + { + return; + } + + var propertyInfo = entity.GetType().GetProperty(nameof(IMultiTenant.TenantId)); + + if (propertyInfo == null || propertyInfo.GetSetMethod(true) == null) + { + return; + } + + propertyInfo.SetValue(entity, tenantId); + } + } + + protected virtual bool HasTenantIdProperty(TEntity entity) + { + return entity.GetType().GetProperty(nameof(IMultiTenant.TenantId)) != null; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs new file mode 100644 index 00000000..c1b1f2e1 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs @@ -0,0 +1,236 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Dynamic.Core; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Permissions; +using Volo.Abp; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; +using Volo.Abp.ObjectMapping; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : MultiStoreAbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + + } + } + + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : MultiStoreAbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : ApplicationService + , IReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected IReadOnlyRepository ReadOnlyRepository { get; } + + protected virtual string GetPolicyName { get; set; } + + protected virtual string GetListPolicyName { get; set; } + + protected virtual string CrossStorePolicyName { get; set; } + + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + { + ReadOnlyRepository = repository; + } + + public virtual async Task GetAsync(TKey id) + { + var entity = await GetEntityByIdAsync(id); + + await CheckMultiStorePolicyAsync(entity.StoreId, GetPolicyName); + + return await MapToGetOutputDtoAsync(entity); + } + + public virtual async Task> GetListAsync(TGetListInput input) + { + await CheckGetListPolicyAsync(); + + var query = CreateFilteredQuery(input); + + var totalCount = await AsyncExecuter.CountAsync(query); + + query = ApplySorting(query, input); + query = ApplyPaging(query, input); + + var entities = await AsyncExecuter.ToListAsync(query); + var entityDtos = await MapToGetListOutputDtosAsync(entities); + + return new PagedResultDto( + totalCount, + entityDtos + ); + } + + protected virtual async Task CheckGetListPolicyAsync() + { + await CheckPolicyAsync(GetListPolicyName); + } + + protected abstract Task GetEntityByIdAsync(TKey id); + + protected virtual async Task CheckMultiStorePolicyAsync(Guid storeId, string policyName) + { + if (!await AuthorizationService.IsStoreOwnerGrantedAsync(storeId, policyName)) + { + await CheckPolicyAsync(CrossStorePolicyName); + await CheckPolicyAsync(policyName); + } + } + + /// + /// Should apply sorting if needed. + /// + /// The query. + /// The input. + protected virtual IQueryable ApplySorting(IQueryable query, TGetListInput input) + { + //Try to sort query if available + if (input is ISortedResultRequest sortInput) + { + if (!sortInput.Sorting.IsNullOrWhiteSpace()) + { + return query.OrderBy(sortInput.Sorting); + } + } + + //IQueryable.Task requires sorting, so we should sort if Take will be used. + if (input is ILimitedResultRequest) + { + return ApplyDefaultSorting(query); + } + + //No sorting + return query; + } + + /// + /// Applies sorting if no sorting specified but a limited result requested. + /// + /// The query. + protected virtual IQueryable ApplyDefaultSorting(IQueryable query) + { + if (typeof(TEntity).IsAssignableTo()) + { + return query.OrderByDescending(e => ((IHasCreationTime) e).CreationTime); + } + + throw new AbpException( + "No sorting specified but this query requires sorting. Override the ApplyDefaultSorting method for your application service derived from AbstractKeyReadOnlyAppService!"); + } + + /// + /// Should apply paging if needed. + /// + /// The query. + /// The input. + protected virtual IQueryable ApplyPaging(IQueryable query, TGetListInput input) + { + //Try to use paging if available + if (input is IPagedResultRequest pagedInput) + { + return query.PageBy(pagedInput); + } + + //Try to limit query result if available + if (input is ILimitedResultRequest limitedInput) + { + return query.Take(limitedInput.MaxResultCount); + } + + //No paging + return query; + } + + /// + /// This method should create based on given input. + /// It should filter query if needed, but should not do sorting or paging. + /// Sorting should be done in and paging should be done in + /// methods. + /// + /// The input. + protected virtual IQueryable CreateFilteredQuery(TGetListInput input) + { + return ReadOnlyRepository; + } + + /// + /// Maps to . + /// It internally calls the by default. + /// It can be overriden for custom mapping. + /// Overriding this has higher priority than overriding the + /// + protected virtual Task MapToGetOutputDtoAsync(TEntity entity) + { + return Task.FromResult(MapToGetOutputDto(entity)); + } + + /// + /// Maps to . + /// It uses by default. + /// It can be overriden for custom mapping. + /// + protected virtual TGetOutputDto MapToGetOutputDto(TEntity entity) + { + return ObjectMapper.Map(entity); + } + + /// + /// Maps a list of to objects. + /// It uses method for each item in the list. + /// + protected virtual async Task> MapToGetListOutputDtosAsync(List entities) + { + var dtos = new List(); + + foreach (var entity in entities) + { + dtos.Add(await MapToGetListOutputDtoAsync(entity)); + } + + return dtos; + } + + /// + /// Maps to . + /// It internally calls the by default. + /// It can be overriden for custom mapping. + /// Overriding this has higher priority than overriding the + /// + protected virtual Task MapToGetListOutputDtoAsync(TEntity entity) + { + return Task.FromResult(MapToGetListOutputDto(entity)); + } + + /// + /// Maps to . + /// It uses by default. + /// It can be overriden for custom mapping. + /// + protected virtual TGetListOutputDto MapToGetListOutputDto(TEntity entity) + { + return ObjectMapper.Map(entity); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs new file mode 100644 index 00000000..bbf4f448 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs @@ -0,0 +1,116 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreCrudAppService + : MultiStoreCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto, IMultiStore + { + protected MultiStoreCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreCrudAppService + : MultiStoreCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto, IMultiStore + { + protected MultiStoreCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreCrudAppService + : MultiStoreCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto + where TCreateInput : IMultiStore + { + protected MultiStoreCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreCrudAppService + : MultiStoreCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto + where TCreateInput : IMultiStore + { + protected MultiStoreCrudAppService(IRepository repository) + : base(repository) + { + } + + protected override Task MapToGetListOutputDtoAsync(TEntity entity) + { + return base.MapToGetOutputDtoAsync(entity); + } + + protected override TEntityDto MapToGetListOutputDto(TEntity entity) + { + return MapToGetOutputDto(entity); + } + } + + public abstract class MultiStoreCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TGetOutputDto : IEntityDto + where TGetListOutputDto : IEntityDto + where TCreateInput : IMultiStore + { + protected new IRepository Repository { get; } + + protected MultiStoreCrudAppService(IRepository repository) + : base(repository) + { + Repository = repository; + } + + protected override async Task DeleteByIdAsync(TKey id) + { + await Repository.DeleteAsync(id); + } + + protected override async Task GetEntityByIdAsync(TKey id) + { + return await Repository.GetAsync(id); + } + + protected override void MapToEntity(TUpdateInput updateInput, TEntity entity) + { + if (updateInput is IEntityDto entityDto) + { + entityDto.Id = entity.Id; + } + + base.MapToEntity(updateInput, entity); + } + + protected override IQueryable ApplyDefaultSorting(IQueryable query) + { + if (typeof(TEntity).IsAssignableTo()) + { + return query.OrderByDescending(e => ((IHasCreationTime) e).CreationTime); + } + else + { + return query.OrderByDescending(e => e.Id); + } + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs new file mode 100644 index 00000000..02688eb7 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs @@ -0,0 +1,64 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreReadOnlyAppService + : MultiStoreReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto + { + protected MultiStoreReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreReadOnlyAppService + : MultiStoreReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IEntityDto + { + protected MultiStoreReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreReadOnlyAppService + : MultiStoreAbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + where TGetOutputDto : IEntityDto + where TGetListOutputDto : IEntityDto + { + protected new IReadOnlyRepository Repository { get; } + + protected MultiStoreReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + Repository = repository; + } + + protected override async Task GetEntityByIdAsync(TKey id) + { + return await Repository.GetAsync(id); + } + + protected override IQueryable ApplyDefaultSorting(IQueryable query) + { + if (typeof(TEntity).IsAssignableTo()) + { + return query.OrderByDescending(e => ((ICreationAuditedObject) e).CreationTime); + } + else + { + return query.OrderByDescending(e => e.Id); + } + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs index 91c962ad..c8e89ac1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs @@ -1,10 +1,11 @@ using System; +using EasyAbp.EShop.Stores.Stores; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; namespace EasyAbp.EShop.Stores.StoreOwners { - public class StoreOwner : FullAuditedAggregateRoot, IMultiTenant + public class StoreOwner : FullAuditedAggregateRoot, IMultiTenant, IMultiStore { public virtual Guid? TenantId { get; protected set; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs index 55e7f58c..a5cb4b62 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs @@ -1,14 +1,8 @@ -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Stores.StoreOwners; using EasyAbp.EShop.Stores.StoreOwners.Dtos; -using EasyAbp.EShop.Stores.Stores; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Identity; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner { @@ -17,16 +11,10 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner [BindProperty] public CreateEditStoreOwnerViewModel StoreOwner { get; set; } - private readonly IStoreAppService _storeService; - private readonly IIdentityUserAppService _userAppService; private readonly IStoreOwnerAppService _storeOwnerAppService; - public CreateModalModel(IStoreAppService storeService, - IIdentityUserAppService userAppService, - IStoreOwnerAppService storeOwnerAppService) + public CreateModalModel(IStoreOwnerAppService storeOwnerAppService) { - _storeService = storeService; - _userAppService = userAppService; _storeOwnerAppService = storeOwnerAppService; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs index e4baa4d0..78f39ffe 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs @@ -1,17 +1,9 @@ using System; -using System.Collections.Generic; -using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Stores.StoreOwners; using EasyAbp.EShop.Stores.StoreOwners.Dtos; -using EasyAbp.EShop.Stores.Stores; -using EasyAbp.EShop.Stores.Stores.Dtos; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels; -using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Identity; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner { @@ -23,22 +15,15 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner [BindProperty] public CreateEditStoreOwnerViewModel StoreOwner { get; set; } - private readonly IStoreAppService _storeService; - private readonly IIdentityUserAppService _userAppService; private readonly IStoreOwnerAppService _storeOwnerAppService; - public EditModalModel(IStoreAppService storeService, - IIdentityUserAppService userAppService, - IStoreOwnerAppService storeOwnerAppService) + public EditModalModel(IStoreOwnerAppService storeOwnerAppService) { - _storeService = storeService; - _userAppService = userAppService; _storeOwnerAppService = storeOwnerAppService; } public async Task OnGetAsync() { - var dto = await _storeOwnerAppService.GetAsync(Id); StoreOwner = ObjectMapper.Map(dto); } @@ -46,7 +31,7 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner public async Task OnPostAsync() { await _storeOwnerAppService.UpdateAsync(Id, - ObjectMapper.Map( StoreOwner)); + ObjectMapper.Map(StoreOwner)); return NoContent(); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs index a0c2a3e0..a3cb3e92 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs @@ -13,33 +13,24 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store { public class CreateModalModel : StoresPageModel { - [BindProperty] - public CreateEditStoreViewModel Store { get; set; } - - public ICollection StoreOwners { get; set; } + [BindProperty] public CreateEditStoreViewModel Store { get; set; } private readonly IStoreAppService _service; - private readonly IIdentityUserAppService _userAppService; - public CreateModalModel(IStoreAppService service, - IIdentityUserAppService userAppService) + public CreateModalModel(IStoreAppService service) { _service = service; - _userAppService = userAppService; } - public virtual async Task OnGetAsync() + public virtual Task OnGetAsync() { - StoreOwners = - (await _userAppService.GetListAsync(new GetIdentityUsersInput - { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items - .Select(dto => new SelectListItem(dto.UserName, dto.Id.ToString())).ToList(); + return Task.CompletedTask; } public async Task OnPostAsync() { - var createDto = ObjectMapper.Map(Store); - var store = await _service.CreateAsync(createDto); + var store = await _service.CreateAsync( + ObjectMapper.Map(Store)); return NoContent(); } From 80493f496f7ddb975d377fb225060744099bdb80 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Sat, 15 Aug 2020 17:49:56 +0800 Subject: [PATCH 06/24] StoreDto use right extensible base class, revert unwanted changes --- .../EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs | 2 +- .../Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs index 24d11fd8..763cf110 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/StoreDto.cs @@ -4,7 +4,7 @@ using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.Stores.Dtos { - public class StoreDto : ExtensibleAuditedEntityDto + public class StoreDto : ExtensibleFullAuditedEntityDto { [Required] public string Name { get; set; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs index a3cb3e92..83ea0ba6 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/CreateModal.cshtml.cs @@ -13,7 +13,8 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store { public class CreateModalModel : StoresPageModel { - [BindProperty] public CreateEditStoreViewModel Store { get; set; } + [BindProperty] + public CreateEditStoreViewModel Store { get; set; } private readonly IStoreAppService _service; From 0335be9281f6284c75324fc1c5833079ed19bfd9 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Wed, 26 Aug 2020 17:25:02 +0800 Subject: [PATCH 07/24] 1. Move store owner related base classes to EasyAbp.EShop.Stores.Application.Shared 2. minor refactoring --- .../EasyAbp.EShop.Orders.Application.csproj | 2 +- .../Orders/EShopOrdersApplicationModule.cs | 2 + .../EShop/Orders/Orders/OrderAppService.cs | 14 +- .../EasyAbp.EShop.Products.Application.csproj | 2 +- .../EShopProductsApplicationModule.cs | 2 + .../ProductInventoryAppService.cs | 10 +- .../Products/Products/ProductAppService.cs | 28 ++- .../Products/Products/Product/Index.cshtml.cs | 2 +- .../EShopStoresApplicationContractsModule.cs | 12 +- .../StoreOwnerAuthorizationExtensions.cs | 23 -- .../StoreOwners/Dtos/GetStoreOwnerListDto.cs | 2 +- .../Stores/StoreOwners/Dtos/StoreOwnerDto.cs | 2 +- .../StoreOwnerDuplicatedException.cs | 4 +- ...Abp.EShop.Stores.Application.Shared.csproj | 16 ++ .../EShopStoresApplicationSharedModule.cs | 22 ++ ...asicStorePermissionAuthorizationHandler.cs | 0 .../StoreOwnerAuthorizationExtensions.cs | 50 ++++ ...StorePermissionAuthorizationRequirement.cs | 0 .../MultiStoreAbstractKeyCrudAppService.cs | 125 ++++++++++ ...MultiStoreAbstractKeyReadOnlyAppService.cs | 65 +++++ .../Stores/Stores/MultiStoreCrudAppService.cs | 22 +- .../Stores/MultiStoreReadOnlyAppService.cs | 4 +- .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 +++ .../EasyAbp.EShop.Stores.Application.csproj | 1 + .../StoreOwners/StoreOwnerAppService.cs | 20 +- .../MultiStoreAbstractKeyCrudAppService.cs | 211 ---------------- ...MultiStoreAbstractKeyReadOnlyAppService.cs | 236 ------------------ .../StoreOwners/IStoreOwnerRepository.cs | 4 +- .../EShop/Stores/StoreOwners/StoreOwner.cs | 6 +- .../Stores/StoreOwners/StoreOwnerStore.cs | 4 +- .../StoresDbContextModelCreatingExtensions.cs | 6 +- .../StoreOwners/StoreOwnerRepository.cs | 8 +- .../EasyAbp.EShop.Stores.Web.csproj | 36 +-- .../Stores/StoreOwners/StoreOwner/Index.js | 2 +- .../ViewModels/CreateStoreOwnerViewModel.cs | 2 +- 36 files changed, 390 insertions(+), 588 deletions(-) delete mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp.EShop.Stores.Application.Shared.csproj create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs rename modules/EasyAbp.EShop.Stores/src/{EasyAbp.EShop.Stores.Application.Contracts => EasyAbp.EShop.Stores.Application.Shared}/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs (100%) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs rename modules/EasyAbp.EShop.Stores/src/{EasyAbp.EShop.Stores.Application.Contracts => EasyAbp.EShop.Stores.Application.Shared}/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs (100%) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs rename modules/EasyAbp.EShop.Stores/src/{EasyAbp.EShop.Stores.Application => EasyAbp.EShop.Stores.Application.Shared}/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs (84%) rename modules/EasyAbp.EShop.Stores/src/{EasyAbp.EShop.Stores.Application => EasyAbp.EShop.Stores.Application.Shared}/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs (95%) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xsd delete mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs delete mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj index c55a2f15..02950336 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp.EShop.Orders.Application.csproj @@ -11,7 +11,7 @@ - +
diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs index 444cd40d..6bc4e6eb 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs @@ -1,4 +1,5 @@ using EasyAbp.EShop.Products; +using EasyAbp.EShop.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; @@ -10,6 +11,7 @@ namespace EasyAbp.EShop.Orders typeof(EShopOrdersDomainModule), typeof(EShopOrdersApplicationContractsModule), typeof(EShopProductsApplicationContractsModule), + typeof(EShopStoresDomainSharedModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) )] diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index c73e949b..b08c4e95 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -67,15 +67,7 @@ namespace EasyAbp.EShop.Orders.Orders { if (input.CustomerUserId != CurrentUser.GetId()) { - if (input.StoreId.HasValue) - { - await CheckMultiStorePolicyAsync(input.StoreId.Value, GetListPolicyName); - } - else - { - throw new AbpAuthorizationException("Authorization failed! Given policy has not granted: " + - GetListPolicyName); - } + await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName); } return await base.GetListAsync(input); @@ -146,7 +138,7 @@ namespace EasyAbp.EShop.Orders.Orders if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage); + await CheckMultiStorePolicyAsync(order.StoreId, OrdersPermissions.Orders.Manage); } return MapToGetOutputDto(order); @@ -159,7 +151,7 @@ namespace EasyAbp.EShop.Orders.Orders if (order.CustomerUserId != CurrentUser.GetId()) { - await AuthorizationService.CheckStoreOwnerAsync(order.StoreId, OrdersPermissions.Orders.Manage); + await CheckMultiStorePolicyAsync(order.StoreId, OrdersPermissions.Orders.Manage); } order = await _orderManager.CompleteAsync(order); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj index 99b3a948..a80318c7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp.EShop.Products.Application.csproj @@ -11,7 +11,7 @@ - +
diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs index 69403614..8bd0ba3e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs @@ -1,4 +1,5 @@ using EasyAbp.Abp.Trees; +using EasyAbp.EShop.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; @@ -9,6 +10,7 @@ namespace EasyAbp.EShop.Products [DependsOn( typeof(EShopProductsDomainModule), typeof(EShopProductsApplicationContractsModule), + typeof(EShopStoresDomainSharedModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule), typeof(AbpTreesApplicationModule) diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs index 8244fc94..c894261f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs @@ -52,7 +52,9 @@ namespace EasyAbp.EShop.Products.ProductInventories throw new AbpValidationException("StoreId should not be null."); } - await AuthorizationService.CheckStoreOwnerAsync(input.StoreId.Value, ProductsPermissions.ProductInventory.Update); + await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId.Value, + ProductsPermissions.ProductInventory.CrossStore, + ProductsPermissions.ProductInventory.Update); await _productStoreRepository.GetAsync(input.ProductId, input.StoreId.Value); } @@ -76,7 +78,8 @@ namespace EasyAbp.EShop.Products.ProductInventories { if (changedInventory >= 0) { - if (!await _productInventoryProvider.TryIncreaseInventoryAsync(productInventory, changedInventory, false)) + if (!await _productInventoryProvider.TryIncreaseInventoryAsync(productInventory, changedInventory, + false)) { throw new InventoryChangeFailedException(productInventory.ProductId, productInventory.ProductSkuId, productInventory.Inventory, changedInventory); @@ -84,7 +87,8 @@ namespace EasyAbp.EShop.Products.ProductInventories } else { - if (!await _productInventoryProvider.TryReduceInventoryAsync(productInventory, -changedInventory, false)) + if (!await _productInventoryProvider.TryReduceInventoryAsync(productInventory, -changedInventory, false) + ) { throw new InventoryChangeFailedException(productInventory.ProductId, productInventory.ProductSkuId, productInventory.Inventory, changedInventory); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index e9defd0e..29aafe1f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -14,7 +14,8 @@ using Volo.Abp.Domain.Entities; namespace EasyAbp.EShop.Products.Products { - public class ProductAppService : CrudAppService, + public class ProductAppService : CrudAppService, IProductAppService { protected override string CreatePolicyName { get; set; } = ProductsPermissions.Products.Create; @@ -110,9 +111,11 @@ namespace EasyAbp.EShop.Products.Products var usedAttributeOptionIds = new HashSet(); - foreach (var serializedAttributeOptionIds in product.ProductSkus.Select(sku => sku.SerializedAttributeOptionIds)) + foreach (var serializedAttributeOptionIds in product.ProductSkus.Select(sku => + sku.SerializedAttributeOptionIds)) { - foreach (var attributeOptionId in await _attributeOptionIdsSerializer.DeserializeAsync(serializedAttributeOptionIds)) + foreach (var attributeOptionId in await _attributeOptionIdsSerializer.DeserializeAsync( + serializedAttributeOptionIds)) { usedAttributeOptionIds.Add(attributeOptionId); } @@ -120,7 +123,8 @@ namespace EasyAbp.EShop.Products.Products foreach (var attributeDto in input.ProductAttributes) { - var attribute = product.ProductAttributes.FirstOrDefault(a => a.DisplayName == attributeDto.DisplayName); + var attribute = + product.ProductAttributes.FirstOrDefault(a => a.DisplayName == attributeDto.DisplayName); if (attribute == null) { @@ -137,7 +141,8 @@ namespace EasyAbp.EShop.Products.Products foreach (var optionDto in attributeDto.ProductAttributeOptions) { - var option = attribute.ProductAttributeOptions.FirstOrDefault(o => o.DisplayName == optionDto.DisplayName); + var option = + attribute.ProductAttributeOptions.FirstOrDefault(o => o.DisplayName == optionDto.DisplayName); if (option == null) { @@ -203,7 +208,7 @@ namespace EasyAbp.EShop.Products.Products await LoadDtoInventoryDataAsync(product, dto, storeId); await LoadDtoPriceAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] { dto }); + await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); return dto; } @@ -240,7 +245,10 @@ namespace EasyAbp.EShop.Products.Products { await CheckGetListPolicyAsync(); - var isCurrentUserStoreAdmin = await AuthorizationService.IsStoreOwnerGrantedAsync(input.StoreId, ProductsPermissions.Products.Default); + var isCurrentUserStoreAdmin = + await AuthorizationService.IsMultiStoreGrantedAsync(input.StoreId, + ProductsPermissions.Products.CrossStore, + ProductsPermissions.Products.Default); if (input.ShowHidden && !isCurrentUserStoreAdmin) { @@ -279,7 +287,8 @@ namespace EasyAbp.EShop.Products.Products return new PagedResultDto(totalCount, items); } - protected virtual async Task LoadDtoInventoryDataAsync(Product product, ProductDto productDto, Guid storeId) + protected virtual async Task LoadDtoInventoryDataAsync(Product product, ProductDto productDto, + Guid storeId) { var inventoryDataDict = await _productInventoryProvider.GetInventoryDataDictionaryAsync(product, storeId); @@ -354,7 +363,8 @@ namespace EasyAbp.EShop.Products.Products return ObjectMapper.Map(product); } - public async Task UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, UpdateProductSkuDto input) + public async Task UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, + UpdateProductSkuDto input) { await CheckUpdatePolicyAsync(); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs index 4c3023fe..4e009fba 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml.cs @@ -35,7 +35,7 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product { var storeOwners = await _storeOwnerAppService.GetListAsync(new GetStoreOwnerListDto { - OwnerId = CurrentUser.Id.Value, + OwnerUserId = CurrentUser.Id.Value, }); StoreId = storeOwners.Items.FirstOrDefault()?.StoreId; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs index fb1a51e8..8f80802a 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/EShopStoresApplicationContractsModule.cs @@ -1,10 +1,6 @@ -using EasyAbp.EShop.Stores.Permissions; -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.DependencyInjection; -using Volo.Abp.Application; -using Volo.Abp.Modularity; -using Volo.Abp.VirtualFileSystem; +using Volo.Abp.Application; using Volo.Abp.Authorization; +using Volo.Abp.Modularity; namespace EasyAbp.EShop.Stores { @@ -15,9 +11,5 @@ namespace EasyAbp.EShop.Stores )] public class EShopStoresApplicationContractsModule : AbpModule { - public override void ConfigureServices(ServiceConfigurationContext context) - { - context.Services.AddSingleton(); - } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs deleted file mode 100644 index 36f2b450..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.AspNetCore.Authorization; -using System; -using System.Threading.Tasks; - -namespace EasyAbp.EShop.Stores.Permissions -{ - public static class StoreOwnerAuthorizationExtensions - { - public static Task IsStoreOwnerGrantedAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName = null, object resource = null) - { - return authorizationService.IsGrantedAsync(resource, - new StorePermissionAuthorizationRequirement(storeId, policyName)); - } - - public static Task CheckStoreOwnerAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName = null, object resource = null) - { - return authorizationService.CheckAsync(resource, - new StorePermissionAuthorizationRequirement(storeId, policyName)); - } - } -} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs index 7272053f..6395204a 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/GetStoreOwnerListDto.cs @@ -8,6 +8,6 @@ namespace EasyAbp.EShop.Stores.StoreOwners.Dtos { public Guid? StoreId { get; set; } - public Guid? OwnerId { get; set; } + public Guid? OwnerUserId { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs index d2f0bce0..ec66d309 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs @@ -11,6 +11,6 @@ namespace EasyAbp.EShop.Stores.StoreOwners.Dtos public Guid StoreId { get; set; } [Required] - public Guid OwnerId { get; set; } + public Guid OwnerUserId { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs index 1aec6071..0dca6466 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerDuplicatedException.cs @@ -5,8 +5,8 @@ namespace EasyAbp.EShop.Stores.StoreOwners { public class StoreOwnerDuplicatedException : BusinessException { - public StoreOwnerDuplicatedException(Guid storeId, Guid ownerId) : base( - message: $"Owner {ownerId} is duplicate for the store {storeId}") + public StoreOwnerDuplicatedException(Guid storeId, Guid ownerUserId) : base( + message: $"Owner {ownerUserId} is duplicate for the store {storeId}") { } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp.EShop.Stores.Application.Shared.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp.EShop.Stores.Application.Shared.csproj new file mode 100644 index 00000000..5218cb1b --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp.EShop.Stores.Application.Shared.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + + + + + + + + + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs new file mode 100644 index 00000000..9d183e76 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs @@ -0,0 +1,22 @@ +using EasyAbp.EShop.Stores.Permissions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Application; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Stores +{ + [DependsOn( + typeof(EShopStoresDomainSharedModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] + public class EShopStoresApplicationSharedModule : AbpModule + { + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddSingleton(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs similarity index 100% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs new file mode 100644 index 00000000..b918ec75 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs @@ -0,0 +1,50 @@ +using Microsoft.AspNetCore.Authorization; +using System; +using System.Threading.Tasks; +using Volo.Abp.Authorization; + +namespace EasyAbp.EShop.Stores.Permissions +{ + public static class StoreOwnerAuthorizationExtensions + { + public static Task IsStoreOwnerGrantedAsync(this IAuthorizationService authorizationService, + Guid storeId, string policyName = null, object resource = null) + { + return authorizationService.IsGrantedAsync(resource, + new StorePermissionAuthorizationRequirement(storeId, policyName)); + } + + public static async Task IsMultiStoreGrantedAsync(this IAuthorizationService authorizationService, + Guid? storeId, string crossStorePolicyName, string policyName, object resource = null) + { + if (storeId.HasValue + && await authorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + { + return true; + } + + return await authorizationService.IsGrantedAsync(resource, crossStorePolicyName) + && await authorizationService.IsGrantedAsync(resource, policyName); + } + + public static async Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, + Guid? storeId, string crossStorePolicyName, string policyName, object resource = null) + { + if (storeId.HasValue + && await authorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + { + return; + } + + await authorizationService.CheckAsync(resource, crossStorePolicyName); + await authorizationService.CheckAsync(resource, policyName); + } + + public static Task CheckStoreOwnerAsync(this IAuthorizationService authorizationService, + Guid storeId, string policyName = null, object resource = null) + { + return authorizationService.CheckAsync(resource, + new StorePermissionAuthorizationRequirement(storeId, policyName)); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs similarity index 100% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs new file mode 100644 index 00000000..44745c2d --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -0,0 +1,125 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Permissions; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TEntityDto : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : MultiStoreAbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyCrudAppService + : AbstractKeyCrudAppService + where TEntity : class, IEntity, IMultiStore + where TCreateInput : IMultiStore + { + protected virtual string CrossStorePolicyName { get; set; } + + protected MultiStoreAbstractKeyCrudAppService(IRepository repository) + : base(repository) + { + } + + public override async Task GetAsync(TKey id) + { + var entity = await GetEntityByIdAsync(id); + + await CheckMultiStorePolicyAsync(entity.StoreId, GetPolicyName); + + return MapToGetOutputDto(entity); + } + + public override async Task CreateAsync(TCreateInput input) + { + await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); + + var entity = MapToEntity(input); + + TryToSetTenantId(entity); + + await Repository.InsertAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public override async Task UpdateAsync(TKey id, TUpdateInput input) + { + var entity = await GetEntityByIdAsync(id); + await CheckMultiStorePolicyAsync(entity.StoreId, UpdatePolicyName); + + MapToEntity(input, entity); + await Repository.UpdateAsync(entity, autoSave: true); + + return MapToGetOutputDto(entity); + } + + public override async Task DeleteAsync(TKey id) + { + var entity = await GetEntityByIdAsync(id); + await CheckMultiStorePolicyAsync(entity.StoreId, DeletePolicyName); + + await DeleteByIdAsync(id); + } + + + protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) + { + if (storeId.HasValue + && await AuthorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + { + return; + } + + await CheckPolicyAsync(CrossStorePolicyName); + await CheckPolicyAsync(policyName); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs new file mode 100644 index 00000000..ea0e2a5b --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs @@ -0,0 +1,65 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Permissions; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Entities; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.Stores +{ + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : MultiStoreAbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : MultiStoreAbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + } + + public abstract class MultiStoreAbstractKeyReadOnlyAppService + : AbstractKeyReadOnlyAppService + where TEntity : class, IEntity, IMultiStore + { + protected virtual string CrossStorePolicyName { get; set; } + + protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) + : base(repository) + { + } + + public override async Task GetAsync(TKey id) + { + var entity = await GetEntityByIdAsync(id); + + await CheckMultiStorePolicyAsync(entity.StoreId, GetPolicyName); + + return MapToGetOutputDto(entity); + } + + protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) + { + if (storeId.HasValue + && await AuthorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + { + return; + } + + await CheckPolicyAsync(CrossStorePolicyName); + await CheckPolicyAsync(policyName); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs similarity index 84% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs index bbf4f448..352579f3 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreCrudAppService.cs @@ -52,22 +52,10 @@ namespace EasyAbp.EShop.Stores.Stores : base(repository) { } - - protected override Task MapToGetListOutputDtoAsync(TEntity entity) - { - return base.MapToGetOutputDtoAsync(entity); - } - - protected override TEntityDto MapToGetListOutputDto(TEntity entity) - { - return MapToGetOutputDto(entity); - } } - - public abstract class MultiStoreCrudAppService - : MultiStoreAbstractKeyCrudAppService + + public abstract class MultiStoreCrudAppService + : MultiStoreAbstractKeyCrudAppService where TEntity : class, IEntity, IMultiStore where TGetOutputDto : IEntityDto where TGetListOutputDto : IEntityDto @@ -103,9 +91,9 @@ namespace EasyAbp.EShop.Stores.Stores protected override IQueryable ApplyDefaultSorting(IQueryable query) { - if (typeof(TEntity).IsAssignableTo()) + if (typeof(TEntity).IsAssignableTo()) { - return query.OrderByDescending(e => ((IHasCreationTime) e).CreationTime); + return query.OrderByDescending(e => ((ICreationAuditedObject)e).CreationTime); } else { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs similarity index 95% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs index 02688eb7..cb9bef3c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreReadOnlyAppService.cs @@ -36,7 +36,7 @@ namespace EasyAbp.EShop.Stores.Stores where TGetOutputDto : IEntityDto where TGetListOutputDto : IEntityDto { - protected new IReadOnlyRepository Repository { get; } + protected IReadOnlyRepository Repository { get; } protected MultiStoreReadOnlyAppService(IReadOnlyRepository repository) : base(repository) @@ -53,7 +53,7 @@ namespace EasyAbp.EShop.Stores.Stores { if (typeof(TEntity).IsAssignableTo()) { - return query.OrderByDescending(e => ((ICreationAuditedObject) e).CreationTime); + return query.OrderByDescending(e => ((ICreationAuditedObject)e).CreationTime); } else { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xsd b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj index 0daef21b..e8fe6281 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp.EShop.Stores.Application.csproj @@ -11,6 +11,7 @@ +
diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index ad2024e4..904bdc34 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -4,6 +4,7 @@ using System.Threading.Tasks; using EasyAbp.EShop.Stores.Permissions; using EasyAbp.EShop.Stores.StoreOwners.Dtos; using EasyAbp.EShop.Stores.Stores; +using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners { @@ -18,34 +19,37 @@ namespace EasyAbp.EShop.Stores.StoreOwners protected override string CrossStorePolicyName { get; set; } = StoresPermissions.Stores.CrossStore; private readonly IStoreOwnerRepository _repository; + private readonly IStoreOwnerStore _storeOwnerStore; - public StoreOwnerAppService(IStoreOwnerRepository repository) : base(repository) + public StoreOwnerAppService(IStoreOwnerRepository repository, + IStoreOwnerStore storeOwnerStore) : base(repository) { _repository = repository; + _storeOwnerStore = storeOwnerStore; } public override async Task CreateAsync(StoreOwnerDto input) { - if (await _repository.IsExistAsync(input.StoreId, input.OwnerId)) + if (await _repository.IsExistAsync(input.StoreId, input.OwnerUserId)) { - throw new StoreOwnerDuplicatedException(input.StoreId, input.OwnerId); + throw new StoreOwnerDuplicatedException(input.StoreId, input.OwnerUserId); } return await base.CreateAsync(input); } - + protected override IQueryable CreateFilteredQuery(GetStoreOwnerListDto input) { var queryable = Repository.AsQueryable(); - if (input.StoreId.HasValue) + if (input.OwnerUserId.HasValue) { - queryable = queryable.Where(x => x.StoreId == input.StoreId); + queryable = queryable.Where(x => x.OwnerUserId == input.OwnerUserId); } - if (input.OwnerId.HasValue) + if (input.StoreId.HasValue) { - queryable = queryable.Where(x => x.OwnerId == input.OwnerId); + queryable = queryable.Where(x => x.StoreId == input.StoreId); } return queryable; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs deleted file mode 100644 index cc16d491..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs +++ /dev/null @@ -1,211 +0,0 @@ -using System; -using System.Threading.Tasks; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.MultiTenancy; -using Volo.Abp.ObjectMapping; - -namespace EasyAbp.EShop.Stores.Stores -{ - public abstract class MultiStoreAbstractKeyCrudAppService - : MultiStoreAbstractKeyCrudAppService - where TEntity : class, IEntity, IMultiStore - where TEntityDto : IMultiStore - { - protected MultiStoreAbstractKeyCrudAppService(IRepository repository) - : base(repository) - { - } - } - - public abstract class MultiStoreAbstractKeyCrudAppService - : MultiStoreAbstractKeyCrudAppService - where TEntity : class, IEntity, IMultiStore - where TEntityDto : IMultiStore - { - protected MultiStoreAbstractKeyCrudAppService(IRepository repository) - : base(repository) - { - } - } - - public abstract class MultiStoreAbstractKeyCrudAppService - : MultiStoreAbstractKeyCrudAppService - where TEntity : class, IEntity, IMultiStore - where TCreateInput : IMultiStore - { - protected MultiStoreAbstractKeyCrudAppService(IRepository repository) - : base(repository) - { - } - } - - public abstract class MultiStoreAbstractKeyCrudAppService - : MultiStoreAbstractKeyCrudAppService - where TEntity : class, IEntity, IMultiStore - where TCreateInput : IMultiStore - { - protected MultiStoreAbstractKeyCrudAppService(IRepository repository) - : base(repository) - { - } - - protected override Task MapToGetListOutputDtoAsync(TEntity entity) - { - return MapToGetOutputDtoAsync(entity); - } - - protected override TEntityDto MapToGetListOutputDto(TEntity entity) - { - return MapToGetOutputDto(entity); - } - } - - public abstract class MultiStoreAbstractKeyCrudAppService - : MultiStoreAbstractKeyReadOnlyAppService, - ICrudAppService - where TEntity : class, IEntity, IMultiStore - where TCreateInput : IMultiStore - { - protected IRepository Repository { get; } - - protected virtual string CreatePolicyName { get; set; } - - protected virtual string UpdatePolicyName { get; set; } - - protected virtual string DeletePolicyName { get; set; } - - protected MultiStoreAbstractKeyCrudAppService(IRepository repository) - : base(repository) - { - Repository = repository; - } - - public virtual async Task CreateAsync(TCreateInput input) - { - await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); - - var entity = await MapToEntityAsync(input); - - TryToSetTenantId(entity); - - await Repository.InsertAsync(entity, autoSave: true); - - return await MapToGetOutputDtoAsync(entity); - } - - public virtual async Task UpdateAsync(TKey id, TUpdateInput input) - { - var entity = await GetEntityByIdAsync(id); - await CheckMultiStorePolicyAsync(entity.StoreId, UpdatePolicyName); - //TODO: Check if input has id different than given id and normalize if it's default value, throw ex otherwise - await MapToEntityAsync(input, entity); - await Repository.UpdateAsync(entity, autoSave: true); - - return await MapToGetOutputDtoAsync(entity); - } - - public virtual async Task DeleteAsync(TKey id) - { - var entity = await GetEntityByIdAsync(id); - await CheckMultiStorePolicyAsync(entity.StoreId, DeletePolicyName); - - await DeleteByIdAsync(id); - } - - protected abstract Task DeleteByIdAsync(TKey id); - - /// - /// Maps to to create a new entity. - /// It uses by default. - /// It can be overriden for custom mapping. - /// Overriding this has higher priority than overriding the - /// - protected virtual Task MapToEntityAsync(TCreateInput createInput) - { - return Task.FromResult(MapToEntity(createInput)); - } - - /// - /// Maps to to create a new entity. - /// It uses by default. - /// It can be overriden for custom mapping. - /// - protected virtual TEntity MapToEntity(TCreateInput createInput) - { - var entity = ObjectMapper.Map(createInput); - SetIdForGuids(entity); - return entity; - } - - /// - /// Sets Id value for the entity if is . - /// It's used while creating a new entity. - /// - protected virtual void SetIdForGuids(TEntity entity) - { - if (entity is IEntity entityWithGuidId && entityWithGuidId.Id == Guid.Empty) - { - EntityHelper.TrySetId( - entityWithGuidId, - () => GuidGenerator.Create(), - true - ); - } - } - - /// - /// Maps to to update the entity. - /// It uses by default. - /// It can be overriden for custom mapping. - /// Overriding this has higher priority than overriding the - /// - protected virtual Task MapToEntityAsync(TUpdateInput updateInput, TEntity entity) - { - MapToEntity(updateInput, entity); - return Task.CompletedTask; - } - - /// - /// Maps to to update the entity. - /// It uses by default. - /// It can be overriden for custom mapping. - /// - protected virtual void MapToEntity(TUpdateInput updateInput, TEntity entity) - { - ObjectMapper.Map(updateInput, entity); - } - - protected virtual void TryToSetTenantId(TEntity entity) - { - if (entity is IMultiTenant && HasTenantIdProperty(entity)) - { - var tenantId = CurrentTenant.Id; - - if (!tenantId.HasValue) - { - return; - } - - var propertyInfo = entity.GetType().GetProperty(nameof(IMultiTenant.TenantId)); - - if (propertyInfo == null || propertyInfo.GetSetMethod(true) == null) - { - return; - } - - propertyInfo.SetValue(entity, tenantId); - } - } - - protected virtual bool HasTenantIdProperty(TEntity entity) - { - return entity.GetType().GetProperty(nameof(IMultiTenant.TenantId)) != null; - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs deleted file mode 100644 index c1b1f2e1..00000000 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs +++ /dev/null @@ -1,236 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Dynamic.Core; -using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Permissions; -using Volo.Abp; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; -using Volo.Abp.Auditing; -using Volo.Abp.Domain.Entities; -using Volo.Abp.Domain.Repositories; -using Volo.Abp.ObjectMapping; - -namespace EasyAbp.EShop.Stores.Stores -{ - public abstract class MultiStoreAbstractKeyReadOnlyAppService - : MultiStoreAbstractKeyReadOnlyAppService - where TEntity : class, IEntity, IMultiStore - { - protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) - : base(repository) - { - - } - } - - public abstract class MultiStoreAbstractKeyReadOnlyAppService - : MultiStoreAbstractKeyReadOnlyAppService - where TEntity : class, IEntity, IMultiStore - { - protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) - : base(repository) - { - } - } - - public abstract class MultiStoreAbstractKeyReadOnlyAppService - : ApplicationService - , IReadOnlyAppService - where TEntity : class, IEntity, IMultiStore - { - protected IReadOnlyRepository ReadOnlyRepository { get; } - - protected virtual string GetPolicyName { get; set; } - - protected virtual string GetListPolicyName { get; set; } - - protected virtual string CrossStorePolicyName { get; set; } - - protected MultiStoreAbstractKeyReadOnlyAppService(IReadOnlyRepository repository) - { - ReadOnlyRepository = repository; - } - - public virtual async Task GetAsync(TKey id) - { - var entity = await GetEntityByIdAsync(id); - - await CheckMultiStorePolicyAsync(entity.StoreId, GetPolicyName); - - return await MapToGetOutputDtoAsync(entity); - } - - public virtual async Task> GetListAsync(TGetListInput input) - { - await CheckGetListPolicyAsync(); - - var query = CreateFilteredQuery(input); - - var totalCount = await AsyncExecuter.CountAsync(query); - - query = ApplySorting(query, input); - query = ApplyPaging(query, input); - - var entities = await AsyncExecuter.ToListAsync(query); - var entityDtos = await MapToGetListOutputDtosAsync(entities); - - return new PagedResultDto( - totalCount, - entityDtos - ); - } - - protected virtual async Task CheckGetListPolicyAsync() - { - await CheckPolicyAsync(GetListPolicyName); - } - - protected abstract Task GetEntityByIdAsync(TKey id); - - protected virtual async Task CheckMultiStorePolicyAsync(Guid storeId, string policyName) - { - if (!await AuthorizationService.IsStoreOwnerGrantedAsync(storeId, policyName)) - { - await CheckPolicyAsync(CrossStorePolicyName); - await CheckPolicyAsync(policyName); - } - } - - /// - /// Should apply sorting if needed. - /// - /// The query. - /// The input. - protected virtual IQueryable ApplySorting(IQueryable query, TGetListInput input) - { - //Try to sort query if available - if (input is ISortedResultRequest sortInput) - { - if (!sortInput.Sorting.IsNullOrWhiteSpace()) - { - return query.OrderBy(sortInput.Sorting); - } - } - - //IQueryable.Task requires sorting, so we should sort if Take will be used. - if (input is ILimitedResultRequest) - { - return ApplyDefaultSorting(query); - } - - //No sorting - return query; - } - - /// - /// Applies sorting if no sorting specified but a limited result requested. - /// - /// The query. - protected virtual IQueryable ApplyDefaultSorting(IQueryable query) - { - if (typeof(TEntity).IsAssignableTo()) - { - return query.OrderByDescending(e => ((IHasCreationTime) e).CreationTime); - } - - throw new AbpException( - "No sorting specified but this query requires sorting. Override the ApplyDefaultSorting method for your application service derived from AbstractKeyReadOnlyAppService!"); - } - - /// - /// Should apply paging if needed. - /// - /// The query. - /// The input. - protected virtual IQueryable ApplyPaging(IQueryable query, TGetListInput input) - { - //Try to use paging if available - if (input is IPagedResultRequest pagedInput) - { - return query.PageBy(pagedInput); - } - - //Try to limit query result if available - if (input is ILimitedResultRequest limitedInput) - { - return query.Take(limitedInput.MaxResultCount); - } - - //No paging - return query; - } - - /// - /// This method should create based on given input. - /// It should filter query if needed, but should not do sorting or paging. - /// Sorting should be done in and paging should be done in - /// methods. - /// - /// The input. - protected virtual IQueryable CreateFilteredQuery(TGetListInput input) - { - return ReadOnlyRepository; - } - - /// - /// Maps to . - /// It internally calls the by default. - /// It can be overriden for custom mapping. - /// Overriding this has higher priority than overriding the - /// - protected virtual Task MapToGetOutputDtoAsync(TEntity entity) - { - return Task.FromResult(MapToGetOutputDto(entity)); - } - - /// - /// Maps to . - /// It uses by default. - /// It can be overriden for custom mapping. - /// - protected virtual TGetOutputDto MapToGetOutputDto(TEntity entity) - { - return ObjectMapper.Map(entity); - } - - /// - /// Maps a list of to objects. - /// It uses method for each item in the list. - /// - protected virtual async Task> MapToGetListOutputDtosAsync(List entities) - { - var dtos = new List(); - - foreach (var entity in entities) - { - dtos.Add(await MapToGetListOutputDtoAsync(entity)); - } - - return dtos; - } - - /// - /// Maps to . - /// It internally calls the by default. - /// It can be overriden for custom mapping. - /// Overriding this has higher priority than overriding the - /// - protected virtual Task MapToGetListOutputDtoAsync(TEntity entity) - { - return Task.FromResult(MapToGetListOutputDto(entity)); - } - - /// - /// Maps to . - /// It uses by default. - /// It can be overriden for custom mapping. - /// - protected virtual TGetListOutputDto MapToGetListOutputDto(TEntity entity) - { - return ObjectMapper.Map(entity); - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs index 61dd6e4b..bf03fb61 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerRepository.cs @@ -10,8 +10,8 @@ namespace EasyAbp.EShop.Stores.StoreOwners { Task> GetListByStoreIdAsync(Guid storeId, CancellationToken cancellationToken = default); - Task> GetListByOwnerIdAsync(Guid ownerId, CancellationToken cancellationToken = default); + Task> GetListByOwnerUserIdAsync(Guid ownerUserId, CancellationToken cancellationToken = default); - Task IsExistAsync(Guid storeId, Guid ownerId, CancellationToken cancellationToken = default); + Task IsExistAsync(Guid storeId, Guid ownerUserId, CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs index c8e89ac1..4506a855 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwner.cs @@ -11,16 +11,16 @@ namespace EasyAbp.EShop.Stores.StoreOwners public virtual Guid StoreId { get; protected set; } - public virtual Guid OwnerId { get; protected set; } + public virtual Guid OwnerUserId { get; protected set; } protected StoreOwner() { } - public StoreOwner(Guid id, Guid storeId, Guid ownerId, Guid? tenantId = null) : base(id) + public StoreOwner(Guid id, Guid storeId, Guid ownerUserId, Guid? tenantId = null) : base(id) { StoreId = storeId; - OwnerId = ownerId; + OwnerUserId = ownerUserId; TenantId = tenantId; } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs index bed38fcb..a0145604 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerStore.cs @@ -60,10 +60,10 @@ namespace EasyAbp.EShop.Stores.StoreOwners var cacheItems = new Dictionary(); foreach (var storeOwner in storeOwners) { - cacheItems.Add(CalculateCacheKey(storeOwner.StoreId, storeOwner.OwnerId), + cacheItems.Add(CalculateCacheKey(storeOwner.StoreId, storeOwner.OwnerUserId), new StoreOwnerCacheItem(true)); - if (storeOwner.StoreId == storeId && storeOwner.OwnerId == userId) + if (storeOwner.OwnerUserId == userId && storeOwner.StoreId == storeId) { currentCacheItem.IsOwner = true; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs index 20e50c5d..021ebec3 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs @@ -45,7 +45,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore builder.Entity(b => { b.ToTable(options.TablePrefix + "Stores", options.Schema); - b.ConfigureByConvention(); + b.ConfigureByConvention(); /* Configure more properties here */ }); @@ -55,9 +55,9 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore b.ConfigureByConvention(); /* Configure more properties here */ - b.HasIndex(x => new {x.StoreId, x.OwnerId}) + b.HasIndex(x => new {x.OwnerUserId, x.StoreId}) .IsUnique(); }); } } -} +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs index 22c096f8..40b60de5 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerRepository.cs @@ -22,16 +22,16 @@ namespace EasyAbp.EShop.Stores.StoreOwners return await GetQueryable().Where(pc => pc.StoreId == storeId).ToListAsync(cancellationToken); } - public async Task> GetListByOwnerIdAsync(Guid ownerId, + public async Task> GetListByOwnerUserIdAsync(Guid ownerUserId, CancellationToken cancellationToken = default) { - return await GetQueryable().Where(pc => pc.OwnerId == ownerId).ToListAsync(cancellationToken); + return await GetQueryable().Where(pc => pc.OwnerUserId == ownerUserId).ToListAsync(cancellationToken); } - public async Task IsExistAsync(Guid storeId, Guid ownerId, CancellationToken cancellationToken = default) + public async Task IsExistAsync(Guid storeId, Guid ownerUserId, CancellationToken cancellationToken = default) { var storeOwner = await GetQueryable().FirstOrDefaultAsync( - x => x.StoreId == storeId && x.OwnerId == ownerId, + x => x.OwnerUserId == ownerUserId && x.StoreId == storeId, cancellationToken: cancellationToken); return storeOwner != null; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj index 01386386..b530c1fb 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/EasyAbp.EShop.Stores.Web.csproj @@ -24,7 +24,7 @@ - + @@ -32,44 +32,10 @@ - - true - PreserveNewest - - - true - PreserveNewest - - - true - PreserveNewest - - - - - CreateModal.cshtml - - - EditModal.cshtml - - - Index.cshtml - - - CreateModal.cshtml - - - EditModal.cshtml - - - Index.cshtml - - - diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js index b4930ca6..92ab847f 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/Index.js @@ -58,7 +58,7 @@ $(function () { } }, { - data: "ownerId", + data: "ownerUserId", render: function (data, type, row, meta) { var currentCell = $("#StoreOwnerTable").DataTable().cells({"row":meta.row, "column":meta.col}).nodes(0); userService.get(data).then( diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs index 70a202a0..7de5a3b2 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs @@ -12,6 +12,6 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.Vie [Required] - public Guid OwnerId { get; set; } + public Guid MultiStoreCrudAppService { get; set; } } } \ No newline at end of file From 22e42493d9919942e17dfcf5e2e0d3cdc10e8607 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Wed, 26 Aug 2020 17:33:26 +0800 Subject: [PATCH 08/24] fix code format --- .../EasyAbp.EShop.Payments.Application.Contracts.csproj | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj index 7b931ae8..abf99390 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp.EShop.Payments.Application.Contracts.csproj @@ -9,7 +9,8 @@ - + + From 968eee88743bb644cd1362c09a1305df0eff24d0 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Wed, 26 Aug 2020 22:26:43 +0800 Subject: [PATCH 09/24] add missing semicolon --- .../EasyAbp/EShop/Payments/Refunds/RefundAppService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs index 708cee95..88017628 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Refunds/RefundAppService.cs @@ -8,7 +8,7 @@ using EasyAbp.PaymentService.Refunds; using Microsoft.AspNetCore.Authorization; using System; using System.Linq; -using System.Collections.Generic +using System.Collections.Generic; using System.Threading.Tasks; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; From 515d95d5189e2b9c0c941c7320acab95355cf1e8 Mon Sep 17 00:00:00 2001 From: Huei Feng <695979933@qq.com> Date: Sat, 29 Aug 2020 20:51:14 +0800 Subject: [PATCH 10/24] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 88 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 00000000..7a5221d2 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,88 @@ +# ASP.NET Core (.NET Framework) +# Build and test ASP.NET Core projects targeting the full .NET Framework. +# Add steps that publish symbols, save build artifacts, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core + +schedules: +- cron: "0 */6 * * *" + displayName: Daily midnight build + branches: + include: + - master + always: true + +trigger: +- master + +pool: + vmImage: 'ubuntu-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + +steps: +- task: UseDotNet@2 + inputs: + packageType: 'sdk' + version: '3.x' +- task: CmdLine@2 + displayName: 'install dotnet-ef' + inputs: + script: 'dotnet tool install -g dotnet-ef' + +- task: CmdLine@2 + inputs: + script: | + echo commands + sed -i '0,/Default[^,]*/s//$(ConnectionStrings)"/g' samples/EShopSample/aspnet-core/src/EShopSample.Web/appsettings.json + echo commands executed +- task: CmdLine@2 + inputs: + script: | + echo commands + sed -i '0,/Default[^,]*/s//$(ConnectionStrings)"/g' samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json + echo commands executed +- task: DotNetCoreCLI@2 + displayName: 'restore' + inputs: + command: 'restore' + feedsToUse: 'select' + +- task: DotNetCoreCLI@2 + displayName: 'build' + inputs: + command: 'build' + +- task: CmdLine@2 + displayName: 'publish' + inputs: + script: | + dotnet publish +- task: CmdLine@2 + displayName: 'drop database' + inputs: + script: | + dotnet ef database drop --project samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EShopSample.EntityFrameworkCore.DbMigrations.csproj -s samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj -f + +- task: CmdLine@2 + displayName: 'update database' + inputs: + script: | + dotnet ef database update --project samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/EShopSample.EntityFrameworkCore.DbMigrations.csproj -s samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj +- task: CmdLine@2 + inputs: + script: | + cd sample/MyAbpApp/src/MyAbpApp.DbMigrator + + dotnet run +- task: Docker@2 + displayName: 'build and push docker' + inputs: + containerRegistry: $(DockerRegistry) + repository: $(repository) + command: 'buildAndPush' + Dockerfile: 'samples/EShopSample/aspnet-core/src/EShopSample.Web/Dockerfile' + buildContext: . + tags: 'latest' From 46eba9492cca97488fe4a5d1c52d9f6a49ef3968 Mon Sep 17 00:00:00 2001 From: Huei Feng <695979933@qq.com> Date: Sat, 29 Aug 2020 22:03:51 +0800 Subject: [PATCH 11/24] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7a5221d2..9ec8ebba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -74,7 +74,7 @@ steps: - task: CmdLine@2 inputs: script: | - cd sample/MyAbpApp/src/MyAbpApp.DbMigrator + cd samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator dotnet run - task: Docker@2 From f3284d55f4db079f6e468ca32ed0797f63ef7121 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Sat, 29 Aug 2020 23:02:29 +0800 Subject: [PATCH 12/24] Orders module should not depends on PaymentService module Close #88 Fix entity synchronizer Rename OrderPayment to EShopPayment Add EShopPaymentEto and EShopPaymentItemEto --- .../EasyAbp.EShop.Orders.Domain.csproj | 1 - .../EShop/Orders/EShopOrdersDomainModule.cs | 4 + .../Orders/Orders/IOrderPaymentChecker.cs | 6 +- .../IOrderPaymentCompletedEventHandler.cs | 5 +- .../IOrderPaymentCreatedEventHandler.cs | 4 +- .../Orders/Orders/OrderPaymentChecker.cs | 12 +- .../OrderPaymentCompletedEventHandler.cs | 26 ++-- .../Orders/OrderPaymentCreatedEventHandler.cs | 18 +-- .../Orders/OrderPaymentInvalidException.cs | 4 +- .../OrderPaymentAlreadyExistsException.cs | 4 +- .../Payments/BasicPayableCheckProvider.cs | 2 +- .../Payments/OrderPaymentCompletedEto.cs | 10 ++ .../Payments/Payments/OrderPaymentEto.cs | 48 +++++++ .../Payments/Payments/OrderPaymentItemEto.cs | 35 +++++ .../Payments/EShopPaymentsDomainModule.cs | 16 ++- .../Payments/Payments/PaymentSynchronizer.cs | 124 ++++++++++++---- .../PaymentsDomainAutoMapperProfile.cs | 3 + .../Payments/Refunds/RefundSynchronizer.cs | 133 +++++++++++------- .../Payments/Refunds/RefundRepository.cs | 6 + .../Products/OrderCreatedEventHandler.cs | 7 +- .../Products/OrderPaidEventHandler.cs | 7 +- 21 files changed, 338 insertions(+), 137 deletions(-) create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj index 2ab7572f..2822adf2 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp.EShop.Orders.Domain.csproj @@ -8,7 +8,6 @@ - diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs index e1ef593c..97caaf32 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/EShopOrdersDomainModule.cs @@ -1,4 +1,6 @@ using EasyAbp.EShop.Orders.Orders; +using EasyAbp.EShop.Payments; +using EasyAbp.EShop.Products; using EasyAbp.EShop.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; @@ -10,6 +12,8 @@ namespace EasyAbp.EShop.Orders { [DependsOn( typeof(AbpAutoMapperModule), + typeof(EShopPaymentsDomainSharedModule), + typeof(EShopProductsDomainSharedModule), typeof(EShopOrdersDomainSharedModule) )] public class EShopOrdersDomainModule : AbpModule diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs index 6a8ed084..26bfed31 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs @@ -1,10 +1,10 @@ using System.Threading.Tasks; -using EasyAbp.PaymentService.Payments; +using EasyAbp.EShop.Payments.Payments; namespace EasyAbp.EShop.Orders.Orders { - public interface IOrderPaymentChecker + public interface IEShopPaymentChecker { - Task IsValidPaymentAsync(Order order, PaymentEto payment, PaymentItemEto paymentItem); + Task IsValidPaymentAsync(Order order, EShopPaymentEto payment, EShopPaymentItemEto paymentItem); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs index 7d51d667..5d9abb8d 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs @@ -1,10 +1,9 @@ -using EasyAbp.PaymentService.Payments; -using Volo.Abp.Domain.Entities.Events.Distributed; +using EasyAbp.EShop.Payments.Payments; using Volo.Abp.EventBus.Distributed; namespace EasyAbp.EShop.Orders.Orders { - public interface IOrderPaymentCompletedEventHandler : IDistributedEventHandler + public interface IEShopPaymentCompletedEventHandler : IDistributedEventHandler { } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs index c15f8b9f..4edcc08e 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs @@ -1,10 +1,10 @@ -using EasyAbp.PaymentService.Payments; +using EasyAbp.EShop.Payments.Payments; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus.Distributed; namespace EasyAbp.EShop.Orders.Orders { - public interface IOrderPaymentCreatedEventHandler : IDistributedEventHandler> + public interface IEShopPaymentCreatedEventHandler : IDistributedEventHandler> { } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs index 830f4021..ce4dd864 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs @@ -1,33 +1,33 @@ using System; using System.Threading.Tasks; -using EasyAbp.PaymentService.Payments; +using EasyAbp.EShop.Payments.Payments; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; namespace EasyAbp.EShop.Orders.Orders { - public class OrderPaymentChecker : IOrderPaymentChecker, ITransientDependency + public class EShopPaymentChecker : IEShopPaymentChecker, ITransientDependency { - public virtual async Task IsValidPaymentAsync(Order order, PaymentEto payment, PaymentItemEto paymentItem) + public virtual async Task IsValidPaymentAsync(Order order, EShopPaymentEto payment, EShopPaymentItemEto paymentItem) { return await IsStoreIdCorrectAsync(order, paymentItem) && await IsPaymentPriceCorrectAsync(order, paymentItem) && await IsUserAllowedToPayAsync(order, payment); } - protected virtual Task IsStoreIdCorrectAsync(Order order, PaymentItemEto paymentItem) + protected virtual Task IsStoreIdCorrectAsync(Order order, EShopPaymentItemEto paymentItem) { return Task.FromResult( Guid.TryParse(paymentItem.GetProperty("StoreId"), out var paymentStoreId) && order.StoreId == paymentStoreId); } - protected virtual Task IsPaymentPriceCorrectAsync(Order order, PaymentItemEto paymentItem) + protected virtual Task IsPaymentPriceCorrectAsync(Order order, EShopPaymentItemEto paymentItem) { return Task.FromResult(order.TotalPrice == paymentItem.OriginalPaymentAmount); } - protected virtual Task IsUserAllowedToPayAsync(Order order, PaymentEto payment) + protected virtual Task IsUserAllowedToPayAsync(Order order, EShopPaymentEto payment) { return Task.FromResult(order.CustomerUserId == payment.UserId); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs index dbc59fff..89dac229 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs @@ -2,9 +2,8 @@ using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Payments; -using EasyAbp.PaymentService.Payments; +using EasyAbp.EShop.Payments.Payments; using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; using Volo.Abp.ObjectMapping; @@ -13,22 +12,22 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class OrderPaymentCompletedEventHandler : IOrderPaymentCompletedEventHandler, ITransientDependency + public class EShopPaymentCompletedEventHandler : IEShopPaymentCompletedEventHandler, ITransientDependency { private readonly IClock _clock; private readonly ICurrentTenant _currentTenant; private readonly IObjectMapper _objectMapper; private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly IOrderPaymentChecker _orderPaymentChecker; + private readonly IEShopPaymentChecker _eShopPaymentChecker; private readonly IDistributedEventBus _distributedEventBus; private readonly IOrderRepository _orderRepository; - public OrderPaymentCompletedEventHandler( + public EShopPaymentCompletedEventHandler( IClock clock, ICurrentTenant currentTenant, IObjectMapper objectMapper, IUnitOfWorkManager unitOfWorkManager, - IOrderPaymentChecker orderPaymentChecker, + IEShopPaymentChecker eShopPaymentChecker, IDistributedEventBus distributedEventBus, IOrderRepository orderRepository) { @@ -36,12 +35,13 @@ namespace EasyAbp.EShop.Orders.Orders _currentTenant = currentTenant; _objectMapper = objectMapper; _unitOfWorkManager = unitOfWorkManager; - _orderPaymentChecker = orderPaymentChecker; + _eShopPaymentChecker = eShopPaymentChecker; _distributedEventBus = distributedEventBus; _orderRepository = orderRepository; } - public virtual async Task HandleEventAsync(PaymentCompletedEto eventData) + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(EShopPaymentCompletedEto eventData) { var payment = eventData.Payment; @@ -52,8 +52,6 @@ namespace EasyAbp.EShop.Orders.Orders using var currentTenant = _currentTenant.Change(payment.TenantId); - using var uow = _unitOfWorkManager.Begin(isTransactional: true); - foreach (var item in payment.PaymentItems.Where(item => item.ItemType == PaymentsConsts.PaymentItemType)) { var orderId = Guid.Parse(item.ItemKey); @@ -66,9 +64,9 @@ namespace EasyAbp.EShop.Orders.Orders throw new OrderIsInWrongStageException(order.Id); } - if (!await _orderPaymentChecker.IsValidPaymentAsync(order, payment, item)) + if (!await _eShopPaymentChecker.IsValidPaymentAsync(order, payment, item)) { - throw new OrderPaymentInvalidException(payment.Id, orderId); + throw new EShopPaymentInvalidException(payment.Id, orderId); } order.SetPaidTime(_clock.Now); @@ -76,7 +74,7 @@ namespace EasyAbp.EShop.Orders.Orders await _orderRepository.UpdateAsync(order, true); - uow.OnCompleted(async () => await _distributedEventBus.PublishAsync(new OrderPaidEto + _unitOfWorkManager.Current.OnCompleted(async () => await _distributedEventBus.PublishAsync(new OrderPaidEto { Order = _objectMapper.Map(order), PaymentId = payment.Id, @@ -84,7 +82,7 @@ namespace EasyAbp.EShop.Orders.Orders })); } - await uow.CompleteAsync(); + await _unitOfWorkManager.Current.CompleteAsync(); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs index e621536c..4e2b641c 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Payments; -using EasyAbp.PaymentService.Payments; +using EasyAbp.EShop.Payments.Payments; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.MultiTenancy; @@ -10,24 +10,24 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class OrderPaymentCreatedEventHandler : IOrderPaymentCreatedEventHandler, ITransientDependency + public class EShopPaymentCreatedEventHandler : IEShopPaymentCreatedEventHandler, ITransientDependency { private readonly ICurrentTenant _currentTenant; - private readonly IOrderPaymentChecker _orderPaymentChecker; + private readonly IEShopPaymentChecker _eShopPaymentChecker; private readonly IOrderRepository _orderRepository; - public OrderPaymentCreatedEventHandler( + public EShopPaymentCreatedEventHandler( ICurrentTenant currentTenant, - IOrderPaymentChecker orderPaymentChecker, + IEShopPaymentChecker eShopPaymentChecker, IOrderRepository orderRepository) { _currentTenant = currentTenant; - _orderPaymentChecker = orderPaymentChecker; + _eShopPaymentChecker = eShopPaymentChecker; _orderRepository = orderRepository; } [UnitOfWork(true)] - public virtual async Task HandleEventAsync(EntityCreatedEto eventData) + public virtual async Task HandleEventAsync(EntityCreatedEto eventData) { using var currentTenant = _currentTenant.Change(eventData.Entity.TenantId); @@ -43,10 +43,10 @@ namespace EasyAbp.EShop.Orders.Orders throw new OrderIsInWrongStageException(order.Id); } - if (!await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity, item)) + if (!await _eShopPaymentChecker.IsValidPaymentAsync(order, eventData.Entity, item)) { // Todo: should cancel the payment? - throw new OrderPaymentInvalidException(eventData.Entity.Id, orderId); + throw new EShopPaymentInvalidException(eventData.Entity.Id, orderId); } order.SetPaymentId(eventData.Entity.Id); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs index 9f82003a..20e80840 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs @@ -3,9 +3,9 @@ using Volo.Abp; namespace EasyAbp.EShop.Orders.Orders { - public class OrderPaymentInvalidException : BusinessException + public class EShopPaymentInvalidException : BusinessException { - public OrderPaymentInvalidException(Guid paymentId, Guid orderId) + public EShopPaymentInvalidException(Guid paymentId, Guid orderId) : base(message: $"The payment {paymentId} has invalid configurations for the order {orderId}.") { } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs index 913c6735..f755deb6 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs @@ -3,9 +3,9 @@ using Volo.Abp; namespace EasyAbp.EShop.Payments.Payments { - public class OrderPaymentAlreadyExistsException : BusinessException + public class EShopPaymentAlreadyExistsException : BusinessException { - public OrderPaymentAlreadyExistsException(Guid orderId) + public EShopPaymentAlreadyExistsException(Guid orderId) : base(message: $"The order {orderId}'s payment is already exists.") { } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs index 8d3cf040..cdf82bd9 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs @@ -14,7 +14,7 @@ namespace EasyAbp.EShop.Payments.Payments { foreach (var order in orders.Where(order => order.PaymentId.HasValue || order.PaidTime.HasValue)) { - throw new OrderPaymentAlreadyExistsException(order.Id); + throw new EShopPaymentAlreadyExistsException(order.Id); } if (orders.Select(order => order.Currency).Distinct().Count() != 1) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs new file mode 100644 index 00000000..0f09a2af --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs @@ -0,0 +1,10 @@ +using System; + +namespace EasyAbp.EShop.Payments.Payments +{ + [Serializable] + public class EShopPaymentCompletedEto + { + public EShopPaymentEto Payment { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs new file mode 100644 index 00000000..504f4499 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using EasyAbp.PaymentService.Payments; +using Volo.Abp.Data; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Payments.Payments +{ + [Serializable] + public class EShopPaymentEto : IPayment, IMultiTenant, IHasExtraProperties + { + #region Base properties + + public Guid Id { get; set; } + + public Guid? TenantId { get; set; } + + public Guid UserId { get; set; } + + public string PaymentMethod { get; set; } + + public string PayeeAccount { get; set; } + + public string ExternalTradingCode { get; set; } + + public string Currency { get; set; } + + public decimal OriginalPaymentAmount { get; set; } + + public decimal PaymentDiscount { get; set; } + + public decimal ActualPaymentAmount { get; set; } + + public decimal RefundAmount { get; set; } + + public decimal PendingRefundAmount { get; set; } + + public DateTime? CompletionTime { get; set; } + + public DateTime? CanceledTime { get; set; } + + public Dictionary ExtraProperties { get; set; } + + #endregion + + public List PaymentItems { get; set; } = new List(); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs new file mode 100644 index 00000000..bb72dd13 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using EasyAbp.PaymentService.Payments; +using Volo.Abp.Data; + +namespace EasyAbp.EShop.Payments.Payments +{ + [Serializable] + public class EShopPaymentItemEto : IPaymentItem, IHasExtraProperties + { + #region Base properties + + public Guid Id { get; set; } + + public string ItemType { get; set; } + + public string ItemKey { get; set; } + + public decimal OriginalPaymentAmount { get; set; } + + public decimal PaymentDiscount { get; set; } + + public decimal ActualPaymentAmount { get; set; } + + public decimal RefundAmount { get; set; } + + public decimal PendingRefundAmount { get; set; } + + public Dictionary ExtraProperties { get; set; } + + #endregion + + public Guid StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs index 89c61456..d7dcd14b 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs @@ -1,8 +1,6 @@ using EasyAbp.EShop.Payments.Payments; using EasyAbp.EShop.Payments.Refunds; using EasyAbp.EShop.Stores; -using EasyAbp.PaymentService.Payments; -using EasyAbp.PaymentService.Refunds; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.AutoMapper; using Volo.Abp.Domain.Entities.Events.Distributed; @@ -14,9 +12,21 @@ namespace EasyAbp.EShop.Payments typeof(AbpAutoMapperModule), typeof(EShopPaymentsDomainSharedModule), typeof(EShopStoresDomainSharedModule) - )] + )] public class EShopPaymentsDomainModule : AbpModule { + public override void PreConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.EtoMappings.Add(typeof(EShopPaymentsDomainModule)); + options.EtoMappings.Add(typeof(EShopPaymentsDomainModule)); + + options.AutoEventSelectors.Add(); + options.AutoEventSelectors.Add(); + }); + } + public override void ConfigureServices(ServiceConfigurationContext context) { context.Services.AddAutoMapperObjectMapper(); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs index 75d06cc9..7f6662e4 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs @@ -14,6 +14,7 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Payments.Payments { public class PaymentSynchronizer : + IDistributedEventHandler>, IDistributedEventHandler>, IDistributedEventHandler>, IPaymentSynchronizer, @@ -21,71 +22,132 @@ namespace EasyAbp.EShop.Payments.Payments { private readonly IObjectMapper _objectMapper; private readonly ICurrentTenant _currentTenant; + private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IPaymentRepository _paymentRepository; + private readonly IDistributedEventBus _distributedEventBus; public PaymentSynchronizer( IObjectMapper objectMapper, ICurrentTenant currentTenant, - IPaymentRepository paymentRepository) + IUnitOfWorkManager unitOfWorkManager, + IPaymentRepository paymentRepository, + IDistributedEventBus distributedEventBus) { _objectMapper = objectMapper; _currentTenant = currentTenant; + _unitOfWorkManager = unitOfWorkManager; _paymentRepository = paymentRepository; + _distributedEventBus = distributedEventBus; } [UnitOfWork(true)] - public virtual async Task HandleEventAsync(EntityUpdatedEto eventData) + public virtual async Task HandleEventAsync(EntityCreatedEto eventData) { + if (eventData.Entity.PaymentItems.All(item => item.ItemType != PaymentsConsts.PaymentItemType)) + { + return; + } + using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); var payment = await _paymentRepository.FindAsync(eventData.Entity.Id); - if (payment == null) + if (payment != null) { - payment = _objectMapper.Map(eventData.Entity); + return; + } + + payment = _objectMapper.Map(eventData.Entity); - payment.SetPaymentItems( - _objectMapper.Map, List>(eventData.Entity.PaymentItems)); + payment.SetPaymentItems( + _objectMapper.Map, List>(eventData.Entity.PaymentItems)); + + payment.PaymentItems.ForEach(FillPaymentItemStoreId); - await _paymentRepository.InsertAsync(payment, true); + await _paymentRepository.InsertAsync(payment, true); + + if (payment.CompletionTime.HasValue) + { + _unitOfWorkManager.Current.OnCompleted(async () => + { + await _distributedEventBus.PublishAsync(new EShopPaymentCompletedEto + { + Payment = _objectMapper.Map(payment) + }); + }); } - else + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(EntityUpdatedEto eventData) + { + if (eventData.Entity.PaymentItems.All(item => item.ItemType != PaymentsConsts.PaymentItemType)) { - _objectMapper.Map(eventData.Entity, payment); + return; + } + + using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); - foreach (var etoItem in eventData.Entity.PaymentItems) + var payment = await _paymentRepository.FindAsync(eventData.Entity.Id); + + if (payment == null) + { + return; + } + + if (eventData.Entity.CompletionTime.HasValue && !payment.CompletionTime.HasValue) + { + _unitOfWorkManager.Current.OnCompleted(async () => { - var item = payment.PaymentItems.FirstOrDefault(i => i.Id == etoItem.Id); - - if (item == null) + await _distributedEventBus.PublishAsync(new EShopPaymentCompletedEto { - if (!Guid.TryParse(etoItem.GetProperty("StoreId"), out var storeId)) - { - throw new StoreIdNotFoundException(); - } - - item = _objectMapper.Map(etoItem); - - item.SetStoreId(storeId); - - payment.PaymentItems.Add(item); - } - else - { - _objectMapper.Map(etoItem, item); - } - } + Payment = _objectMapper.Map(payment) + }); + }); + } - var etoPaymentItemIds = eventData.Entity.PaymentItems.Select(i => i.Id).ToList(); + _objectMapper.Map(eventData.Entity, payment); - payment.PaymentItems.RemoveAll(i => !etoPaymentItemIds.Contains(i.Id)); + foreach (var etoItem in eventData.Entity.PaymentItems) + { + var item = payment.PaymentItems.FirstOrDefault(i => i.Id == etoItem.Id); + + if (item == null) + { + item = _objectMapper.Map(etoItem); + + FillPaymentItemStoreId(item); + + payment.PaymentItems.Add(item); + } + else + { + _objectMapper.Map(etoItem, item); + } } + + var etoPaymentItemIds = eventData.Entity.PaymentItems.Select(i => i.Id).ToList(); + + payment.PaymentItems.RemoveAll(i => !etoPaymentItemIds.Contains(i.Id)); await _paymentRepository.UpdateAsync(payment, true); } + protected virtual void FillPaymentItemStoreId(PaymentItem item) + { + if (!Guid.TryParse(item.GetProperty("StoreId"), out var storeId)) + { + throw new StoreIdNotFoundException(); + } + + item.SetStoreId(storeId); + } + + [UnitOfWork(true)] public virtual async Task HandleEventAsync(EntityDeletedEto eventData) { + using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); + var payment = await _paymentRepository.FindAsync(eventData.Entity.Id); if (payment == null) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs index c6d2b514..2974ef07 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs @@ -25,6 +25,9 @@ namespace EasyAbp.EShop.Payments CreateMap(MemberList.Source) .Ignore(x => x.StoreId) .Ignore(x => x.OrderId); + + CreateMap(); + CreateMap(); CreateMap(); CreateMap(); CreateMap(); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs index 398dc9cb..702f42d8 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EasyAbp.EShop.Payments.Payments; using EasyAbp.PaymentService.Refunds; using Volo.Abp.Data; using Volo.Abp.DependencyInjection; @@ -16,6 +17,7 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Payments.Refunds { public class RefundSynchronizer : + IDistributedEventHandler>, IDistributedEventHandler>, IDistributedEventHandler>, IRefundSynchronizer, @@ -27,6 +29,7 @@ namespace EasyAbp.EShop.Payments.Refunds private readonly IJsonSerializer _jsonSerializer; private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IDistributedEventBus _distributedEventBus; + private readonly IPaymentRepository _paymentRepository; private readonly IRefundRepository _refundRepository; public RefundSynchronizer( @@ -36,6 +39,7 @@ namespace EasyAbp.EShop.Payments.Refunds IJsonSerializer jsonSerializer, IUnitOfWorkManager unitOfWorkManager, IDistributedEventBus distributedEventBus, + IPaymentRepository paymentRepository, IRefundRepository refundRepository) { _objectMapper = objectMapper; @@ -44,71 +48,103 @@ namespace EasyAbp.EShop.Payments.Refunds _jsonSerializer = jsonSerializer; _unitOfWorkManager = unitOfWorkManager; _distributedEventBus = distributedEventBus; + _paymentRepository = paymentRepository; _refundRepository = refundRepository; } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(EntityCreatedEto eventData) + { + using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); + + var refund = await _refundRepository.FindAsync(eventData.Entity.Id); + + if (refund != null) + { + return; + } + + var payment = await _paymentRepository.FindAsync(eventData.Entity.PaymentId); + + if (payment == null) + { + return; + } + + refund = _objectMapper.Map(eventData.Entity); + + refund.SetRefundItems( + _objectMapper.Map, List>(eventData.Entity.RefundItems)); + + refund.RefundItems.ForEach(item => + { + FillRefundItemStoreId(item); + FillRefundItemOrderId(item); + }); + + FillRefundItemOrderLines(refund); + + await _refundRepository.InsertAsync(refund, true); + + if (refund.CompletedTime.HasValue) + { + _unitOfWorkManager.Current.OnCompleted(async () => + await _distributedEventBus.PublishAsync(new OrderRefundCompletedEto + {Refund = _objectMapper.Map(refund)})); + } + } [UnitOfWork(true)] public virtual async Task HandleEventAsync(EntityUpdatedEto eventData) { using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); - var publishOrderRefundCompletedEvent = false; - var refund = await _refundRepository.FindAsync(eventData.Entity.Id); if (refund == null) { - refund = _objectMapper.Map(eventData.Entity); - - refund.SetRefundItems( - _objectMapper.Map, List>(eventData.Entity.RefundItems)); + return; + } - refund.RefundItems.ForEach(item => - { - FillRefundItemStoreId(item); - FillRefundItemOrderId(item); - }); + if (eventData.Entity.CompletedTime.HasValue && !refund.CompletedTime.HasValue) + { + _unitOfWorkManager.Current.OnCompleted(async () => + await _distributedEventBus.PublishAsync(new OrderRefundCompletedEto + {Refund = _objectMapper.Map(refund)})); + } - if (refund.CompletedTime.HasValue) + _objectMapper.Map(eventData.Entity, refund); + + foreach (var etoItem in eventData.Entity.RefundItems) + { + var item = refund.RefundItems.FirstOrDefault(i => i.Id == etoItem.Id); + + if (item == null) { - publishOrderRefundCompletedEvent = true; + item = _objectMapper.Map(etoItem); + + refund.RefundItems.Add(item); } - - await _refundRepository.InsertAsync(refund, true); - } - else - { - if (eventData.Entity.CompletedTime.HasValue && !refund.CompletedTime.HasValue) + else { - publishOrderRefundCompletedEvent = true; + _objectMapper.Map(etoItem, item); } + + FillRefundItemStoreId(item); + FillRefundItemOrderId(item); + } - _objectMapper.Map(eventData.Entity, refund); + var etoRefundItemIds = eventData.Entity.RefundItems.Select(i => i.Id).ToList(); - foreach (var etoItem in eventData.Entity.RefundItems) - { - var item = refund.RefundItems.FirstOrDefault(i => i.Id == etoItem.Id); + refund.RefundItems.RemoveAll(i => !etoRefundItemIds.Contains(i.Id)); - if (item == null) - { - item = _objectMapper.Map(etoItem); - - refund.RefundItems.Add(item); - } - else - { - _objectMapper.Map(etoItem, item); - } + FillRefundItemOrderLines(refund); - FillRefundItemStoreId(item); - FillRefundItemOrderId(item); - } - - var etoRefundItemIds = eventData.Entity.RefundItems.Select(i => i.Id).ToList(); - - refund.RefundItems.RemoveAll(i => !etoRefundItemIds.Contains(i.Id)); - } + await _refundRepository.UpdateAsync(refund, true); + } + protected virtual void FillRefundItemOrderLines(Refund refund) + { foreach (var refundItem in refund.RefundItems) { var orderLineInfoModels = @@ -135,16 +171,6 @@ namespace EasyAbp.EShop.Payments.Refunds refundItem.RefundItemOrderLines.RemoveAll(i => !orderLineIds.Contains(i.OrderLineId)); } } - - await _refundRepository.UpdateAsync(refund, true); - - var orderRefundEto = _objectMapper.Map(refund); - - if (publishOrderRefundCompletedEvent) - { - _unitOfWorkManager.Current.OnCompleted(async () => - await _distributedEventBus.PublishAsync(new OrderRefundCompletedEto {Refund = orderRefundEto})); - } } protected virtual void FillRefundItemStoreId(RefundItem item) @@ -167,8 +193,11 @@ namespace EasyAbp.EShop.Payments.Refunds item.SetOrderId(orderId); } + [UnitOfWork(true)] public virtual async Task HandleEventAsync(EntityDeletedEto eventData) { + using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); + var refund = await _refundRepository.FindAsync(eventData.Entity.Id); if (refund == null) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs index ba552bfd..ab680473 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.EntityFrameworkCore/EasyAbp/EShop/Payments/Refunds/RefundRepository.cs @@ -1,6 +1,7 @@ using System; using System.Linq; using EasyAbp.EShop.Payments.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -12,6 +13,11 @@ namespace EasyAbp.EShop.Payments.Refunds { } + public override IQueryable WithDetails() + { + return base.WithDetails().Include(x => x.RefundItems); + } + public IQueryable GetQueryableByUserId(Guid userId) { return from refund in DbContext.Refunds diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderCreatedEventHandler.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderCreatedEventHandler.cs index e797b8f0..3331cbe2 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderCreatedEventHandler.cs @@ -32,12 +32,11 @@ namespace EasyAbp.EShop.Products.Products _productManager = productManager; } + [UnitOfWork(true)] public virtual async Task HandleEventAsync(EntityCreatedEto eventData) { using var changeTenant = _currentTenant.Change(eventData.Entity.TenantId); - using var uow = _unitOfWorkManager.Begin(isTransactional: true); - var models = new List(); foreach (var orderLine in eventData.Entity.OrderLines) @@ -84,14 +83,14 @@ namespace EasyAbp.EShop.Products.Products continue; } - await uow.RollbackAsync(); + await _unitOfWorkManager.Current.RollbackAsync(); await PublishResultEventAsync(eventData, false); return; } - await uow.CompleteAsync(); + await _unitOfWorkManager.Current.CompleteAsync(); await PublishResultEventAsync(eventData, true); } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderPaidEventHandler.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderPaidEventHandler.cs index 11a76d58..abad9812 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderPaidEventHandler.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/OrderPaidEventHandler.cs @@ -31,12 +31,11 @@ namespace EasyAbp.EShop.Products.Products _productManager = productManager; } + [UnitOfWork(true)] public virtual async Task HandleEventAsync(OrderPaidEto eventData) { using var changeTenant = _currentTenant.Change(eventData.Order.TenantId); - using var uow = _unitOfWorkManager.Begin(isTransactional: true); - var models = new List(); foreach (var orderLine in eventData.Order.OrderLines) @@ -83,14 +82,14 @@ namespace EasyAbp.EShop.Products.Products continue; } - await uow.RollbackAsync(); + await _unitOfWorkManager.Current.RollbackAsync(); await PublishResultEventAsync(eventData, false); return; } - await uow.CompleteAsync(); + await _unitOfWorkManager.Current.CompleteAsync(); await PublishResultEventAsync(eventData, true); } From 4f76ee3fc41644887c691203248c7c0a19ebb343 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 31 Aug 2020 15:15:03 +0800 Subject: [PATCH 13/24] Order.PaymentId should be set to null when the payment is canceled. Close #78 --- .../Orders/PaymentCanceledEventHandler.cs | 35 ++++++++++++++ .../Payments/EShopPaymentCanceledEto.cs | 10 ++++ .../Payments/Payments/PaymentSynchronizer.cs | 48 +++++++++++++------ 3 files changed, 79 insertions(+), 14 deletions(-) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCanceledEto.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs new file mode 100644 index 00000000..c7963b14 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCanceledEventHandler.cs @@ -0,0 +1,35 @@ +using System; +using System.Linq; +using System.Threading.Tasks; +using EasyAbp.EShop.Payments; +using EasyAbp.EShop.Payments.Payments; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Orders.Orders +{ + public class PaymentCanceledEventHandler : IDistributedEventHandler, ITransientDependency + { + private readonly IOrderRepository _orderRepository; + + public PaymentCanceledEventHandler(IOrderRepository orderRepository) + { + _orderRepository = orderRepository; + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(EShopPaymentCanceledEto eventData) + { + foreach (var paymentItem in eventData.Payment.PaymentItems.Where(item => + item.ItemType == PaymentsConsts.PaymentItemType)) + { + var order = await _orderRepository.GetAsync(Guid.Parse(paymentItem.ItemKey)); + + order.SetPaymentId(null); + + await _orderRepository.UpdateAsync(order, true); + } + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCanceledEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCanceledEto.cs new file mode 100644 index 00000000..cbd27968 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCanceledEto.cs @@ -0,0 +1,10 @@ +using System; + +namespace EasyAbp.EShop.Payments.Payments +{ + [Serializable] + public class EShopPaymentCanceledEto + { + public EShopPaymentEto Payment { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs index 7f6662e4..3371ee38 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Payments/PaymentSynchronizer.cs @@ -68,16 +68,37 @@ namespace EasyAbp.EShop.Payments.Payments if (payment.CompletionTime.HasValue) { - _unitOfWorkManager.Current.OnCompleted(async () => + PublishPaymentCompletedEventOnUowCompleted(payment); + } + + if (payment.CanceledTime.HasValue) + { + PublishPaymentCanceledEventOnUowCompleted(payment); + } + } + + protected virtual void PublishPaymentCanceledEventOnUowCompleted(Payment payment) + { + _unitOfWorkManager.Current.OnCompleted(async () => + { + await _distributedEventBus.PublishAsync(new EShopPaymentCanceledEto { - await _distributedEventBus.PublishAsync(new EShopPaymentCompletedEto - { - Payment = _objectMapper.Map(payment) - }); + Payment = _objectMapper.Map(payment) }); - } + }); } - + + protected virtual void PublishPaymentCompletedEventOnUowCompleted(Payment payment) + { + _unitOfWorkManager.Current.OnCompleted(async () => + { + await _distributedEventBus.PublishAsync(new EShopPaymentCompletedEto + { + Payment = _objectMapper.Map(payment) + }); + }); + } + [UnitOfWork(true)] public virtual async Task HandleEventAsync(EntityUpdatedEto eventData) { @@ -97,13 +118,12 @@ namespace EasyAbp.EShop.Payments.Payments if (eventData.Entity.CompletionTime.HasValue && !payment.CompletionTime.HasValue) { - _unitOfWorkManager.Current.OnCompleted(async () => - { - await _distributedEventBus.PublishAsync(new EShopPaymentCompletedEto - { - Payment = _objectMapper.Map(payment) - }); - }); + PublishPaymentCompletedEventOnUowCompleted(payment); + } + + if (eventData.Entity.CanceledTime.HasValue && !payment.CanceledTime.HasValue) + { + PublishPaymentCanceledEventOnUowCompleted(payment); } _objectMapper.Map(eventData.Entity, payment); From d3f98dced5dc31a4cd0b19e66ba04e082f7f8816 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 31 Aug 2020 15:38:14 +0800 Subject: [PATCH 14/24] Rename files and classes --- ...er.cs => BasicOrderCompletableCheckProvider.cs} | 2 +- ...ovider.cs => IOrderCompletableCheckProvider.cs} | 2 +- .../EShop/Orders/Orders/IOrderPaymentChecker.cs | 2 +- ...Handler.cs => IPaymentCompletedEventHandler.cs} | 2 +- ...ntHandler.cs => IPaymentCreatedEventHandler.cs} | 2 +- ...s => IProductInventoryReductionEventHandler.cs} | 2 +- ...alidException.cs => InvalidPaymentException.cs} | 4 ++-- .../EasyAbp/EShop/Orders/Orders/OrderManager.cs | 2 +- .../EShop/Orders/Orders/OrderPaymentChecker.cs | 2 +- ...tHandler.cs => PaymentCompletedEventHandler.cs} | 14 +++++++------- ...entHandler.cs => PaymentCreatedEventHandler.cs} | 14 +++++++------- ...cs => ProductInventoryReductionEventHandler.cs} | 4 ++-- ...ntHandler.cs => RefundCompletedEventHandler.cs} | 6 +++--- ...ception.cs => PaymentAlreadyExistsException.cs} | 4 ++-- .../Payments/Payments/BasicPayableCheckProvider.cs | 2 +- ...CompletedEto.cs => EShopPaymentCompletedEto.cs} | 0 .../{OrderPaymentEto.cs => EShopPaymentEto.cs} | 0 ...derPaymentItemEto.cs => EShopPaymentItemEto.cs} | 0 .../Payments/Refunds/EShopRefundCompletedEto.cs | 7 +++++++ .../{OrderRefundEto.cs => EShopRefundEto.cs} | 4 ++-- ...OrderRefundItemEto.cs => EShopRefundItemEto.cs} | 2 +- .../Payments/Refunds/OrderRefundCompletedEto.cs | 7 ------- .../EShop/Payments/EShopPaymentsDomainModule.cs | 2 +- .../Payments/PaymentsDomainAutoMapperProfile.cs | 4 ++-- .../EShop/Payments/Refunds/RefundSynchronizer.cs | 8 ++++---- 25 files changed, 49 insertions(+), 49 deletions(-) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{BasicCompletableCheckProvider.cs => BasicOrderCompletableCheckProvider.cs} (80%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{ICompletableCheckProvider.cs => IOrderCompletableCheckProvider.cs} (70%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{IOrderPaymentCompletedEventHandler.cs => IPaymentCompletedEventHandler.cs} (56%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{IOrderPaymentCreatedEventHandler.cs => IPaymentCreatedEventHandler.cs} (62%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{IOrderProductInventoryReductionEventHandler.cs => IProductInventoryReductionEventHandler.cs} (82%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{OrderPaymentInvalidException.cs => InvalidPaymentException.cs} (60%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{OrderPaymentCompletedEventHandler.cs => PaymentCompletedEventHandler.cs} (85%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{OrderPaymentCreatedEventHandler.cs => PaymentCreatedEventHandler.cs} (77%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{OrderProductInventoryReductionEventHandler.cs => ProductInventoryReductionEventHandler.cs} (92%) rename modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/{OrderRefundCompletedEventHandler.cs => RefundCompletedEventHandler.cs} (83%) rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/{OrderPaymentAlreadyExistsException.cs => PaymentAlreadyExistsException.cs} (58%) rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/{OrderPaymentCompletedEto.cs => EShopPaymentCompletedEto.cs} (100%) rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/{OrderPaymentEto.cs => EShopPaymentEto.cs} (100%) rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/{OrderPaymentItemEto.cs => EShopPaymentItemEto.cs} (100%) create mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundCompletedEto.cs rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/{OrderRefundEto.cs => EShopRefundEto.cs} (86%) rename modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/{OrderRefundItemEto.cs => EShopRefundItemEto.cs} (92%) delete mode 100644 modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundCompletedEto.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicCompletableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicOrderCompletableCheckProvider.cs similarity index 80% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicCompletableCheckProvider.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicOrderCompletableCheckProvider.cs index 11337db6..9fbc3d25 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicCompletableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/BasicOrderCompletableCheckProvider.cs @@ -3,7 +3,7 @@ using Volo.Abp.DependencyInjection; namespace EasyAbp.EShop.Orders.Orders { - public class BasicCompletableCheckProvider : ICompletableCheckProvider, ITransientDependency + public class BasicOrderCompletableCheckProvider : IOrderCompletableCheckProvider, ITransientDependency { public virtual Task CheckAsync(Order order) { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ICompletableCheckProvider.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderCompletableCheckProvider.cs similarity index 70% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ICompletableCheckProvider.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderCompletableCheckProvider.cs index df215e15..b130b1bf 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ICompletableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderCompletableCheckProvider.cs @@ -2,7 +2,7 @@ namespace EasyAbp.EShop.Orders.Orders { - public interface ICompletableCheckProvider + public interface IOrderCompletableCheckProvider { Task CheckAsync(Order order); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs index 26bfed31..3a3bb8a0 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentChecker.cs @@ -3,7 +3,7 @@ using EasyAbp.EShop.Payments.Payments; namespace EasyAbp.EShop.Orders.Orders { - public interface IEShopPaymentChecker + public interface IOrderPaymentChecker { Task IsValidPaymentAsync(Order order, EShopPaymentEto payment, EShopPaymentItemEto paymentItem); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCompletedEventHandler.cs similarity index 56% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCompletedEventHandler.cs index 5d9abb8d..2b98e44b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCompletedEventHandler.cs @@ -3,7 +3,7 @@ using Volo.Abp.EventBus.Distributed; namespace EasyAbp.EShop.Orders.Orders { - public interface IEShopPaymentCompletedEventHandler : IDistributedEventHandler + public interface IPaymentCompletedEventHandler : IDistributedEventHandler { } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCreatedEventHandler.cs similarity index 62% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCreatedEventHandler.cs index 4edcc08e..99256240 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderPaymentCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IPaymentCreatedEventHandler.cs @@ -4,7 +4,7 @@ using Volo.Abp.EventBus.Distributed; namespace EasyAbp.EShop.Orders.Orders { - public interface IEShopPaymentCreatedEventHandler : IDistributedEventHandler> + public interface IPaymentCreatedEventHandler : IDistributedEventHandler> { } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderProductInventoryReductionEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IProductInventoryReductionEventHandler.cs similarity index 82% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderProductInventoryReductionEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IProductInventoryReductionEventHandler.cs index 72c2368e..fb4f2829 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IOrderProductInventoryReductionEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/IProductInventoryReductionEventHandler.cs @@ -3,7 +3,7 @@ using Volo.Abp.EventBus.Distributed; namespace EasyAbp.EShop.Orders.Orders { - public interface IOrderProductInventoryReductionEventHandler : + public interface IProductInventoryReductionEventHandler : IDistributedEventHandler, IDistributedEventHandler { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidPaymentException.cs similarity index 60% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidPaymentException.cs index 20e80840..923db2fd 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentInvalidException.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/InvalidPaymentException.cs @@ -3,9 +3,9 @@ using Volo.Abp; namespace EasyAbp.EShop.Orders.Orders { - public class EShopPaymentInvalidException : BusinessException + public class InvalidPaymentException : BusinessException { - public EShopPaymentInvalidException(Guid paymentId, Guid orderId) + public InvalidPaymentException(Guid paymentId, Guid orderId) : base(message: $"The payment {paymentId} has invalid configurations for the order {orderId}.") { } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs index c4d53ce7..fae3139a 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs @@ -36,7 +36,7 @@ namespace EasyAbp.EShop.Orders.Orders throw new OrderIsInWrongStageException(order.Id); } - var providers = ServiceProvider.GetServices(); + var providers = ServiceProvider.GetServices(); foreach (var provider in providers) { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs index ce4dd864..7b4a18b1 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs @@ -6,7 +6,7 @@ using Volo.Abp.DependencyInjection; namespace EasyAbp.EShop.Orders.Orders { - public class EShopPaymentChecker : IEShopPaymentChecker, ITransientDependency + public class OrderPaymentChecker : IOrderPaymentChecker, ITransientDependency { public virtual async Task IsValidPaymentAsync(Order order, EShopPaymentEto payment, EShopPaymentItemEto paymentItem) { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCompletedEventHandler.cs similarity index 85% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCompletedEventHandler.cs index 89dac229..35273131 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCompletedEventHandler.cs @@ -12,22 +12,22 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class EShopPaymentCompletedEventHandler : IEShopPaymentCompletedEventHandler, ITransientDependency + public class PaymentCompletedEventHandler : IPaymentCompletedEventHandler, ITransientDependency { private readonly IClock _clock; private readonly ICurrentTenant _currentTenant; private readonly IObjectMapper _objectMapper; private readonly IUnitOfWorkManager _unitOfWorkManager; - private readonly IEShopPaymentChecker _eShopPaymentChecker; + private readonly IOrderPaymentChecker _orderPaymentChecker; private readonly IDistributedEventBus _distributedEventBus; private readonly IOrderRepository _orderRepository; - public EShopPaymentCompletedEventHandler( + public PaymentCompletedEventHandler( IClock clock, ICurrentTenant currentTenant, IObjectMapper objectMapper, IUnitOfWorkManager unitOfWorkManager, - IEShopPaymentChecker eShopPaymentChecker, + IOrderPaymentChecker orderPaymentChecker, IDistributedEventBus distributedEventBus, IOrderRepository orderRepository) { @@ -35,7 +35,7 @@ namespace EasyAbp.EShop.Orders.Orders _currentTenant = currentTenant; _objectMapper = objectMapper; _unitOfWorkManager = unitOfWorkManager; - _eShopPaymentChecker = eShopPaymentChecker; + _orderPaymentChecker = orderPaymentChecker; _distributedEventBus = distributedEventBus; _orderRepository = orderRepository; } @@ -64,9 +64,9 @@ namespace EasyAbp.EShop.Orders.Orders throw new OrderIsInWrongStageException(order.Id); } - if (!await _eShopPaymentChecker.IsValidPaymentAsync(order, payment, item)) + if (!await _orderPaymentChecker.IsValidPaymentAsync(order, payment, item)) { - throw new EShopPaymentInvalidException(payment.Id, orderId); + throw new InvalidPaymentException(payment.Id, orderId); } order.SetPaidTime(_clock.Now); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCreatedEventHandler.cs similarity index 77% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCreatedEventHandler.cs index 4e2b641c..ac62af33 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentCreatedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/PaymentCreatedEventHandler.cs @@ -10,19 +10,19 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class EShopPaymentCreatedEventHandler : IEShopPaymentCreatedEventHandler, ITransientDependency + public class PaymentCreatedEventHandler : IPaymentCreatedEventHandler, ITransientDependency { private readonly ICurrentTenant _currentTenant; - private readonly IEShopPaymentChecker _eShopPaymentChecker; + private readonly IOrderPaymentChecker _orderPaymentChecker; private readonly IOrderRepository _orderRepository; - public EShopPaymentCreatedEventHandler( + public PaymentCreatedEventHandler( ICurrentTenant currentTenant, - IEShopPaymentChecker eShopPaymentChecker, + IOrderPaymentChecker orderPaymentChecker, IOrderRepository orderRepository) { _currentTenant = currentTenant; - _eShopPaymentChecker = eShopPaymentChecker; + _orderPaymentChecker = orderPaymentChecker; _orderRepository = orderRepository; } @@ -43,10 +43,10 @@ namespace EasyAbp.EShop.Orders.Orders throw new OrderIsInWrongStageException(order.Id); } - if (!await _eShopPaymentChecker.IsValidPaymentAsync(order, eventData.Entity, item)) + if (!await _orderPaymentChecker.IsValidPaymentAsync(order, eventData.Entity, item)) { // Todo: should cancel the payment? - throw new EShopPaymentInvalidException(eventData.Entity.Id, orderId); + throw new InvalidPaymentException(eventData.Entity.Id, orderId); } order.SetPaymentId(eventData.Entity.Id); diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderProductInventoryReductionEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs similarity index 92% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderProductInventoryReductionEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs index 70e72dfb..35c07fe5 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderProductInventoryReductionEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/ProductInventoryReductionEventHandler.cs @@ -7,13 +7,13 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class OrderProductInventoryReductionEventHandler : IOrderProductInventoryReductionEventHandler, ITransientDependency + public class ProductInventoryReductionEventHandler : IProductInventoryReductionEventHandler, ITransientDependency { private readonly IClock _clock; private readonly ICurrentTenant _currentTenant; private readonly IOrderRepository _orderRepository; - public OrderProductInventoryReductionEventHandler( + public ProductInventoryReductionEventHandler( IClock clock, ICurrentTenant currentTenant, IOrderRepository orderRepository) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderRefundCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs similarity index 83% rename from modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderRefundCompletedEventHandler.cs rename to modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs index 29b3fc37..2e29dcae 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderRefundCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs @@ -8,12 +8,12 @@ using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { - public class OrderRefundCompletedEventHandler : IDistributedEventHandler, ITransientDependency + public class RefundCompletedEventHandler : IDistributedEventHandler, ITransientDependency { private readonly ICurrentTenant _currentTenant; private readonly IOrderRepository _orderRepository; - public OrderRefundCompletedEventHandler( + public RefundCompletedEventHandler( ICurrentTenant currentTenant, IOrderRepository orderRepository) { @@ -22,7 +22,7 @@ namespace EasyAbp.EShop.Orders.Orders } [UnitOfWork(true)] - public virtual async Task HandleEventAsync(OrderRefundCompletedEto eventData) + public virtual async Task HandleEventAsync(EShopRefundCompletedEto eventData) { using var changeTenant = _currentTenant.Change(eventData.Refund.TenantId); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/PaymentAlreadyExistsException.cs similarity index 58% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/PaymentAlreadyExistsException.cs index f755deb6..6fbcf9ee 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/OrderPaymentAlreadyExistsException.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application.Contracts/EasyAbp/EShop/Payments/Payments/PaymentAlreadyExistsException.cs @@ -3,9 +3,9 @@ using Volo.Abp; namespace EasyAbp.EShop.Payments.Payments { - public class EShopPaymentAlreadyExistsException : BusinessException + public class PaymentAlreadyExistsException : BusinessException { - public EShopPaymentAlreadyExistsException(Guid orderId) + public PaymentAlreadyExistsException(Guid orderId) : base(message: $"The order {orderId}'s payment is already exists.") { } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs index cdf82bd9..d0117f43 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/BasicPayableCheckProvider.cs @@ -14,7 +14,7 @@ namespace EasyAbp.EShop.Payments.Payments { foreach (var order in orders.Where(order => order.PaymentId.HasValue || order.PaidTime.HasValue)) { - throw new EShopPaymentAlreadyExistsException(order.Id); + throw new PaymentAlreadyExistsException(order.Id); } if (orders.Select(order => order.Currency).Distinct().Count() != 1) diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCompletedEto.cs similarity index 100% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentCompletedEto.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentCompletedEto.cs diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentEto.cs similarity index 100% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentEto.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentEto.cs diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentItemEto.cs similarity index 100% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/OrderPaymentItemEto.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Payments/EShopPaymentItemEto.cs diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundCompletedEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundCompletedEto.cs new file mode 100644 index 00000000..1917f0f2 --- /dev/null +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundCompletedEto.cs @@ -0,0 +1,7 @@ +namespace EasyAbp.EShop.Payments.Refunds +{ + public class EShopRefundCompletedEto + { + public EShopRefundEto Refund { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundEto.cs similarity index 86% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundEto.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundEto.cs index 687845b0..d9ee78d4 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundEto.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundEto.cs @@ -7,7 +7,7 @@ using Volo.Abp.MultiTenancy; namespace EasyAbp.EShop.Payments.Refunds { [Serializable] - public class OrderRefundEto : IRefund, IMultiTenant, IHasExtraProperties + public class EShopRefundEto : IRefund, IMultiTenant, IHasExtraProperties { #region Base properties @@ -39,6 +39,6 @@ namespace EasyAbp.EShop.Payments.Refunds #endregion - public List RefundItems { get; set; } = new List(); + public List RefundItems { get; set; } = new List(); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundItemEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundItemEto.cs similarity index 92% rename from modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundItemEto.cs rename to modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundItemEto.cs index 9c8c6495..b042d17e 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundItemEto.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/EShopRefundItemEto.cs @@ -6,7 +6,7 @@ using Volo.Abp.Data; namespace EasyAbp.EShop.Payments.Refunds { [Serializable] - public class OrderRefundItemEto : IRefundItem, IHasExtraProperties + public class EShopRefundItemEto : IRefundItem, IHasExtraProperties { #region Base properties diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundCompletedEto.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundCompletedEto.cs deleted file mode 100644 index 411e11fa..00000000 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain.Shared/EasyAbp/EShop/Payments/Refunds/OrderRefundCompletedEto.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace EasyAbp.EShop.Payments.Refunds -{ - public class OrderRefundCompletedEto - { - public OrderRefundEto Refund { get; set; } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs index d7dcd14b..aae7a6ea 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/EShopPaymentsDomainModule.cs @@ -20,7 +20,7 @@ namespace EasyAbp.EShop.Payments Configure(options => { options.EtoMappings.Add(typeof(EShopPaymentsDomainModule)); - options.EtoMappings.Add(typeof(EShopPaymentsDomainModule)); + options.EtoMappings.Add(typeof(EShopPaymentsDomainModule)); options.AutoEventSelectors.Add(); options.AutoEventSelectors.Add(); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs index 2974ef07..91f63bde 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/PaymentsDomainAutoMapperProfile.cs @@ -28,8 +28,8 @@ namespace EasyAbp.EShop.Payments CreateMap(); CreateMap(); - CreateMap(); - CreateMap(); + CreateMap(); + CreateMap(); CreateMap(); } } diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs index 702f42d8..285e7ae3 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Domain/EasyAbp/EShop/Payments/Refunds/RefundSynchronizer.cs @@ -89,8 +89,8 @@ namespace EasyAbp.EShop.Payments.Refunds if (refund.CompletedTime.HasValue) { _unitOfWorkManager.Current.OnCompleted(async () => - await _distributedEventBus.PublishAsync(new OrderRefundCompletedEto - {Refund = _objectMapper.Map(refund)})); + await _distributedEventBus.PublishAsync(new EShopRefundCompletedEto + {Refund = _objectMapper.Map(refund)})); } } @@ -109,8 +109,8 @@ namespace EasyAbp.EShop.Payments.Refunds if (eventData.Entity.CompletedTime.HasValue && !refund.CompletedTime.HasValue) { _unitOfWorkManager.Current.OnCompleted(async () => - await _distributedEventBus.PublishAsync(new OrderRefundCompletedEto - {Refund = _objectMapper.Map(refund)})); + await _distributedEventBus.PublishAsync(new EShopRefundCompletedEto + {Refund = _objectMapper.Map(refund)})); } _objectMapper.Map(eventData.Entity, refund); From 54036e1b036c43d82fe180a145f2bf96a6440b6c Mon Sep 17 00:00:00 2001 From: RayMMond Date: Mon, 31 Aug 2020 17:57:33 +0800 Subject: [PATCH 15/24] fix store owner extension methods. remove the related cache after a user's store ownership is changed. --- .../ProductInventoryAppService.cs | 1 - .../Products/Products/ProductAppService.cs | 3 +- .../StoreOwnerAuthorizationExtensions.cs | 31 +++++++------- .../MultiStoreAbstractKeyCrudAppService.cs | 9 +--- ...MultiStoreAbstractKeyReadOnlyAppService.cs | 9 +--- .../StoreOwners/StoreOwnerAppService.cs | 6 +-- .../StoreOwnerCacheItemInvalidator.cs | 41 +++++++++++++++++++ 7 files changed, 59 insertions(+), 41 deletions(-) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItemInvalidator.cs diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs index c894261f..eafa8c4f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs @@ -53,7 +53,6 @@ namespace EasyAbp.EShop.Products.ProductInventories } await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId.Value, - ProductsPermissions.ProductInventory.CrossStore, ProductsPermissions.ProductInventory.Update); await _productStoreRepository.GetAsync(input.ProductId, input.StoreId.Value); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index 29aafe1f..8444606e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -247,8 +247,7 @@ namespace EasyAbp.EShop.Products.Products var isCurrentUserStoreAdmin = await AuthorizationService.IsMultiStoreGrantedAsync(input.StoreId, - ProductsPermissions.Products.CrossStore, - ProductsPermissions.Products.Default); + ProductsPermissions.Products.Default, ProductsPermissions.Products.CrossStore); if (input.ShowHidden && !isCurrentUserStoreAdmin) { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs index b918ec75..68d32932 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs @@ -1,13 +1,12 @@ -using Microsoft.AspNetCore.Authorization; -using System; +using System; using System.Threading.Tasks; -using Volo.Abp.Authorization; +using Microsoft.AspNetCore.Authorization; namespace EasyAbp.EShop.Stores.Permissions { public static class StoreOwnerAuthorizationExtensions { - public static Task IsStoreOwnerGrantedAsync(this IAuthorizationService authorizationService, + public static Task IsCurrentUserStoreOwnerAsync(this IAuthorizationService authorizationService, Guid storeId, string policyName = null, object resource = null) { return authorizationService.IsGrantedAsync(resource, @@ -15,10 +14,9 @@ namespace EasyAbp.EShop.Stores.Permissions } public static async Task IsMultiStoreGrantedAsync(this IAuthorizationService authorizationService, - Guid? storeId, string crossStorePolicyName, string policyName, object resource = null) + Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) { - if (storeId.HasValue - && await authorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + if (storeId.HasValue && await authorizationService.IsCurrentUserStoreOwnerAsync(storeId.Value, policyName)) { return true; } @@ -26,12 +24,18 @@ namespace EasyAbp.EShop.Stores.Permissions return await authorizationService.IsGrantedAsync(resource, crossStorePolicyName) && await authorizationService.IsGrantedAsync(resource, policyName); } + + public static Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, + Guid storeId, string policyName, object resource = null) + { + return authorizationService.CheckAsync(resource, + new StorePermissionAuthorizationRequirement(storeId, policyName)); + } public static async Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, - Guid? storeId, string crossStorePolicyName, string policyName, object resource = null) + Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) { - if (storeId.HasValue - && await authorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) + if (storeId.HasValue && await authorizationService.IsCurrentUserStoreOwnerAsync(storeId.Value, policyName, resource)) { return; } @@ -39,12 +43,5 @@ namespace EasyAbp.EShop.Stores.Permissions await authorizationService.CheckAsync(resource, crossStorePolicyName); await authorizationService.CheckAsync(resource, policyName); } - - public static Task CheckStoreOwnerAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName = null, object resource = null) - { - return authorizationService.CheckAsync(resource, - new StorePermissionAuthorizationRequirement(storeId, policyName)); - } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs index 44745c2d..90e8b5d5 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -112,14 +112,7 @@ namespace EasyAbp.EShop.Stores.Stores protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) { - if (storeId.HasValue - && await AuthorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) - { - return; - } - - await CheckPolicyAsync(CrossStorePolicyName); - await CheckPolicyAsync(policyName); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs index ea0e2a5b..73a986f1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs @@ -52,14 +52,7 @@ namespace EasyAbp.EShop.Stores.Stores protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) { - if (storeId.HasValue - && await AuthorizationService.IsStoreOwnerGrantedAsync(storeId.Value, policyName)) - { - return; - } - - await CheckPolicyAsync(CrossStorePolicyName); - await CheckPolicyAsync(policyName); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index 904bdc34..2a20a109 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; using EasyAbp.EShop.Stores.Permissions; using EasyAbp.EShop.Stores.StoreOwners.Dtos; using EasyAbp.EShop.Stores.Stores; -using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.StoreOwners { @@ -19,13 +18,10 @@ namespace EasyAbp.EShop.Stores.StoreOwners protected override string CrossStorePolicyName { get; set; } = StoresPermissions.Stores.CrossStore; private readonly IStoreOwnerRepository _repository; - private readonly IStoreOwnerStore _storeOwnerStore; - public StoreOwnerAppService(IStoreOwnerRepository repository, - IStoreOwnerStore storeOwnerStore) : base(repository) + public StoreOwnerAppService(IStoreOwnerRepository repository) : base(repository) { _repository = repository; - _storeOwnerStore = storeOwnerStore; } public override async Task CreateAsync(StoreOwnerDto input) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItemInvalidator.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItemInvalidator.cs new file mode 100644 index 00000000..7d96a3c6 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerCacheItemInvalidator.cs @@ -0,0 +1,41 @@ +using System; +using System.Threading.Tasks; +using Volo.Abp.Caching; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities.Events; +using Volo.Abp.EventBus; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Stores.StoreOwners +{ + public class StoreOwnerCacheItemInvalidator : ILocalEventHandler>, ITransientDependency + { + protected ICurrentTenant CurrentTenant { get; } + + protected IDistributedCache Cache { get; } + + public StoreOwnerCacheItemInvalidator(IDistributedCache cache, ICurrentTenant currentTenant) + { + Cache = cache; + CurrentTenant = currentTenant; + } + + public virtual async Task HandleEventAsync(EntityChangedEventData eventData) + { + var cacheKey = CalculateCacheKey( + eventData.Entity.StoreId, + eventData.Entity.OwnerUserId + ); + + using (CurrentTenant.Change(eventData.Entity.TenantId)) + { + await Cache.RemoveAsync(cacheKey); + } + } + + protected virtual string CalculateCacheKey(Guid storeId, Guid userId) + { + return StoreOwnerCacheItem.CalculateCacheKey(storeId, userId); + } + } +} \ No newline at end of file From cdd29205f5ca68b759ae41a76a20bc9bbbee01e3 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 31 Aug 2020 19:58:45 +0800 Subject: [PATCH 16/24] Introduce Transaction aggregate root in Stores module. Close #90 --- .../EShop/Orders/Orders/NewOrderGenerator.cs | 5 +- .../EasyAbp.EShop.Orders.Domain.Shared.csproj | 1 + .../Orders/EShopOrdersDomainSharedModule.cs | 4 +- .../EShop/Orders/Orders/OrderCanceledEto.cs | 10 + .../EShop/Orders/Orders/OrderCompletedEto.cs | 10 + .../EShop/Orders/Orders/OrderPaidEto.cs | 1 + .../EShop/Orders/Orders/OrderRefundedEto.cs | 13 + .../EShop/Orders/Orders/OrderManager.cs | 24 + .../Orders/RefundCompletedEventHandler.cs | 17 + .../EShop/Orders/Orders/Order/Index.cshtml | 4 + .../Pages/EShop/Orders/Orders/Order/index.js | 4 +- .../StoresPermissionDefinitionProvider.cs | 13 +- .../Stores/Permissions/StoresPermissions.cs | 12 +- .../Dtos/CreateUpdateTransactionDto.cs | 20 + .../Dtos/GetTransactionListInput.cs | 10 + .../Transactions/Dtos/TransactionDto.cs | 21 + .../Transactions/ITransactionAppService.cs | 17 + .../StoresApplicationAutoMapperProfile.cs | 4 + .../Transactions/TransactionAppService.cs | 31 + .../EShop/Stores/Localization/Stores/cs.json | 17 +- .../EShop/Stores/Localization/Stores/en.json | 17 +- .../EShop/Stores/Localization/Stores/pl.json | 17 +- .../Stores/Localization/Stores/pt-BR.json | 17 +- .../EShop/Stores/Localization/Stores/sl.json | 17 +- .../EShop/Stores/Localization/Stores/tr.json | 17 +- .../EShop/Stores/Localization/Stores/vi.json | 17 +- .../Stores/Localization/Stores/zh-Hans.json | 17 +- .../Stores/Localization/Stores/zh-Hant.json | 17 +- .../EasyAbp/EShop/Stores/StoresConsts.cs | 9 + .../Stores/Transactions/TransactionType.cs | 11 + .../EasyAbp.EShop.Stores.Domain.csproj | 1 + .../EShop/Stores/EShopStoresDomainModule.cs | 8 +- .../Transactions/ITransactionRepository.cs | 9 + .../OrderCompletedEventHandler.cs | 41 + .../Transactions/OrderRefundedEventHandler.cs | 42 + .../EShop/Stores/Transactions/Transaction.cs | 48 + .../EShopStoresEntityFrameworkCoreModule.cs | 2 + .../EntityFrameworkCore/IStoresDbContext.cs | 2 + .../EntityFrameworkCore/StoresDbContext.cs | 2 + .../StoresDbContextModelCreatingExtensions.cs | 10 + .../Transactions/TransactionRepository.cs | 14 + .../Transactions/TransactionController.cs | 54 + .../Menus/StoresMenuContributor.cs | 12 + .../Menus/StoresMenus.cs | 2 + .../Transaction/CreateModal.cshtml | 18 + .../Transaction/CreateModal.cshtml.cs | 28 + .../Transactions/Transaction/EditModal.cshtml | 19 + .../Transaction/EditModal.cshtml.cs | 39 + .../Transactions/Transaction/Index.cshtml | 63 + .../Transactions/Transaction/Index.cshtml.cs | 17 + .../CreateEditTransactionViewModel.cs | 27 + .../Stores/Transactions/Transaction/index.css | 0 .../Stores/Transactions/Transaction/index.js | 70 + .../StoresWebAutoMapperProfile.cs | 6 + .../TransactionAppServiceTests.cs | 26 + .../Transactions/TransactionDomainTests.cs | 23 + .../TransactionRepositoryTests.cs | 31 + .../EShopSample.DbMigrator/appsettings.json | 3 +- ...ransactionEntityToStoresModule.Designer.cs | 4225 +++++++++++++++++ ...28_AddedTransactionEntityToStoresModule.cs | 39 + ...redHasColumnTypeForTransaction.Designer.cs | 4225 +++++++++++++++++ ...1_ConfiguredHasColumnTypeForTransaction.cs | 29 + ...pSampleMigrationsDbContextModelSnapshot.cs | 51 + 63 files changed, 9557 insertions(+), 23 deletions(-) create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCanceledEto.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCompletedEto.cs create mode 100644 modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderRefundedEto.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/CreateUpdateTransactionDto.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/GetTransactionListInput.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/TransactionDto.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/ITransactionAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Transactions/TransactionAppService.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoresConsts.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Transactions/TransactionType.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/ITransactionRepository.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/Transaction.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Transactions/TransactionRepository.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/Transactions/TransactionController.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/ViewModels/CreateEditTransactionViewModel.cs create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.css create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.js create mode 100644 modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Application.Tests/Transactions/TransactionAppServiceTests.cs create mode 100644 modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Domain.Tests/Transactions/TransactionDomainTests.cs create mode 100644 modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.EntityFrameworkCore.Tests/EntityFrameworkCore/Transactions/TransactionRepositoryTests.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index c066cbab..908928d3 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -48,6 +48,9 @@ namespace EasyAbp.EShop.Orders.Orders } var productTotalPrice = orderLines.Select(x => x.TotalPrice).Sum(); + + // Todo: totalPrice may contain other fee. + var totalPrice = productTotalPrice; var order = new Order( id: _guidGenerator.Create(), @@ -57,7 +60,7 @@ namespace EasyAbp.EShop.Orders.Orders currency: await GetStoreCurrencyAsync(input.StoreId), productTotalPrice: productTotalPrice, totalDiscount: orderLines.Select(x => x.TotalDiscount).Sum(), - totalPrice: productTotalPrice, + totalPrice: totalPrice, customerRemark: input.CustomerRemark); foreach (var orderExtraProperty in orderExtraProperties) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj index 4c581bce..4211f103 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp.EShop.Orders.Domain.Shared.csproj @@ -10,6 +10,7 @@ + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs index ca015ab3..e372e658 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/EShopOrdersDomainSharedModule.cs @@ -1,6 +1,7 @@ using Volo.Abp.Modularity; using Volo.Abp.Localization; using EasyAbp.EShop.Orders.Localization; +using EasyAbp.EShop.Payments; using EasyAbp.EShop.Stores; using Volo.Abp.Localization.ExceptionHandling; using Volo.Abp.Validation; @@ -11,7 +12,8 @@ namespace EasyAbp.EShop.Orders { [DependsOn( typeof(AbpValidationModule), - typeof(EShopStoresDomainSharedModule) + typeof(EShopStoresDomainSharedModule), + typeof(EShopPaymentsDomainSharedModule) )] public class EShopOrdersDomainSharedModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCanceledEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCanceledEto.cs new file mode 100644 index 00000000..3003eb3a --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCanceledEto.cs @@ -0,0 +1,10 @@ +using System; + +namespace EasyAbp.EShop.Orders.Orders +{ + [Serializable] + public class OrderCanceledEto + { + public OrderEto Order { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCompletedEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCompletedEto.cs new file mode 100644 index 00000000..29ffaccb --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderCompletedEto.cs @@ -0,0 +1,10 @@ +using System; + +namespace EasyAbp.EShop.Orders.Orders +{ + [Serializable] + public class OrderCompletedEto + { + public OrderEto Order { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderPaidEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderPaidEto.cs index b05194b1..7a9a4762 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderPaidEto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderPaidEto.cs @@ -2,6 +2,7 @@ namespace EasyAbp.EShop.Orders.Orders { + [Serializable] public class OrderPaidEto { public OrderEto Order { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderRefundedEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderRefundedEto.cs new file mode 100644 index 00000000..a2f00614 --- /dev/null +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderRefundedEto.cs @@ -0,0 +1,13 @@ +using System; +using EasyAbp.EShop.Payments.Refunds; + +namespace EasyAbp.EShop.Orders.Orders +{ + [Serializable] + public class OrderRefundedEto + { + public OrderEto Order { get; set; } + + public EShopRefundEto Refund { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs index fae3139a..32e52164 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderManager.cs @@ -2,20 +2,32 @@ using System.Threading.Tasks; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Domain.Services; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.ObjectMapping; using Volo.Abp.Timing; +using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders { public class OrderManager : DomainService, IOrderManager { private readonly IClock _clock; + private readonly IObjectMapper _objectMapper; + private readonly IDistributedEventBus _distributedEventBus; + private readonly IUnitOfWorkManager _unitOfWorkManager; private readonly IOrderRepository _orderRepository; public OrderManager( IClock clock, + IObjectMapper objectMapper, + IDistributedEventBus distributedEventBus, + IUnitOfWorkManager unitOfWorkManager, IOrderRepository orderRepository) { _clock = clock; + _objectMapper = objectMapper; + _distributedEventBus = distributedEventBus; + _unitOfWorkManager = unitOfWorkManager; _orderRepository = orderRepository; } @@ -46,6 +58,12 @@ namespace EasyAbp.EShop.Orders.Orders order.SetCompletionTime(_clock.Now); order.SetOrderStatus(OrderStatus.Completed); + _unitOfWorkManager.Current.OnCompleted(async () => await _distributedEventBus.PublishAsync( + new OrderCompletedEto + { + Order = _objectMapper.Map(order) + })); + return await _orderRepository.UpdateAsync(order, true); } @@ -63,6 +81,12 @@ namespace EasyAbp.EShop.Orders.Orders order.SetCanceled(_clock.Now, cancellationReason); order.SetOrderStatus(OrderStatus.Canceled); + + _unitOfWorkManager.Current.OnCompleted(async () => await _distributedEventBus.PublishAsync( + new OrderCanceledEto + { + Order = _objectMapper.Map(order) + })); return await _orderRepository.UpdateAsync(order, true); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs index 2e29dcae..ca8dd3aa 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/RefundCompletedEventHandler.cs @@ -4,6 +4,7 @@ using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus.Distributed; using Volo.Abp.MultiTenancy; +using Volo.Abp.ObjectMapping; using Volo.Abp.Uow; namespace EasyAbp.EShop.Orders.Orders @@ -11,13 +12,22 @@ namespace EasyAbp.EShop.Orders.Orders public class RefundCompletedEventHandler : IDistributedEventHandler, ITransientDependency { private readonly ICurrentTenant _currentTenant; + private readonly IObjectMapper _objectMapper; + private readonly IUnitOfWorkManager _unitOfWorkManager; + private readonly IDistributedEventBus _distributedEventBus; private readonly IOrderRepository _orderRepository; public RefundCompletedEventHandler( ICurrentTenant currentTenant, + IObjectMapper objectMapper, + IUnitOfWorkManager unitOfWorkManager, + IDistributedEventBus distributedEventBus, IOrderRepository orderRepository) { _currentTenant = currentTenant; + _objectMapper = objectMapper; + _unitOfWorkManager = unitOfWorkManager; + _distributedEventBus = distributedEventBus; _orderRepository = orderRepository; } @@ -36,6 +46,13 @@ namespace EasyAbp.EShop.Orders.Orders } await _orderRepository.UpdateAsync(order, true); + + _unitOfWorkManager.Current.OnCompleted(async () => await _distributedEventBus.PublishAsync( + new OrderRefundedEto + { + Order = _objectMapper.Map(order), + Refund = eventData.Refund + })); } } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml index 72fe436d..ee7b1096 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/Index.cshtml @@ -34,6 +34,10 @@ } + + diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js index 61f76126..52615865 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/Pages/EShop/Orders/Orders/Order/index.js @@ -12,7 +12,9 @@ $(function () { autoWidth: false, scrollCollapse: true, order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList), + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId } + }), columnDefs: [ { rowAction: { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs index 77bdb864..7c0177bc 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissionDefinitionProvider.cs @@ -1,4 +1,4 @@ -using EasyAbp.EShop.Stores.Localization; +using EasyAbp.EShop.Stores.Localization; using Volo.Abp.Authorization.Permissions; using Volo.Abp.Localization; using Volo.Abp.MultiTenancy; @@ -9,12 +9,17 @@ namespace EasyAbp.EShop.Stores.Permissions { public override void Define(IPermissionDefinitionContext context) { - var moduleGroup = context.AddGroup(StoresPermissions.GroupName, L("Permission:Stores")); + var myGroup = context.AddGroup(StoresPermissions.GroupName, L("Permission:Stores")); - var stores = moduleGroup.AddPermission(StoresPermissions.Stores.Default, L("Permission:Store")); + var stores = myGroup.AddPermission(StoresPermissions.Stores.Default, L("Permission:Store")); stores.AddChild(StoresPermissions.Stores.Create, L("Permission:Create")); stores.AddChild(StoresPermissions.Stores.Update, L("Permission:Update")); stores.AddChild(StoresPermissions.Stores.Delete, L("Permission:Delete"), MultiTenancySides.Host); + + var transactionPermission = myGroup.AddPermission(StoresPermissions.Transaction.Default, L("Permission:Transaction")); + transactionPermission.AddChild(StoresPermissions.Transaction.Create, L("Permission:Create")); + transactionPermission.AddChild(StoresPermissions.Transaction.Update, L("Permission:Update")); + transactionPermission.AddChild(StoresPermissions.Transaction.Delete, L("Permission:Delete")); } private static LocalizableString L(string name) @@ -22,4 +27,4 @@ namespace EasyAbp.EShop.Stores.Permissions return LocalizableString.Create(name); } } -} \ No newline at end of file +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs index be383fde..514e0ea4 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Permissions/StoresPermissions.cs @@ -1,4 +1,4 @@ -using Volo.Abp.Reflection; +using Volo.Abp.Reflection; namespace EasyAbp.EShop.Stores.Permissions { @@ -18,5 +18,13 @@ namespace EasyAbp.EShop.Stores.Permissions public const string Update = Default + ".Update"; public const string Create = Default + ".Create"; } + + public class Transaction + { + public const string Default = GroupName + ".Transaction"; + public const string Update = Default + ".Update"; + public const string Create = Default + ".Create"; + public const string Delete = Default + ".Delete"; + } } -} \ No newline at end of file +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/CreateUpdateTransactionDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/CreateUpdateTransactionDto.cs new file mode 100644 index 00000000..19e17728 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/CreateUpdateTransactionDto.cs @@ -0,0 +1,20 @@ +using System; +using System.ComponentModel; +namespace EasyAbp.EShop.Stores.Transactions.Dtos +{ + [Serializable] + public class CreateUpdateTransactionDto + { + public Guid StoreId { get; set; } + + public Guid? OrderId { get; set; } + + public TransactionType TransactionType { get; set; } + + public string ActionName { get; set; } + + public string Currency { get; set; } + + public decimal Amount { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/GetTransactionListInput.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/GetTransactionListInput.cs new file mode 100644 index 00000000..7fc423c6 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/GetTransactionListInput.cs @@ -0,0 +1,10 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.Transactions.Dtos +{ + public class GetTransactionListInput : PagedAndSortedResultRequestDto + { + public Guid StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/TransactionDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/TransactionDto.cs new file mode 100644 index 00000000..9f19a611 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/Dtos/TransactionDto.cs @@ -0,0 +1,21 @@ +using System; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.Transactions.Dtos +{ + [Serializable] + public class TransactionDto : CreationAuditedEntityDto + { + public Guid StoreId { get; set; } + + public Guid? OrderId { get; set; } + + public TransactionType TransactionType { get; set; } + + public string ActionName { get; set; } + + public string Currency { get; set; } + + public decimal Amount { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/ITransactionAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/ITransactionAppService.cs new file mode 100644 index 00000000..e17a7b1a --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Transactions/ITransactionAppService.cs @@ -0,0 +1,17 @@ +using System; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public interface ITransactionAppService : + ICrudAppService< + TransactionDto, + Guid, + GetTransactionListInput, + CreateUpdateTransactionDto, + CreateUpdateTransactionDto> + { + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs index 7f600d61..5608d676 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs @@ -1,5 +1,7 @@ using EasyAbp.EShop.Stores.Stores; using EasyAbp.EShop.Stores.Stores.Dtos; +using EasyAbp.EShop.Stores.Transactions; +using EasyAbp.EShop.Stores.Transactions.Dtos; using AutoMapper; namespace EasyAbp.EShop.Stores @@ -13,6 +15,8 @@ namespace EasyAbp.EShop.Stores * into multiple profile classes for a better organization. */ CreateMap(); CreateMap(MemberList.Source); + CreateMap(); + CreateMap(MemberList.Source); } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Transactions/TransactionAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Transactions/TransactionAppService.cs new file mode 100644 index 00000000..2a7c88e2 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/Transactions/TransactionAppService.cs @@ -0,0 +1,31 @@ +using System; +using System.Linq; +using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using Volo.Abp.Application.Dtos; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class TransactionAppService : CrudAppService, + ITransactionAppService + { + protected override string GetPolicyName { get; set; } = StoresPermissions.Transaction.Default; + protected override string GetListPolicyName { get; set; } = StoresPermissions.Transaction.Default; + protected override string CreatePolicyName { get; set; } = StoresPermissions.Transaction.Create; + protected override string UpdatePolicyName { get; set; } = StoresPermissions.Transaction.Update; + protected override string DeletePolicyName { get; set; } = StoresPermissions.Transaction.Delete; + + private readonly ITransactionRepository _repository; + + public TransactionAppService(ITransactionRepository repository) : base(repository) + { + _repository = repository; + } + + protected override IQueryable CreateFilteredQuery(GetTransactionListInput input) + { + return base.CreateFilteredQuery(input).Where(x => x.StoreId == input.StoreId); + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json index 35015df9..cc3536a1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json @@ -7,6 +7,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json index 88eb274d..96a5eb37 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json @@ -8,6 +8,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json index 5b85c8c4..c7844372 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json @@ -7,6 +7,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json index 774c1c9e..dcdb9b05 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json @@ -7,6 +7,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json index cf6c73d7..26a39ff9 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json @@ -8,6 +8,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json index 1cd9bcde..3f0d2ce1 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json @@ -8,6 +8,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json index 4a8b2d0b..11e3f800 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json @@ -7,6 +7,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json index fdcac995..0e44ee8d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json @@ -8,6 +8,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json index 33b25c6c..e505c8b0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json @@ -8,6 +8,21 @@ "CreateStore": "CreateStore", "EditStore": "EditStore", "StoreDeletionConfirmationMessage": "Are you sure to delete the store {0}?", - "SuccessfullyDeleted": "Successfully deleted" + "SuccessfullyDeleted": "Successfully deleted", + "Permission:Transaction": "Transaction", + "Permission:Create": "Create", + "Permission:Update": "Update", + "Permission:Delete": "Delete", + "Menu:Transaction": "MenuTransaction", + "Transaction": "Transaction", + "TransactionStoreId": "TransactionStoreId", + "TransactionOrderId": "TransactionOrderId", + "TransactionTransactionType": "TransactionTransactionType", + "TransactionActionName": "TransactionActionName", + "TransactionCurrency": "TransactionCurrency", + "TransactionAmount": "TransactionAmount", + "CreateTransaction": "CreateTransaction", + "EditTransaction": "EditTransaction", + "TransactionDeletionConfirmationMessage": "Are you sure to delete the transaction {0}?" } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoresConsts.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoresConsts.cs new file mode 100644 index 00000000..492c5de8 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/StoresConsts.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Stores +{ + public static class StoresConsts + { + public const string TransactionOrderCompletedActionName = "OrderCompleted"; + + public const string TransactionOrderRefundedActionName = "OrderRefunded"; + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Transactions/TransactionType.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Transactions/TransactionType.cs new file mode 100644 index 00000000..71ad4534 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Transactions/TransactionType.cs @@ -0,0 +1,11 @@ +using System; + + namespace EasyAbp.EShop.Stores.Transactions +{ + [Flags] + public enum TransactionType + { + Debit = 1, + Credit = 2 + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj index 31f32699..b45c51e9 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp.EShop.Stores.Domain.csproj @@ -9,6 +9,7 @@ + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/EShopStoresDomainModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/EShopStoresDomainModule.cs index 0f93ceed..aa7c873d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/EShopStoresDomainModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/EShopStoresDomainModule.cs @@ -1,10 +1,12 @@ -using Volo.Abp.Modularity; +using EasyAbp.EShop.Orders; +using Volo.Abp.Modularity; namespace EasyAbp.EShop.Stores { [DependsOn( - typeof(EShopStoresDomainSharedModule) - )] + typeof(EShopStoresDomainSharedModule), + typeof(EShopOrdersDomainSharedModule) + )] public class EShopStoresDomainModule : AbpModule { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/ITransactionRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/ITransactionRepository.cs new file mode 100644 index 00000000..9f000d42 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/ITransactionRepository.cs @@ -0,0 +1,9 @@ +using System; +using Volo.Abp.Domain.Repositories; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public interface ITransactionRepository : IRepository + { + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs new file mode 100644 index 00000000..8c3d2415 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs @@ -0,0 +1,41 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class OrderCompletedEventHandler : IDistributedEventHandler, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + private readonly ITransactionRepository _transactionRepository; + + public OrderCompletedEventHandler( + IGuidGenerator guidGenerator, + ICurrentTenant currentTenant, + ITransactionRepository transactionRepository) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + _transactionRepository = transactionRepository; + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(OrderCompletedEto eventData) + { + var order = eventData.Order; + + using var changeTenant = _currentTenant.Change(order.TenantId); + + var transaction = new Transaction(_guidGenerator.Create(), order.TenantId, order.StoreId, order.Id, + TransactionType.Debit, StoresConsts.TransactionOrderCompletedActionName, order.Currency, + order.TotalPrice); + + await _transactionRepository.InsertAsync(transaction, true); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs new file mode 100644 index 00000000..c6821cbe --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs @@ -0,0 +1,42 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Orders.Orders; +using Volo.Abp.DependencyInjection; +using Volo.Abp.EventBus.Distributed; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class OrderRefundedEventHandler : IDistributedEventHandler, ITransientDependency + { + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + private readonly ITransactionRepository _transactionRepository; + + public OrderRefundedEventHandler( + IGuidGenerator guidGenerator, + ICurrentTenant currentTenant, + ITransactionRepository transactionRepository) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + _transactionRepository = transactionRepository; + } + + [UnitOfWork(true)] + public virtual async Task HandleEventAsync(OrderRefundedEto eventData) + { + var order = eventData.Order; + var refund = eventData.Refund; + + using var changeTenant = _currentTenant.Change(order.TenantId); + + var transaction = new Transaction(_guidGenerator.Create(), order.TenantId, order.StoreId, order.Id, + TransactionType.Credit, StoresConsts.TransactionOrderRefundedActionName, refund.Currency, + -refund.RefundAmount); + + await _transactionRepository.InsertAsync(transaction, true); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/Transaction.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/Transaction.cs new file mode 100644 index 00000000..e673b024 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/Transaction.cs @@ -0,0 +1,48 @@ +using System; +using JetBrains.Annotations; +using Volo.Abp.Domain.Entities.Auditing; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class Transaction : CreationAuditedAggregateRoot, IMultiTenant + { + public virtual Guid? TenantId { get; protected set; } + + public virtual Guid StoreId { get; protected set; } + + public virtual Guid? OrderId { get; protected set; } + + public virtual TransactionType TransactionType { get; protected set; } + + [NotNull] + public virtual string ActionName { get; protected set; } + + [NotNull] + public virtual string Currency { get; protected set; } + + public virtual decimal Amount { get; protected set; } + + protected Transaction() + { + } + + public Transaction(Guid id, + Guid? tenantId, + Guid storeId, + Guid? orderId, + TransactionType transactionType, + [NotNull] string actionName, + [NotNull] string currency, + decimal amount) : base(id) + { + TenantId = tenantId; + StoreId = storeId; + OrderId = orderId; + TransactionType = transactionType; + ActionName = actionName; + Currency = currency; + Amount = amount; + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs index d31bf8a5..9ae4f2e3 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/EShopStoresEntityFrameworkCoreModule.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Stores.Transactions; using EasyAbp.EShop.Stores.Stores; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.EntityFrameworkCore; @@ -19,6 +20,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * options.AddRepository(); */ options.AddRepository(); + options.AddRepository(); }); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs index 3f685352..06f67add 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/IStoresDbContext.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.EShop.Stores.Stores; +using EasyAbp.EShop.Stores.Transactions; namespace EasyAbp.EShop.Stores.EntityFrameworkCore { @@ -12,5 +13,6 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * DbSet Questions { get; } */ DbSet Stores { get; set; } + DbSet Transactions { get; set; } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs index a57ed827..234beb6f 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContext.cs @@ -2,6 +2,7 @@ using Microsoft.EntityFrameworkCore; using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.EShop.Stores.Stores; +using EasyAbp.EShop.Stores.Transactions; namespace EasyAbp.EShop.Stores.EntityFrameworkCore { @@ -12,6 +13,7 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore * public DbSet Questions { get; set; } */ public DbSet Stores { get; set; } + public DbSet Transactions { get; set; } public StoresDbContext(DbContextOptions options) : base(options) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs index 8b3b905b..6cea0741 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/EntityFrameworkCore/StoresDbContextModelCreatingExtensions.cs @@ -1,3 +1,4 @@ +using EasyAbp.EShop.Stores.Transactions; using EasyAbp.EShop.Stores.Stores; using System; using Microsoft.EntityFrameworkCore; @@ -47,6 +48,15 @@ namespace EasyAbp.EShop.Stores.EntityFrameworkCore b.ConfigureByConvention(); /* Configure more properties here */ }); + + + builder.Entity(b => + { + b.ToTable(options.TablePrefix + "Transactions", options.Schema); + b.ConfigureByConvention(); + /* Configure more properties here */ + b.Property(x => x.Amount).HasColumnType("decimal(20,8)"); + }); } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Transactions/TransactionRepository.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Transactions/TransactionRepository.cs new file mode 100644 index 00000000..f7c5ca95 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.EntityFrameworkCore/EasyAbp/EShop/Stores/Transactions/TransactionRepository.cs @@ -0,0 +1,14 @@ +using System; +using EasyAbp.EShop.Stores.EntityFrameworkCore; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class TransactionRepository : EfCoreRepository, ITransactionRepository + { + public TransactionRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/Transactions/TransactionController.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/Transactions/TransactionController.cs new file mode 100644 index 00000000..84b72b15 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/Transactions/TransactionController.cs @@ -0,0 +1,54 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp; +using Volo.Abp.Application.Dtos; + +namespace EasyAbp.EShop.Stores.Transactions +{ + [RemoteService(Name = "TransactionService")] + [Route("/api/stores/transaction")] + public class TransactionController : StoresController, ITransactionAppService + { + private readonly ITransactionAppService _service; + + public TransactionController(ITransactionAppService service) + { + _service = service; + } + + [HttpGet] + [Route("{id}")] + public Task GetAsync(Guid id) + { + return _service.GetAsync(id); + } + + [HttpGet] + public Task> GetListAsync(GetTransactionListInput input) + { + return _service.GetListAsync(input); + } + + [HttpPost] + public Task CreateAsync(CreateUpdateTransactionDto input) + { + return _service.CreateAsync(input); + } + + [HttpPut] + [Route("{id}")] + public Task UpdateAsync(Guid id, CreateUpdateTransactionDto input) + { + return _service.UpdateAsync(id, input); + } + + [HttpDelete] + [Route("{id}")] + public Task DeleteAsync(Guid id) + { + return _service.DeleteAsync(id); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs index fb91ec4c..9209b464 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenuContributor.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Threading.Tasks; using EasyAbp.EShop.Stores.Localization; using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Stores; +using Microsoft.Extensions.DependencyInjection; using Volo.Abp.UI.Navigation; namespace EasyAbp.EShop.Stores.Web.Menus @@ -29,6 +31,16 @@ namespace EasyAbp.EShop.Stores.Web.Menus ); } + if (await context.IsGrantedAsync(StoresPermissions.Transaction.Default)) + { + var storeAppService = context.ServiceProvider.GetRequiredService(); + + var defaultStore = (await storeAppService.GetDefaultAsync())?.Id; + + storeManagementMenuItem.AddItem( + new ApplicationMenuItem(StoresMenus.Transaction, l["Menu:Transaction"], "/EShop/Stores/Transactions/Transaction?storeId=" + defaultStore)); + } + if (!storeManagementMenuItem.Items.IsNullOrEmpty()) { var eShopMenuItem = context.Menu.Items.GetOrAdd(i => i.Name == StoresMenus.ModuleGroupPrefix, diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs index fc6bf9ec..7d550c02 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Menus/StoresMenus.cs @@ -7,6 +7,8 @@ public const string Prefix = ModuleGroupPrefix + ".Stores"; public const string Store = Prefix + ".Store"; + + public const string Transaction = Prefix + ".Transaction"; //Add your menu items here... //public const string Home = Prefix + ".MyNewMenuItem"; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml new file mode 100644 index 00000000..70da3dac --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml @@ -0,0 +1,18 @@ +@page +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@using EasyAbp.EShop.Stores.Localization +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.CreateModalModel +@{ + Layout = null; +} + + + + + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml.cs new file mode 100644 index 00000000..4670dab7 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/CreateModal.cshtml.cs @@ -0,0 +1,28 @@ +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Transactions; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction +{ + public class CreateModalModel : StoresPageModel + { + [BindProperty] + public CreateEditTransactionViewModel ViewModel { get; set; } + + private readonly ITransactionAppService _service; + + public CreateModalModel(ITransactionAppService service) + { + _service = service; + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.CreateAsync(dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml new file mode 100644 index 00000000..f7b2d652 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml @@ -0,0 +1,19 @@ +@page +@using EasyAbp.EShop.Stores.Localization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Modal; +@inject IHtmlLocalizer L +@model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.EditModalModel +@{ + Layout = null; +} + + + + + + + + + + diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml.cs new file mode 100644 index 00000000..14954a5f --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/EditModal.cshtml.cs @@ -0,0 +1,39 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Transactions; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.ViewModels; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction +{ + public class EditModalModel : StoresPageModel + { + [HiddenInput] + [BindProperty(SupportsGet = true)] + public Guid Id { get; set; } + + [BindProperty] + public CreateEditTransactionViewModel ViewModel { get; set; } + + private readonly ITransactionAppService _service; + + public EditModalModel(ITransactionAppService service) + { + _service = service; + } + + public virtual async Task OnGetAsync() + { + var dto = await _service.GetAsync(Id); + ViewModel = ObjectMapper.Map(dto); + } + + public virtual async Task OnPostAsync() + { + var dto = ObjectMapper.Map(ViewModel); + await _service.UpdateAsync(Id, dto); + return NoContent(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml new file mode 100644 index 00000000..0b63d7a5 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml @@ -0,0 +1,63 @@ +@page +@using EasyAbp.EShop.Stores.Permissions +@using Microsoft.AspNetCore.Authorization +@using Microsoft.AspNetCore.Mvc.Localization +@using Volo.Abp.AspNetCore.Mvc.UI.Layout +@using EasyAbp.EShop.Stores.Localization +@using EasyAbp.EShop.Stores.Web.Menus +@model EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.IndexModel +@inject IPageLayout PageLayout +@inject IHtmlLocalizer L +@inject IAuthorizationService Authorization +@{ + PageLayout.Content.Title = L["Transaction"].Value; + PageLayout.Content.BreadCrumb.Add(L["Menu:Transaction"].Value); + PageLayout.Content.MenuItemName = StoresMenus.Transaction; +} + +@section scripts +{ + +} +@section styles +{ + +} + + + + + + + + @L["Transaction"] + + + @if (await Authorization.IsGrantedAsync(StoresPermissions.Transaction.Create)) + { + + } + + + + + + + + @L["Actions"] + @L["TransactionStoreId"] + @L["TransactionOrderId"] + @L["TransactionTransactionType"] + @L["TransactionActionName"] + @L["TransactionCurrency"] + @L["TransactionAmount"] + + + + + \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml.cs new file mode 100644 index 00000000..d51ffdef --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/Index.cshtml.cs @@ -0,0 +1,17 @@ +using System; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction +{ + public class IndexModel : StoresPageModel + { + [BindProperty(SupportsGet = true)] + public Guid StoreId { get; set; } + + public virtual async Task OnGetAsync() + { + await Task.CompletedTask; + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/ViewModels/CreateEditTransactionViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/ViewModels/CreateEditTransactionViewModel.cs new file mode 100644 index 00000000..bdd6165e --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/ViewModels/CreateEditTransactionViewModel.cs @@ -0,0 +1,27 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Transactions; + +namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.ViewModels +{ + public class CreateEditTransactionViewModel + { + [Display(Name = "TransactionStoreId")] + public Guid StoreId { get; set; } + + [Display(Name = "TransactionOrderId")] + public Guid? OrderId { get; set; } + + [Display(Name = "TransactionTransactionType")] + public TransactionType TransactionType { get; set; } + + [Display(Name = "TransactionActionName")] + public string ActionName { get; set; } + + [Display(Name = "TransactionCurrency")] + public string Currency { get; set; } + + [Display(Name = "TransactionAmount")] + public decimal Amount { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.css b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.css new file mode 100644 index 00000000..e69de29b diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.js b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.js new file mode 100644 index 00000000..c4f67398 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Transactions/Transaction/index.js @@ -0,0 +1,70 @@ +$(function () { + + var l = abp.localization.getResource('EasyAbpEShopStores'); + + var service = easyAbp.eShop.stores.transactions.transaction; + var createModal = new abp.ModalManager(abp.appPath + 'EShop/Stores/Transactions/Transaction/CreateModal'); + var editModal = new abp.ModalManager(abp.appPath + 'EShop/Stores/Transactions/Transaction/EditModal'); + + var dataTable = $('#TransactionTable').DataTable(abp.libs.datatables.normalizeConfiguration({ + processing: true, + serverSide: true, + paging: true, + searching: false, + autoWidth: false, + scrollCollapse: true, + order: [[1, "asc"]], + ajax: abp.libs.datatables.createAjax(service.getList, function () { + return { storeId: storeId } + }), + columnDefs: [ + { + rowAction: { + items: + [ + { + text: l('Edit'), + visible: abp.auth.isGranted('Stores.Transaction.Update'), + action: function (data) { + editModal.open({ id: data.record.id }); + } + }, + { + text: l('Delete'), + visible: abp.auth.isGranted('Stores.Transaction.Delete'), + confirmMessage: function (data) { + return l('TransactionDeletionConfirmationMessage', data.record.id); + }, + action: function (data) { + service.delete(data.record.id) + .then(function () { + abp.notify.info(l('SuccessfullyDeleted')); + dataTable.ajax.reload(); + }); + } + } + ] + } + }, + { data: "storeId" }, + { data: "orderId" }, + { data: "transactionType" }, + { data: "actionName" }, + { data: "currency" }, + { data: "amount" }, + ] + })); + + createModal.onResult(function () { + dataTable.ajax.reload(); + }); + + editModal.onResult(function () { + dataTable.ajax.reload(); + }); + + $('#NewTransactionButton').click(function (e) { + e.preventDefault(); + createModal.open(); + }); +}); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs index 85c543a5..00f46bda 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs @@ -1,6 +1,9 @@ using EasyAbp.EShop.Stores.Stores.Dtos; using AutoMapper; +using EasyAbp.EShop.Stores.Transactions.Dtos; +using EasyAbp.EShop.Stores.Transactions.Dtos; using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels; +using EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Transactions.Transaction.ViewModels; namespace EasyAbp.EShop.Stores.Web { @@ -13,6 +16,9 @@ namespace EasyAbp.EShop.Stores.Web * into multiple profile classes for a better organization. */ CreateMap(); CreateMap(); + CreateMap(); + CreateMap(); + CreateMap(); } } } diff --git a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Application.Tests/Transactions/TransactionAppServiceTests.cs b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Application.Tests/Transactions/TransactionAppServiceTests.cs new file mode 100644 index 00000000..e78a387c --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Application.Tests/Transactions/TransactionAppServiceTests.cs @@ -0,0 +1,26 @@ +using Shouldly; +using System.Threading.Tasks; +using Xunit; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class TransactionAppServiceTests : StoresApplicationTestBase + { + private readonly ITransactionAppService _transactionAppService; + + public TransactionAppServiceTests() + { + _transactionAppService = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Act + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Domain.Tests/Transactions/TransactionDomainTests.cs b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Domain.Tests/Transactions/TransactionDomainTests.cs new file mode 100644 index 00000000..f1be21ae --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.Domain.Tests/Transactions/TransactionDomainTests.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using Shouldly; +using Xunit; + +namespace EasyAbp.EShop.Stores.Transactions +{ + public class TransactionDomainTests : StoresDomainTestBase + { + public TransactionDomainTests() + { + } + + [Fact] + public async Task Test1() + { + // Arrange + + // Assert + + // Assert + } + } +} diff --git a/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.EntityFrameworkCore.Tests/EntityFrameworkCore/Transactions/TransactionRepositoryTests.cs b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.EntityFrameworkCore.Tests/EntityFrameworkCore/Transactions/TransactionRepositoryTests.cs new file mode 100644 index 00000000..00fda02f --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/test/EasyAbp.EShop.Stores.EntityFrameworkCore.Tests/EntityFrameworkCore/Transactions/TransactionRepositoryTests.cs @@ -0,0 +1,31 @@ +using System; +using System.Threading.Tasks; +using EasyAbp.EShop.Stores.Transactions; +using Volo.Abp.Domain.Repositories; +using Xunit; + +namespace EasyAbp.EShop.Stores.EntityFrameworkCore.Transactions +{ + public class TransactionRepositoryTests : StoresEntityFrameworkCoreTestBase + { + private readonly ITransactionRepository _transactionRepository; + + public TransactionRepositoryTests() + { + _transactionRepository = GetRequiredService(); + } + + [Fact] + public async Task Test1() + { + await WithUnitOfWorkAsync(async () => + { + // Arrange + + // Act + + //Assert + }); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json index 177021b7..a7509d7e 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json +++ b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/appsettings.json @@ -1,7 +1,6 @@ { "ConnectionStrings": { - "Default": "Server=60.208.32.153;Database=fenghui01test;User Id=fenghui01test;Password=WYSytJdMORYnhTYmvf;Trusted_Connection=True;Integrated Security=false" - + "Default": "Server=(LocalDb)\\MSSQLLocalDB;Database=EShopSample;Trusted_Connection=True;MultipleActiveResultSets=true" }, "IdentityServer": { "Clients": { diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.Designer.cs new file mode 100644 index 00000000..e0a03f0e --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.Designer.cs @@ -0,0 +1,4225 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200831094628_AddedTransactionEntityToStoresModule")] + partial class AddedTransactionEntityToStoresModule + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MultiTenancySide") + .HasColumnType("int"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductTypes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(18,2)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.cs new file mode 100644 index 00000000..37ab37aa --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831094628_AddedTransactionEntityToStoresModule.cs @@ -0,0 +1,39 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class AddedTransactionEntityToStoresModule : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "EasyAbpEShopStoresTransactions", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 40, nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + TenantId = table.Column(nullable: true), + StoreId = table.Column(nullable: false), + OrderId = table.Column(nullable: true), + TransactionType = table.Column(nullable: false), + ActionName = table.Column(nullable: true), + Currency = table.Column(nullable: true), + Amount = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpEShopStoresTransactions", x => x.Id); + }); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpEShopStoresTransactions"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.Designer.cs new file mode 100644 index 00000000..17e9722a --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.Designer.cs @@ -0,0 +1,4225 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200831101341_ConfiguredHasColumnTypeForTransaction")] + partial class ConfiguredHasColumnTypeForTransaction + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MultiTenancySide") + .HasColumnType("int"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductTypes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.cs new file mode 100644 index 00000000..06a6b144 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831101341_ConfiguredHasColumnTypeForTransaction.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class ConfiguredHasColumnTypeForTransaction : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Amount", + table: "EasyAbpEShopStoresTransactions", + type: "decimal(20,8)", + nullable: false, + oldClrType: typeof(decimal), + oldType: "decimal(18,2)"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "Amount", + table: "EasyAbpEShopStoresTransactions", + type: "decimal(18,2)", + nullable: false, + oldClrType: typeof(decimal), + oldType: "decimal(20,8)"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index a807c2fa..d88cb512 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -1498,6 +1498,57 @@ namespace EShopSample.Migrations b.ToTable("EasyAbpEShopStoresStores"); }); + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => { b.Property("Id") From 589dd11c5666bf382ee3d914e3d02d9973ce8945 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 31 Aug 2020 20:26:33 +0800 Subject: [PATCH 17/24] Add Order.ActualTotalPrice and OrderLine.ActualTotalPrice Close #94 --- .../EShop/Orders/Orders/Dtos/OrderDto.cs | 2 + .../EShop/Orders/Orders/Dtos/OrderLineDto.cs | 2 + .../EShop/Orders/Orders/NewOrderGenerator.cs | 9 +- .../EShop/Orders/Localization/Orders/cs.json | 2 + .../EShop/Orders/Localization/Orders/en.json | 2 + .../EShop/Orders/Localization/Orders/pl.json | 2 + .../Orders/Localization/Orders/pt-BR.json | 2 + .../EShop/Orders/Localization/Orders/sl.json | 2 + .../EShop/Orders/Localization/Orders/tr.json | 2 + .../EShop/Orders/Localization/Orders/vi.json | 2 + .../Orders/Localization/Orders/zh-Hans.json | 2 + .../Orders/Localization/Orders/zh-Hant.json | 2 + .../EasyAbp/EShop/Orders/Orders/IOrder.cs | 5 + .../EasyAbp/EShop/Orders/Orders/IOrderLine.cs | 5 + .../EasyAbp/EShop/Orders/Orders/OrderEto.cs | 2 + .../EShop/Orders/Orders/OrderLineEto.cs | 2 + .../EasyAbp/EShop/Orders/Orders/Order.cs | 4 + .../EasyAbp/EShop/Orders/Orders/OrderLine.cs | 4 + .../Orders/Orders/OrderPaymentChecker.cs | 2 +- .../OrdersDbContextModelCreatingExtensions.cs | 2 + .../Payments/Payments/PaymentAppService.cs | 2 +- .../OrderCompletedEventHandler.cs | 2 +- ...otalPricePropertyToOrderEntity.Designer.cs | 4231 +++++++++++++++++ ...edActualTotalPricePropertyToOrderEntity.cs | 35 + ...pSampleMigrationsDbContextModelSnapshot.cs | 6 + 25 files changed, 4328 insertions(+), 5 deletions(-) create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs index 5ac8509b..bd5a0e9b 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderDto.cs @@ -21,6 +21,8 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos public decimal TotalDiscount { get; set; } public decimal TotalPrice { get; set; } + + public decimal ActualTotalPrice { get; set; } public decimal RefundAmount { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs index cf317ec2..1dd2f420 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs @@ -32,6 +32,8 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos public decimal TotalPrice { get; set; } public decimal TotalDiscount { get; set; } + + public decimal ActualTotalPrice { get; set; } public int Quantity { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index 908928d3..caab6ac2 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -51,6 +51,7 @@ namespace EasyAbp.EShop.Orders.Orders // Todo: totalPrice may contain other fee. var totalPrice = productTotalPrice; + var totalDiscount = orderLines.Select(x => x.TotalDiscount).Sum(); var order = new Order( id: _guidGenerator.Create(), @@ -59,8 +60,9 @@ namespace EasyAbp.EShop.Orders.Orders customerUserId: _currentUser.GetId(), currency: await GetStoreCurrencyAsync(input.StoreId), productTotalPrice: productTotalPrice, - totalDiscount: orderLines.Select(x => x.TotalDiscount).Sum(), + totalDiscount: totalDiscount, totalPrice: totalPrice, + actualTotalPrice: totalPrice - totalDiscount, customerRemark: input.CustomerRemark); foreach (var orderExtraProperty in orderExtraProperties) @@ -84,6 +86,8 @@ namespace EasyAbp.EShop.Orders.Orders { throw new OrderLineInvalidQuantityException(product.Id, productSku.Id, input.Quantity); } + + var totalPrice = productSku.Price * input.Quantity; return new OrderLine( id: _guidGenerator.Create(), @@ -99,8 +103,9 @@ namespace EasyAbp.EShop.Orders.Orders mediaResources: product.MediaResources, currency: productSku.Currency, unitPrice: productSku.Price, - totalPrice: productSku.Price * input.Quantity, + totalPrice: totalPrice, totalDiscount: 0, + actualTotalPrice: totalPrice, quantity: input.Quantity ); } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json index 38c6c36e..764d8aaf 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json @@ -11,6 +11,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -34,6 +35,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json index 5fb7e20f..14c573cf 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json @@ -12,6 +12,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -35,6 +36,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json index 8445fc3c..9c797fce 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json @@ -11,6 +11,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -34,6 +35,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json index d2485504..2eae48db 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json @@ -11,6 +11,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -34,6 +35,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json index 78dff42c..187a09b2 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json @@ -12,6 +12,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -35,6 +36,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json index e1702c86..120a9e66 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json @@ -12,6 +12,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -35,6 +36,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json index d60adad5..4b01d58d 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json @@ -11,6 +11,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -34,6 +35,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json index 42ecd28a..417a738c 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json @@ -12,6 +12,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -35,6 +36,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json index 35195c8e..bc5b579e 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json @@ -12,6 +12,7 @@ "OrderProductTotalPrice": "OrderProductTotalPrice", "OrderTotalDiscount": "OrderTotalDiscount", "OrderTotalPrice": "OrderTotalPrice", + "OrderActualTotalPrice": "OrderActualTotalPrice", "OrderRefundedAmount": "OrderRefundedAmount", "OrderCustomerRemark": "OrderCustomerRemark", "OrderStaffRemark": "OrderStaffRemark", @@ -35,6 +36,7 @@ "OrderLineUnitPrice": "OrderLineUnitPrice", "OrderLineTotalPrice": "OrderLineTotalPrice", "OrderLineTotalDiscount": "OrderLineTotalDiscount", + "OrderLineActualTotalPrice": "OrderLineActualTotalPrice", "OrderLineQuantity": "OrderLineQuantity", "CreateOrder": "CreateOrder", "EditOrder": "EditOrder", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs index 05a767ed..fa33d915 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrder.cs @@ -18,6 +18,11 @@ namespace EasyAbp.EShop.Orders.Orders decimal TotalDiscount { get; } decimal TotalPrice { get; } + + /// + /// ActualTotalPrice = TotalPrice - TotalDiscount + /// + decimal ActualTotalPrice { get; } decimal RefundAmount { get; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs index ae6003e3..a7e172fb 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs @@ -31,6 +31,11 @@ namespace EasyAbp.EShop.Orders.Orders decimal TotalPrice { get; } decimal TotalDiscount { get; } + + /// + /// ActualTotalPrice = TotalPrice - TotalDiscount + /// + decimal ActualTotalPrice { get; } int Quantity { get; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs index c4e7b7a1..fcfbc91c 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderEto.cs @@ -27,6 +27,8 @@ namespace EasyAbp.EShop.Orders.Orders public decimal TotalPrice { get; set; } + public decimal ActualTotalPrice { get; set; } + public decimal RefundAmount { get; set; } public string CustomerRemark { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs index 08fa4f23..22f8521c 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs @@ -34,6 +34,8 @@ namespace EasyAbp.EShop.Orders.Orders public decimal TotalPrice { get; set; } public decimal TotalDiscount { get; set; } + + public decimal ActualTotalPrice { get; set; } public int Quantity { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs index e4433ef1..ef8d5df2 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/Order.cs @@ -28,6 +28,8 @@ namespace EasyAbp.EShop.Orders.Orders public virtual decimal TotalDiscount { get; protected set; } public virtual decimal TotalPrice { get; protected set; } + + public virtual decimal ActualTotalPrice { get; protected set; } public virtual decimal RefundAmount { get; protected set; } @@ -67,6 +69,7 @@ namespace EasyAbp.EShop.Orders.Orders decimal productTotalPrice, decimal totalDiscount, decimal totalPrice, + decimal actualTotalPrice, [CanBeNull] string customerRemark ) : base(id) { @@ -77,6 +80,7 @@ namespace EasyAbp.EShop.Orders.Orders ProductTotalPrice = productTotalPrice; TotalDiscount = totalDiscount; TotalPrice = totalPrice; + ActualTotalPrice = actualTotalPrice; CustomerRemark = customerRemark; RefundAmount = 0; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs index 4a91c711..2ba7d8fc 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs @@ -40,6 +40,8 @@ namespace EasyAbp.EShop.Orders.Orders public virtual decimal TotalPrice { get; protected set; } public virtual decimal TotalDiscount { get; protected set; } + + public virtual decimal ActualTotalPrice { get; protected set; } public virtual int Quantity { get; protected set; } @@ -65,6 +67,7 @@ namespace EasyAbp.EShop.Orders.Orders decimal unitPrice, decimal totalPrice, decimal totalDiscount, + decimal actualTotalPrice, int quantity) : base(id) { ProductId = productId; @@ -81,6 +84,7 @@ namespace EasyAbp.EShop.Orders.Orders UnitPrice = unitPrice; TotalPrice = totalPrice; TotalDiscount = totalDiscount; + ActualTotalPrice = actualTotalPrice; Quantity = quantity; RefundedQuantity = 0; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs index 7b4a18b1..a748a452 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderPaymentChecker.cs @@ -24,7 +24,7 @@ namespace EasyAbp.EShop.Orders.Orders protected virtual Task IsPaymentPriceCorrectAsync(Order order, EShopPaymentItemEto paymentItem) { - return Task.FromResult(order.TotalPrice == paymentItem.OriginalPaymentAmount); + return Task.FromResult(order.ActualTotalPrice == paymentItem.OriginalPaymentAmount); } protected virtual Task IsUserAllowedToPayAsync(Order order, EShopPaymentEto payment) diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs index 7e25df40..914e4355 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.EntityFrameworkCore/EasyAbp/EShop/Orders/EntityFrameworkCore/OrdersDbContextModelCreatingExtensions.cs @@ -49,6 +49,7 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore b.Property(x => x.ProductTotalPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.TotalPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.TotalDiscount).HasColumnType("decimal(20,8)"); + b.Property(x => x.ActualTotalPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)"); b.HasIndex(x => x.OrderNumber).IsUnique(); }); @@ -60,6 +61,7 @@ namespace EasyAbp.EShop.Orders.EntityFrameworkCore /* Configure more properties here */ b.Property(x => x.TotalPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.TotalDiscount).HasColumnType("decimal(20,8)"); + b.Property(x => x.ActualTotalPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.UnitPrice).HasColumnType("decimal(20,8)"); b.Property(x => x.RefundAmount).HasColumnType("decimal(20,8)"); }); diff --git a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs index 1522583c..f84918ca 100644 --- a/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs +++ b/modules/EasyAbp.EShop.Payments/src/EasyAbp.EShop.Payments.Application/EasyAbp/EShop/Payments/Payments/PaymentAppService.cs @@ -100,7 +100,7 @@ namespace EasyAbp.EShop.Payments.Payments { ItemType = PaymentsConsts.PaymentItemType, ItemKey = order.Id.ToString(), - OriginalPaymentAmount = order.TotalPrice, + OriginalPaymentAmount = order.ActualTotalPrice, ExtraProperties = new Dictionary {{"StoreId", order.StoreId.ToString()}} }).ToList() }; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs index 8c3d2415..74a57b75 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderCompletedEventHandler.cs @@ -33,7 +33,7 @@ namespace EasyAbp.EShop.Stores.Transactions var transaction = new Transaction(_guidGenerator.Create(), order.TenantId, order.StoreId, order.Id, TransactionType.Debit, StoresConsts.TransactionOrderCompletedActionName, order.Currency, - order.TotalPrice); + order.ActualTotalPrice); await _transactionRepository.InsertAsync(transaction, true); } diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.Designer.cs new file mode 100644 index 00000000..972d071a --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.Designer.cs @@ -0,0 +1,4231 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200831122106_AddedActualTotalPricePropertyToOrderEntity")] + partial class AddedActualTotalPricePropertyToOrderEntity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MultiTenancySide") + .HasColumnType("int"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductTypes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.cs new file mode 100644 index 00000000..9825f20e --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200831122106_AddedActualTotalPricePropertyToOrderEntity.cs @@ -0,0 +1,35 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class AddedActualTotalPricePropertyToOrderEntity : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "ActualTotalPrice", + table: "EasyAbpEShopOrdersOrders", + type: "decimal(20,8)", + nullable: false, + defaultValue: 0m); + + migrationBuilder.AddColumn( + name: "ActualTotalPrice", + table: "EasyAbpEShopOrdersOrderLines", + type: "decimal(20,8)", + nullable: false, + defaultValue: 0m); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ActualTotalPrice", + table: "EasyAbpEShopOrdersOrders"); + + migrationBuilder.DropColumn( + name: "ActualTotalPrice", + table: "EasyAbpEShopOrdersOrderLines"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index d88cb512..f70c3acf 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -27,6 +27,9 @@ namespace EShopSample.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + b.Property("CanceledTime") .HasColumnType("datetime2"); @@ -140,6 +143,9 @@ namespace EShopSample.Migrations .ValueGeneratedOnAdd() .HasColumnType("uniqueidentifier"); + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + b.Property("CreationTime") .HasColumnName("CreationTime") .HasColumnType("datetime2"); From 8bfad549f4e762d89293e4856000bba751d3d1dc Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Mon, 31 Aug 2020 20:37:51 +0800 Subject: [PATCH 18/24] Record the transaction only if the order is completed. --- .../EShop/Stores/Transactions/OrderRefundedEventHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs index c6821cbe..d08c577c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain/EasyAbp/EShop/Stores/Transactions/OrderRefundedEventHandler.cs @@ -29,6 +29,12 @@ namespace EasyAbp.EShop.Stores.Transactions { var order = eventData.Order; var refund = eventData.Refund; + + // Record the transaction only if the order is completed. + if (!order.CompletionTime.HasValue) + { + return; + } using var changeTenant = _currentTenant.Change(order.TenantId); From fc21c494322f9b1d84900b721a56a4dea60487f1 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Tue, 1 Sep 2020 10:39:17 +0800 Subject: [PATCH 19/24] fix store related extension method naming, add crossStoreAllowed to base method --- .../StoreOwnerAuthorizationExtensions.cs | 6 +++--- .../MultiStoreAbstractKeyCrudAppService.cs | 17 +++++++++++++++-- .../MultiStoreAbstractKeyReadOnlyAppService.cs | 17 +++++++++++++++-- 3 files changed, 33 insertions(+), 7 deletions(-) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs index 68d32932..45816d5d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs @@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Stores.Permissions { public static class StoreOwnerAuthorizationExtensions { - public static Task IsCurrentUserStoreOwnerAsync(this IAuthorizationService authorizationService, + public static Task IsCurrentUserGrantedAsync(this IAuthorizationService authorizationService, Guid storeId, string policyName = null, object resource = null) { return authorizationService.IsGrantedAsync(resource, @@ -16,7 +16,7 @@ namespace EasyAbp.EShop.Stores.Permissions public static async Task IsMultiStoreGrantedAsync(this IAuthorizationService authorizationService, Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) { - if (storeId.HasValue && await authorizationService.IsCurrentUserStoreOwnerAsync(storeId.Value, policyName)) + if (storeId.HasValue && await authorizationService.IsCurrentUserGrantedAsync(storeId.Value, policyName)) { return true; } @@ -35,7 +35,7 @@ namespace EasyAbp.EShop.Stores.Permissions public static async Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) { - if (storeId.HasValue && await authorizationService.IsCurrentUserStoreOwnerAsync(storeId.Value, policyName, resource)) + if (storeId.HasValue && await authorizationService.IsCurrentUserGrantedAsync(storeId.Value, policyName, resource)) { return; } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs index 90e8b5d5..94350693 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using EasyAbp.EShop.Stores.Permissions; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Authorization; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; @@ -110,9 +111,21 @@ namespace EasyAbp.EShop.Stores.Stores } - protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) + protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName, bool crossStoreAllowed = true) { - await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); + if (crossStoreAllowed) + { + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); + } + else + { + if (!storeId.HasValue) + { + throw new AbpAuthorizationException("Authorization failed! StoreId can not be null!"); + } + + await AuthorizationService.CheckMultiStorePolicyAsync(storeId.Value, policyName); + } } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs index 73a986f1..fa759510 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using EasyAbp.EShop.Stores.Permissions; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; +using Volo.Abp.Authorization; using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Repositories; @@ -50,9 +51,21 @@ namespace EasyAbp.EShop.Stores.Stores return MapToGetOutputDto(entity); } - protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName) + protected virtual async Task CheckMultiStorePolicyAsync(Guid? storeId, string policyName, bool crossStoreAllowed = true) { - await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); + if (crossStoreAllowed) + { + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, policyName, CrossStorePolicyName); + } + else + { + if (!storeId.HasValue) + { + throw new AbpAuthorizationException("Authorization failed! StoreId can not be null!"); + } + + await AuthorizationService.CheckMultiStorePolicyAsync(storeId.Value, policyName); + } } } } \ No newline at end of file From 7c786f8321864b463cb081594badbcb6d46e8f91 Mon Sep 17 00:00:00 2001 From: RayMMond Date: Tue, 1 Sep 2020 11:10:34 +0800 Subject: [PATCH 20/24] fix samples build error. --- .../EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj | 2 +- .../src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj index 51f8c0f3..28ad74ee 100644 --- a/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj +++ b/plugins/Baskets/src/EasyAbp.EShop.Plugins.Baskets.Domain.Shared/EasyAbp.EShop.Plugins.Baskets.Domain.Shared.csproj @@ -13,7 +13,7 @@ - + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj index 215f4e96..ee7e9cae 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.DbMigrator/EShopSample.DbMigrator.csproj @@ -19,7 +19,7 @@ - + From 9efc63fa24035e39fd94e4f7832a391c4e1f71d2 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 1 Sep 2020 17:11:53 +0800 Subject: [PATCH 21/24] Complete changes of store owner --- EShop.sln | 7 + .../Orders/EShopOrdersApplicationModule.cs | 1 + .../EShop/Orders/Orders/OrderAppService.cs | 2 +- .../OrdersApplicationAutoMapperProfile.cs | 3 +- .../OrdersWebAutoMapperProfile.cs | 3 - .../Products/Categories/CategoryAppService.cs | 2 +- .../EShopProductsApplicationModule.cs | 1 + .../ProductInventoryAppService.cs | 30 +- .../Products/Products/ProductAppService.cs | 23 +- .../Dtos/CreateUpdateStoreOwnerDto.cs | 15 + .../Stores/StoreOwners/Dtos/StoreOwnerDto.cs | 2 - .../StoreOwners/IStoreOwnerAppService.cs | 4 +- .../Stores/Dtos/CreateUpdateStoreDto.cs | 2 +- ...asicStorePermissionAuthorizationHandler.cs | 8 +- .../EShop/Stores/Authorization/StoreInfo.cs | 9 + .../StoreOwnerAuthorizationExtensions.cs | 28 +- ...StorePermissionAuthorizationRequirement.cs | 7 +- .../EShopStoresApplicationSharedModule.cs | 2 +- .../MultiStoreAbstractKeyCrudAppService.cs | 2 +- ...MultiStoreAbstractKeyReadOnlyAppService.cs | 2 +- .../Stores/EShopStoresApplicationModule.cs | 1 + .../StoreOwners/StoreOwnerAppService.cs | 4 +- .../StoresApplicationAutoMapperProfile.cs | 13 +- .../EShop/Stores/Localization/Stores/cs.json | 2 +- .../EShop/Stores/Localization/Stores/en.json | 2 +- .../EShop/Stores/Localization/Stores/pl.json | 2 +- .../Stores/Localization/Stores/pt-BR.json | 2 +- .../EShop/Stores/Localization/Stores/sl.json | 2 +- .../EShop/Stores/Localization/Stores/tr.json | 2 +- .../EShop/Stores/Localization/Stores/vi.json | 2 +- .../Stores/Localization/Stores/zh-Hans.json | 2 +- .../Stores/Localization/Stores/zh-Hant.json | 3 +- .../StoreOwners/StoreOwnerController.cs | 4 +- .../StoreOwner/CreateModal.cshtml.cs | 2 +- .../StoreOwner/EditModal.cshtml.cs | 2 +- .../ViewModels/CreateStoreOwnerViewModel.cs | 4 +- .../ViewModels/CreateEditStoreViewModel.cs | 2 +- .../StoresWebAutoMapperProfile.cs | 14 +- ...01080859_AddedStoreOwnerEntity.Designer.cs | 4295 +++++++++++++++++ .../20200901080859_AddedStoreOwnerEntity.cs | 46 + ...pSampleMigrationsDbContextModelSnapshot.cs | 64 + 41 files changed, 4527 insertions(+), 96 deletions(-) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/CreateUpdateStoreOwnerDto.cs rename modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/{Permissions => Authorization}/BasicStorePermissionAuthorizationHandler.cs (88%) create mode 100644 modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreInfo.cs rename modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/{Permissions => Authorization}/StoreOwnerAuthorizationExtensions.cs (57%) rename modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/{Permissions => Authorization}/StorePermissionAuthorizationRequirement.cs (55%) create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.cs diff --git a/EShop.sln b/EShop.sln index 4ea46fa2..a290599a 100644 --- a/EShop.sln +++ b/EShop.sln @@ -305,6 +305,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{D261 EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "EShopSample", "EShopSample", "{FE0A5FD6-AEE7-4738-9A6D-261BF086704D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Stores.Application.Shared", "modules\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Shared\EasyAbp.EShop.Stores.Application.Shared.csproj", "{06700175-4E04-4993-A1FB-24E7A8835E19}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -795,6 +797,10 @@ Global {5929D955-4E2C-4E84-B9D7-F32A3375A1AA}.Debug|Any CPU.Build.0 = Debug|Any CPU {5929D955-4E2C-4E84-B9D7-F32A3375A1AA}.Release|Any CPU.ActiveCfg = Release|Any CPU {5929D955-4E2C-4E84-B9D7-F32A3375A1AA}.Release|Any CPU.Build.0 = Release|Any CPU + {06700175-4E04-4993-A1FB-24E7A8835E19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06700175-4E04-4993-A1FB-24E7A8835E19}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06700175-4E04-4993-A1FB-24E7A8835E19}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06700175-4E04-4993-A1FB-24E7A8835E19}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -947,6 +953,7 @@ Global {F5CD8112-382D-42AC-9D91-46B91D64FACB} = {9333EF8D-0A21-4586-81EB-9C39ECA2873C} {5929D955-4E2C-4E84-B9D7-F32A3375A1AA} = {9333EF8D-0A21-4586-81EB-9C39ECA2873C} {FE0A5FD6-AEE7-4738-9A6D-261BF086704D} = {D261DC47-83D7-4B7C-941E-E27291C78A52} + {06700175-4E04-4993-A1FB-24E7A8835E19} = {8CB54A0E-BAAE-4D10-81B5-6F902A7950EB} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs index 6bc4e6eb..44915df7 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/EShopOrdersApplicationModule.cs @@ -12,6 +12,7 @@ namespace EasyAbp.EShop.Orders typeof(EShopOrdersApplicationContractsModule), typeof(EShopProductsApplicationContractsModule), typeof(EShopStoresDomainSharedModule), + typeof(EShopStoresApplicationSharedModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) )] diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs index cff9a03b..99019794 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/OrderAppService.cs @@ -6,7 +6,7 @@ using EasyAbp.EShop.Orders.Authorization; using EasyAbp.EShop.Orders.Orders.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using EasyAbp.EShop.Stores.Stores; using Microsoft.AspNetCore.Authorization; using Volo.Abp; diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs index bf0c9484..b04355ad 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/OrdersApplicationAutoMapperProfile.cs @@ -12,8 +12,7 @@ namespace EasyAbp.EShop.Orders /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(); CreateMap(); } } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs index 9da94e9d..91d84b9e 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Web/OrdersWebAutoMapperProfile.cs @@ -11,9 +11,6 @@ namespace EasyAbp.EShop.Orders.Web /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(); } } } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs index 11b246a1..6327d724 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Categories/CategoryAppService.cs @@ -3,7 +3,7 @@ using System.Linq; using System.Threading.Tasks; using EasyAbp.EShop.Products.Categories.Dtos; using EasyAbp.EShop.Products.Permissions; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using Microsoft.AspNetCore.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs index 8bd0ba3e..c9479ec1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/EShopProductsApplicationModule.cs @@ -11,6 +11,7 @@ namespace EasyAbp.EShop.Products typeof(EShopProductsDomainModule), typeof(EShopProductsApplicationContractsModule), typeof(EShopStoresDomainSharedModule), + typeof(EShopStoresApplicationSharedModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule), typeof(AbpTreesApplicationModule) diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs index eafa8c4f..a8573489 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductInventories/ProductInventoryAppService.cs @@ -2,7 +2,7 @@ using EasyAbp.EShop.Products.Permissions; using EasyAbp.EShop.Products.ProductInventories.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.ProductStores; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using Microsoft.AspNetCore.Authorization; using System; using System.Threading.Tasks; @@ -42,22 +42,16 @@ namespace EasyAbp.EShop.Products.ProductInventories return ObjectMapper.Map(productInventory); } - [Authorize(ProductsPermissions.ProductInventory.Update)] public virtual async Task UpdateAsync(UpdateProductInventoryDto input) { - if (!await AuthorizationService.IsGrantedAsync(ProductsPermissions.ProductInventory.CrossStore)) - { - if (!input.StoreId.HasValue) - { - throw new AbpValidationException("StoreId should not be null."); - } + await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId, + ProductsPermissions.ProductInventory.Update, ProductsPermissions.ProductInventory.CrossStore); - await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId.Value, - ProductsPermissions.ProductInventory.Update); - - await _productStoreRepository.GetAsync(input.ProductId, input.StoreId.Value); + if (input.StoreId.HasValue) + { + await CheckStoreIsProductOwnerAsync(input.ProductId, input.StoreId.Value); } - + var productInventory = await _repository.FindAsync(x => x.ProductSkuId == input.ProductSkuId); if (productInventory == null) @@ -72,6 +66,16 @@ namespace EasyAbp.EShop.Products.ProductInventories return ObjectMapper.Map(productInventory); } + + protected virtual async Task CheckStoreIsProductOwnerAsync(Guid productId, Guid storeId) + { + var productStore = await _productStoreRepository.GetAsync(productId, storeId); + + if (!productStore.IsOwner) + { + throw new StoreIsNotProductOwnerException(productId, storeId); + } + } protected virtual async Task ChangeInventoryAsync(ProductInventory productInventory, int changedInventory) { diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index 76782927..9504331c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -2,7 +2,7 @@ using EasyAbp.EShop.Products.Permissions; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Products.ProductStores; using EasyAbp.EShop.Products.ProductTypes; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using System; using System.Collections.Generic; using System.Linq; @@ -25,7 +25,6 @@ namespace EasyAbp.EShop.Products.Products protected override string GetListPolicyName { get; set; } = null; private readonly IProductManager _productManager; - private readonly IProductPriceProvider _productPriceProvider; private readonly IProductInventoryProvider _productInventoryProvider; private readonly IAttributeOptionIdsSerializer _attributeOptionIdsSerializer; private readonly IProductStoreRepository _productStoreRepository; @@ -34,7 +33,6 @@ namespace EasyAbp.EShop.Products.Products public ProductAppService( IProductManager productManager, - IProductPriceProvider productPriceProvider, IProductInventoryProvider productInventoryProvider, IAttributeOptionIdsSerializer attributeOptionIdsSerializer, IProductStoreRepository productStoreRepository, @@ -42,7 +40,6 @@ namespace EasyAbp.EShop.Products.Products IProductRepository repository) : base(repository) { _productManager = productManager; - _productPriceProvider = productPriceProvider; _productInventoryProvider = productInventoryProvider; _attributeOptionIdsSerializer = attributeOptionIdsSerializer; _productStoreRepository = productStoreRepository; @@ -66,7 +63,8 @@ namespace EasyAbp.EShop.Products.Products public override async Task CreateAsync(CreateUpdateProductDto input) { - await CheckCreatePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName, + ProductsPermissions.Products.CrossStore); var product = MapToEntity(input); @@ -86,7 +84,8 @@ namespace EasyAbp.EShop.Products.Products public override async Task UpdateAsync(Guid id, CreateUpdateProductDto input) { - await CheckUpdatePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(input.StoreId, UpdatePolicyName, + ProductsPermissions.Products.CrossStore); await CheckStoreIsProductOwnerAsync(id, input.StoreId); @@ -347,7 +346,8 @@ namespace EasyAbp.EShop.Products.Products public async Task DeleteAsync(Guid id, Guid storeId) { - await CheckDeletePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, DeletePolicyName, + ProductsPermissions.Products.CrossStore); var product = await GetEntityByIdAsync(id); @@ -368,7 +368,8 @@ namespace EasyAbp.EShop.Products.Products public async Task CreateSkuAsync(Guid productId, Guid storeId, CreateProductSkuDto input) { - await CheckUpdatePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, UpdatePolicyName, + ProductsPermissions.Products.CrossStore); await CheckStoreIsProductOwnerAsync(productId, storeId); @@ -393,7 +394,8 @@ namespace EasyAbp.EShop.Products.Products public async Task UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, UpdateProductSkuDto input) { - await CheckUpdatePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, UpdatePolicyName, + ProductsPermissions.Products.CrossStore); await CheckStoreIsProductOwnerAsync(productId, storeId); @@ -417,7 +419,8 @@ namespace EasyAbp.EShop.Products.Products public async Task DeleteSkuAsync(Guid productId, Guid productSkuId, Guid storeId) { - await CheckUpdatePolicyAsync(); + await AuthorizationService.CheckMultiStorePolicyAsync(storeId, UpdatePolicyName, + ProductsPermissions.Products.CrossStore); await CheckStoreIsProductOwnerAsync(productId, storeId); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/CreateUpdateStoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/CreateUpdateStoreOwnerDto.cs new file mode 100644 index 00000000..cfb77860 --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/CreateUpdateStoreOwnerDto.cs @@ -0,0 +1,15 @@ +using System; +using System.ComponentModel.DataAnnotations; +using EasyAbp.EShop.Stores.Stores; + +namespace EasyAbp.EShop.Stores.StoreOwners.Dtos +{ + public class CreateUpdateStoreOwnerDto : IMultiStore + { + [Required] + public Guid StoreId { get; set; } + + [Required] + public Guid OwnerUserId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs index ec66d309..43cb6a6e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/Dtos/StoreOwnerDto.cs @@ -7,10 +7,8 @@ namespace EasyAbp.EShop.Stores.StoreOwners.Dtos { public class StoreOwnerDto : ExtensibleFullAuditedEntityDto, IMultiStore { - [Required] public Guid StoreId { get; set; } - [Required] public Guid OwnerUserId { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs index 48c2f740..4b672c3d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/StoreOwners/IStoreOwnerAppService.cs @@ -9,7 +9,9 @@ namespace EasyAbp.EShop.Stores.StoreOwners ICrudAppService< StoreOwnerDto, Guid, - GetStoreOwnerListDto> + GetStoreOwnerListDto, + CreateUpdateStoreOwnerDto, + CreateUpdateStoreOwnerDto> { } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs index c463f482..75b4e83c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Contracts/EasyAbp/EShop/Stores/Stores/Dtos/CreateUpdateStoreDto.cs @@ -6,7 +6,7 @@ using Volo.Abp.Application.Dtos; namespace EasyAbp.EShop.Stores.Stores.Dtos { - public class CreateUpdateStoreDto : ExtensibleEntityDto + public class CreateUpdateStoreDto { [Required] [DisplayName("StoreName")] diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/BasicStorePermissionAuthorizationHandler.cs similarity index 88% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/BasicStorePermissionAuthorizationHandler.cs index d1b52d89..10ce1831 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/BasicStorePermissionAuthorizationHandler.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/BasicStorePermissionAuthorizationHandler.cs @@ -5,9 +5,9 @@ using System.Security.Principal; using System.Threading.Tasks; using Volo.Abp.Authorization.Permissions; -namespace EasyAbp.EShop.Stores.Permissions +namespace EasyAbp.EShop.Stores.Authorization { - public class BasicStorePermissionAuthorizationHandler : AuthorizationHandler + public class BasicStorePermissionAuthorizationHandler : AuthorizationHandler { private readonly IStoreOwnerStore _storeOwnerStore; private readonly IPermissionChecker _permissionChecker; @@ -19,12 +19,12 @@ namespace EasyAbp.EShop.Stores.Permissions _permissionChecker = permissionChecker; } - protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, StorePermissionAuthorizationRequirement requirement) + protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, StorePermissionAuthorizationRequirement requirement, StoreInfo storeInfo) { var userId = context.User?.FindUserId(); if (userId.HasValue) { - var isStoreOwner = await _storeOwnerStore.IsStoreOwnerAsync(requirement.StoreId, userId.Value); + var isStoreOwner = await _storeOwnerStore.IsStoreOwnerAsync(storeInfo.StoreId, userId.Value); if (isStoreOwner) { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreInfo.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreInfo.cs new file mode 100644 index 00000000..4810786e --- /dev/null +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreInfo.cs @@ -0,0 +1,9 @@ +using System; + +namespace EasyAbp.EShop.Stores.Authorization +{ + public class StoreInfo + { + public Guid StoreId { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreOwnerAuthorizationExtensions.cs similarity index 57% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreOwnerAuthorizationExtensions.cs index 45816d5d..8b396a5e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StoreOwnerAuthorizationExtensions.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StoreOwnerAuthorizationExtensions.cs @@ -2,46 +2,46 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -namespace EasyAbp.EShop.Stores.Permissions +namespace EasyAbp.EShop.Stores.Authorization { public static class StoreOwnerAuthorizationExtensions { public static Task IsCurrentUserGrantedAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName = null, object resource = null) + Guid storeId, string policyName = null) { - return authorizationService.IsGrantedAsync(resource, - new StorePermissionAuthorizationRequirement(storeId, policyName)); + return authorizationService.IsGrantedAsync(new StoreInfo {StoreId = storeId}, + new StorePermissionAuthorizationRequirement(policyName)); } public static async Task IsMultiStoreGrantedAsync(this IAuthorizationService authorizationService, - Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) + Guid? storeId, string policyName, string crossStorePolicyName) { if (storeId.HasValue && await authorizationService.IsCurrentUserGrantedAsync(storeId.Value, policyName)) { return true; } - return await authorizationService.IsGrantedAsync(resource, crossStorePolicyName) - && await authorizationService.IsGrantedAsync(resource, policyName); + return await authorizationService.IsGrantedAsync(crossStorePolicyName) + && await authorizationService.IsGrantedAsync(policyName); } public static Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, - Guid storeId, string policyName, object resource = null) + Guid storeId, string policyName) { - return authorizationService.CheckAsync(resource, - new StorePermissionAuthorizationRequirement(storeId, policyName)); + return authorizationService.CheckAsync(new StoreInfo {StoreId = storeId}, + new StorePermissionAuthorizationRequirement(policyName)); } public static async Task CheckMultiStorePolicyAsync(this IAuthorizationService authorizationService, - Guid? storeId, string policyName, string crossStorePolicyName, object resource = null) + Guid? storeId, string policyName, string crossStorePolicyName) { - if (storeId.HasValue && await authorizationService.IsCurrentUserGrantedAsync(storeId.Value, policyName, resource)) + if (storeId.HasValue && await authorizationService.IsCurrentUserGrantedAsync(storeId.Value, policyName)) { return; } - await authorizationService.CheckAsync(resource, crossStorePolicyName); - await authorizationService.CheckAsync(resource, policyName); + await authorizationService.CheckAsync(crossStorePolicyName); + await authorizationService.CheckAsync(policyName); } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StorePermissionAuthorizationRequirement.cs similarity index 55% rename from modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs rename to modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StorePermissionAuthorizationRequirement.cs index bc3b087e..5a291732 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Permissions/StorePermissionAuthorizationRequirement.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Authorization/StorePermissionAuthorizationRequirement.cs @@ -1,18 +1,15 @@ using System; using Microsoft.AspNetCore.Authorization; -namespace EasyAbp.EShop.Stores.Permissions +namespace EasyAbp.EShop.Stores.Authorization { public class StorePermissionAuthorizationRequirement : IAuthorizationRequirement { - public StorePermissionAuthorizationRequirement(Guid storeId, string policyName = null) + public StorePermissionAuthorizationRequirement(string policyName = null) { - StoreId = storeId; PolicyName = policyName; } - public Guid StoreId { get; } - public string PolicyName { get; } } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs index 9d183e76..397a7ef4 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/EShopStoresApplicationSharedModule.cs @@ -1,4 +1,4 @@ -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Application; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs index 94350693..8ec6a156 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyCrudAppService.cs @@ -1,6 +1,6 @@ using System; using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Authorization; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs index fa759510..370bcb30 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application.Shared/EasyAbp/EShop/Stores/Stores/MultiStoreAbstractKeyReadOnlyAppService.cs @@ -1,6 +1,6 @@ using System; using System.Threading.Tasks; -using EasyAbp.EShop.Stores.Permissions; +using EasyAbp.EShop.Stores.Authorization; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Authorization; diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/EShopStoresApplicationModule.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/EShopStoresApplicationModule.cs index c4a68b07..347632d0 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/EShopStoresApplicationModule.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/EShopStoresApplicationModule.cs @@ -7,6 +7,7 @@ namespace EasyAbp.EShop.Stores { [DependsOn( typeof(EShopStoresDomainModule), + typeof(EShopStoresApplicationSharedModule), typeof(EShopStoresApplicationContractsModule), typeof(AbpDddApplicationModule), typeof(AbpAutoMapperModule) diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs index 2a20a109..270c0ae4 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerAppService.cs @@ -7,7 +7,7 @@ using EasyAbp.EShop.Stores.Stores; namespace EasyAbp.EShop.Stores.StoreOwners { - public class StoreOwnerAppService : MultiStoreCrudAppService, + public class StoreOwnerAppService : MultiStoreCrudAppService, IStoreOwnerAppService { protected override string CreatePolicyName { get; set; } = StoresPermissions.Stores.Manage; @@ -24,7 +24,7 @@ namespace EasyAbp.EShop.Stores.StoreOwners _repository = repository; } - public override async Task CreateAsync(StoreOwnerDto input) + public override async Task CreateAsync(CreateUpdateStoreOwnerDto input) { if (await _repository.IsExistAsync(input.StoreId, input.OwnerUserId)) { diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs index 19814477..f2221222 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Application/EasyAbp/EShop/Stores/StoresApplicationAutoMapperProfile.cs @@ -16,15 +16,12 @@ namespace EasyAbp.EShop.Stores /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(MemberList.Source) - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(); + CreateMap(MemberList.Source); - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(MemberList.Source) - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(); + CreateMap(MemberList.Source); + CreateMap(); CreateMap(MemberList.Source); } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json index 5d73d876..8e3d3719 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/cs.json @@ -12,7 +12,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json index 45286fc6..5bd65efe 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/en.json @@ -13,7 +13,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json index 07bf15b8..1ea8f23c 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pl.json @@ -12,7 +12,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json index 06980950..a059ffa6 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/pt-BR.json @@ -12,7 +12,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json index 3bcb4904..e6f1164d 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/sl.json @@ -13,7 +13,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json index c4b3c201..a82c757e 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/tr.json @@ -13,7 +13,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json index d1df3924..17a352e2 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/vi.json @@ -12,7 +12,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json index b2e55732..e2672ddd 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hans.json @@ -13,7 +13,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json index d3e14996..9ec52edd 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Domain.Shared/EasyAbp/EShop/Stores/Localization/Stores/zh-Hant.json @@ -13,8 +13,7 @@ "Menu:StoreOwner": "MenuStoreOwner", "CreateStoreOwner": "CreateStoreOwner", "EditStoreOwner": "EditStoreOwner", - "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?" - "SuccessfullyDeleted": "Successfully deleted", + "StoreOwnerDeletionConfirmationMessage": "Are you sure to delete the store owner {0}?", "Permission:Transaction": "Transaction", "Permission:Create": "Create", "Permission:Update": "Update", diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs index 74cc09af..66682a12 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.HttpApi/EasyAbp/EShop/Stores/StoreOwners/StoreOwnerController.cs @@ -32,14 +32,14 @@ namespace EasyAbp.EShop.Stores.StoreOwners } [HttpPost] - public Task CreateAsync(StoreOwnerDto input) + public Task CreateAsync(CreateUpdateStoreOwnerDto input) { return _service.CreateAsync(input); } [HttpPut] [Route("{id}")] - public Task UpdateAsync(Guid id, StoreOwnerDto input) + public Task UpdateAsync(Guid id, CreateUpdateStoreOwnerDto input) { return _service.UpdateAsync(id, input); } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs index a5cb4b62..558d5970 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/CreateModal.cshtml.cs @@ -25,7 +25,7 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner public async Task OnPostAsync() { - var createDto = ObjectMapper.Map(StoreOwner); + var createDto = ObjectMapper.Map(StoreOwner); var storeOwner = await _storeOwnerAppService.CreateAsync(createDto); return NoContent(); diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs index 78f39ffe..9bae6514 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/EditModal.cshtml.cs @@ -31,7 +31,7 @@ namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner public async Task OnPostAsync() { await _storeOwnerAppService.UpdateAsync(Id, - ObjectMapper.Map(StoreOwner)); + ObjectMapper.Map(StoreOwner)); return NoContent(); } } diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs index 7de5a3b2..134a41c2 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/StoreOwners/StoreOwner/ViewModels/CreateStoreOwnerViewModel.cs @@ -5,13 +5,13 @@ using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.StoreOwners.StoreOwner.ViewModels { - public class CreateEditStoreOwnerViewModel : ExtensibleObject + public class CreateEditStoreOwnerViewModel { [Required] public Guid StoreId { get; set; } [Required] - public Guid MultiStoreCrudAppService { get; set; } + public Guid OwnerUserId { get; set; } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs index 87dc5aa0..36f5e39b 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/Pages/EShop/Stores/Stores/Store/ViewModels/CreateEditStoreViewModel.cs @@ -6,7 +6,7 @@ using Volo.Abp.ObjectExtending; namespace EasyAbp.EShop.Stores.Web.Pages.EShop.Stores.Stores.Store.ViewModels { - public class CreateEditStoreViewModel : ExtensibleObject + public class CreateEditStoreViewModel { [Required] [Display(Name = "StoreName")] diff --git a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs index 2d17b06d..25c1f844 100644 --- a/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Stores/src/EasyAbp.EShop.Stores.Web/StoresWebAutoMapperProfile.cs @@ -17,16 +17,12 @@ namespace EasyAbp.EShop.Stores.Web /* You can configure your AutoMapper mapping configuration here. * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(MemberList.Source) - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); + CreateMap(); + CreateMap(MemberList.Source); + + CreateMap(); + CreateMap(MemberList.Source); - CreateMap() - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(MemberList.Source) - .MapExtraProperties(MappingPropertyDefinitionChecks.Both); - CreateMap(); CreateMap(); CreateMap(); } diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.Designer.cs new file mode 100644 index 00000000..62a2908f --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.Designer.cs @@ -0,0 +1,4295 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200901080859_AddedStoreOwnerEntity")] + partial class AddedStoreOwnerEntity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MultiTenancySide") + .HasColumnType("int"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductTypes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTypeId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.cs new file mode 100644 index 00000000..802f024c --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901080859_AddedStoreOwnerEntity.cs @@ -0,0 +1,46 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class AddedStoreOwnerEntity : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "EasyAbpEShopStoresStoreOwners", + columns: table => new + { + Id = table.Column(nullable: false), + ExtraProperties = table.Column(nullable: true), + ConcurrencyStamp = table.Column(maxLength: 40, nullable: true), + CreationTime = table.Column(nullable: false), + CreatorId = table.Column(nullable: true), + LastModificationTime = table.Column(nullable: true), + LastModifierId = table.Column(nullable: true), + IsDeleted = table.Column(nullable: false, defaultValue: false), + DeleterId = table.Column(nullable: true), + DeletionTime = table.Column(nullable: true), + TenantId = table.Column(nullable: true), + StoreId = table.Column(nullable: false), + OwnerUserId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpEShopStoresStoreOwners", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_EasyAbpEShopStoresStoreOwners_OwnerUserId_StoreId", + table: "EasyAbpEShopStoresStoreOwners", + columns: new[] { "OwnerUserId", "StoreId" }, + unique: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpEShopStoresStoreOwners"); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index f70c3acf..a6415681 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -1446,6 +1446,70 @@ namespace EShopSample.Migrations b.ToTable("EasyAbpEShopProductsProductSkus"); }); + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners"); + }); + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => { b.Property("Id") From 609b1cd04e7b83ff346761d5d10e19e834d0b37d Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 1 Sep 2020 17:17:56 +0800 Subject: [PATCH 22/24] Fix the routes in ProductController --- .../Products/Products/ProductController.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs index aa9bda8c..d9c36ecd 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs @@ -61,17 +61,17 @@ namespace EasyAbp.EShop.Products.Products } [HttpPost] - [Route("sku")] - public Task CreateSkuAsync(Guid productId, Guid storeId, CreateProductSkuDto input) + [Route("{id}/sku")] + public Task CreateSkuAsync(Guid id, Guid storeId, CreateProductSkuDto input) { - return _service.CreateSkuAsync(productId, storeId, input); + return _service.CreateSkuAsync(id, storeId, input); } [HttpPut] - [Route("sku")] - public Task UpdateSkuAsync(Guid productId, Guid productSkuId, Guid storeId, UpdateProductSkuDto input) + [Route("{id}/sku/{productSkuId}")] + public Task UpdateSkuAsync(Guid id, Guid productSkuId, Guid storeId, UpdateProductSkuDto input) { - return _service.UpdateSkuAsync(productId, productSkuId, storeId, input); + return _service.UpdateSkuAsync(id, productSkuId, storeId, input); } [HttpGet] @@ -89,10 +89,10 @@ namespace EasyAbp.EShop.Products.Products } [HttpDelete] - [Route("sku")] - public Task DeleteSkuAsync(Guid productId, Guid productSkuId, Guid storeId) + [Route("{id}/sku/{productSkuId}")] + public Task DeleteSkuAsync(Guid id, Guid productSkuId, Guid storeId) { - return _service.DeleteSkuAsync(productId, productSkuId, storeId); + return _service.DeleteSkuAsync(id, productSkuId, storeId); } } } \ No newline at end of file From 40cdc2fd7bddb4de79b3ab6a178effd0fee56c83 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 1 Sep 2020 20:01:15 +0800 Subject: [PATCH 23/24] Remove ProductType entity and introduce a hard-coded ProductGroup design. Resolve #82 --- .../EShop/Orders/Orders/Dtos/OrderLineDto.cs | 4 +- .../EShop/Orders/Orders/NewOrderGenerator.cs | 3 +- .../EShop/Orders/Localization/Orders/cs.json | 3 +- .../EShop/Orders/Localization/Orders/en.json | 3 +- .../EShop/Orders/Localization/Orders/pl.json | 3 +- .../Orders/Localization/Orders/pt-BR.json | 3 +- .../EShop/Orders/Localization/Orders/sl.json | 3 +- .../EShop/Orders/Localization/Orders/tr.json | 3 +- .../EShop/Orders/Localization/Orders/vi.json | 3 +- .../Orders/Localization/Orders/zh-Hans.json | 3 +- .../Orders/Localization/Orders/zh-Hant.json | 3 +- .../EasyAbp/EShop/Orders/Orders/IOrderLine.cs | 2 +- .../EShop/Orders/Orders/OrderLineEto.cs | 2 +- .../EasyAbp/EShop/Orders/Orders/OrderLine.cs | 11 +- .../ProductsPermissionDefinitionProvider.cs | 2 - .../Permissions/ProductsPermissions.cs | 5 - .../ProductTypes/Dtos/ProductTypeDto.cs | 17 - .../ProductTypes/IProductTypeAppService.cs | 16 - .../Products/Dtos/CreateUpdateProductDto.cs | 4 +- .../Products/Products/Dtos/ProductDto.cs | 4 +- .../Products/Products/Dtos/ProductGroupDto.cs | 14 + .../Products/Products/IProductAppService.cs | 3 + .../ProductTypes/ProductTypeAppService.cs | 22 - .../Products/Products/ProductAppService.cs | 47 +- .../ProductsApplicationAutoMapperProfile.cs | 5 +- .../Products/Localization/Products/cs.json | 12 +- .../Products/Localization/Products/en.json | 12 +- .../Products/Localization/Products/pl.json | 12 +- .../Products/Localization/Products/pt-BR.json | 12 +- .../Products/Localization/Products/sl.json | 12 +- .../Products/Localization/Products/tr.json | 12 +- .../Products/Localization/Products/vi.json | 12 +- .../Localization/Products/zh-Hans.json | 12 +- .../Localization/Products/zh-Hant.json | 12 +- .../EShop/Products/Products/IProduct.cs | 2 +- .../EShop/Products/Products/ProductEto.cs | 4 +- .../EasyAbp/EShop/Products/ProductsConsts.cs | 6 +- .../Products/EShopProductsDomainModule.cs | 11 + .../Products/Options/EShopProductsOptions.cs | 17 + .../ProductGroups/DefaultProductGroup.cs | 8 + .../Options/ProductGroups/IProductGroup.cs | 7 + .../IProductGroupConfigurationProvider.cs | 7 + .../ProductGroupConfiguration.cs | 9 + .../ProductGroupConfigurationProvider.cs | 20 + .../ProductGroupConfigurations.cs | 73 + .../ProductGroupNameAttribute.cs | 42 + .../ProductTypes/IProductTypeDataSeeder.cs | 10 - .../ProductTypes/IProductTypeRepository.cs | 9 - .../Products/ProductTypes/ProductType.cs | 38 - .../ProductTypes/ProductTypeDataSeeder.cs | 31 - .../NonexistentProductGroupException.cs | 14 + .../EShop/Products/Products/Product.cs | 7 +- .../EShop/Products/Products/ProductManager.cs | 28 +- .../Products/ProductsDataSeedContributor.cs | 24 - .../EShopProductsEntityFrameworkCoreModule.cs | 2 - .../EntityFrameworkCore/IProductsDbContext.cs | 2 - .../EntityFrameworkCore/ProductsDbContext.cs | 2 - ...roductsDbContextModelCreatingExtensions.cs | 8 - .../ProductTypes/ProductTypeRepository.cs | 14 - .../ProductTypes/ProductTypeController.cs | 34 - .../Products/Products/ProductController.cs | 7 + .../Menus/ProductsMenuContributor.cs | 7 - .../Menus/ProductsMenus.cs | 2 - .../ProductTypes/ProductType/Index.cshtml | 45 - .../ProductTypes/ProductType/Index.cshtml.cs | 12 - .../ProductTypes/ProductType/index.css | 0 .../ProductTypes/ProductType/index.js | 23 - .../Products/Product/CreateModal.cshtml.cs | 13 +- .../Products/Product/EditModal.cshtml.cs | 13 +- .../Products/Products/Product/Index.cshtml | 2 +- .../ViewModels/CreateEditProductViewModel.cs | 6 +- .../EShop/Products/Products/Product/index.js | 3 +- .../ProductTypeAppServiceTests.cs | 26 - .../ProductTypes/ProductTypeDomainTests.cs | 23 - .../ProductTypeRepositoryTests.cs | 31 - ...04922_RemovedProductTypeEntity.Designer.cs | 4235 +++++++++++++++++ ...20200901104922_RemovedProductTypeEntity.cs | 89 + ...pSampleMigrationsDbContextModelSnapshot.cs | 76 +- 78 files changed, 4700 insertions(+), 638 deletions(-) delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/Dtos/ProductTypeDto.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/IProductTypeAppService.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductGroupDto.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTypes/ProductTypeAppService.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/EShopProductsOptions.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/DefaultProductGroup.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroupConfigurationProvider.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfiguration.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurationProvider.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurations.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupNameAttribute.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeDataSeeder.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeRepository.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductType.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductTypeDataSeeder.cs create mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/NonexistentProductGroupException.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductsDataSeedContributor.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductTypes/ProductTypeRepository.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/ProductTypes/ProductTypeController.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml.cs delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.css delete mode 100644 modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.js delete mode 100644 modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Application.Tests/ProductTypes/ProductTypeAppServiceTests.cs delete mode 100644 modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Domain.Tests/ProductTypes/ProductTypeDomainTests.cs delete mode 100644 modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTypes/ProductTypeRepositoryTests.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.Designer.cs create mode 100644 samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.cs diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs index 1dd2f420..96f31699 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application.Contracts/EasyAbp/EShop/Orders/Orders/Dtos/OrderLineDto.cs @@ -13,7 +13,9 @@ namespace EasyAbp.EShop.Orders.Orders.Dtos public DateTime ProductDetailModificationTime { get; set; } - public string ProductTypeUniqueName { get; set; } + public string ProductGroupName { get; set; } + + public string ProductGroupDisplayName { get; set; } public string ProductUniqueName { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index caab6ac2..0b7bfc87 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -95,7 +95,8 @@ namespace EasyAbp.EShop.Orders.Orders productSkuId: productSku.Id, productModificationTime: product.LastModificationTime ?? product.CreationTime, productDetailModificationTime: productSku.LastModificationTime ?? productSku.CreationTime, - productTypeUniqueName: product.ProductTypeUniqueName, + productGroupName: product.ProductGroupName, + productGroupDisplayName: product.ProductGroupDisplayName, productUniqueName: product.UniqueName, productDisplayName: product.DisplayName, skuName: productSku.Name, diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json index 764d8aaf..f297678e 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/cs.json @@ -25,7 +25,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json index 14c573cf..6707b784 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/en.json @@ -26,7 +26,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json index 9c797fce..0900ec61 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pl.json @@ -25,7 +25,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json index 2eae48db..6dbf8836 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/pt-BR.json @@ -25,7 +25,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json index 187a09b2..318f2473 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/sl.json @@ -26,7 +26,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json index 120a9e66..88526a98 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/tr.json @@ -26,7 +26,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json index 4b01d58d..c090ebc7 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/vi.json @@ -25,7 +25,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json index 417a738c..fe6c5e30 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hans.json @@ -26,7 +26,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json index bc5b579e..f6916b52 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Localization/Orders/zh-Hant.json @@ -26,7 +26,8 @@ "OrderLineProductSkuId": "OrderLineProductSkuId", "OrderLineProductModificationTime": "OrderLineProductModificationTime", "OrderLineProductDetailModificationTime": "OrderLineProductDetailModificationTime", - "OrderLineProductTypeUniqueName": "OrderLineProductTypeUniqueName", + "OrderLineProductGroupName": "OrderLineProductGroupName", + "OrderLineProductGroupDisplayName": "OrderLineProductGroupDisplayName", "OrderLineProductUniqueName": "OrderLineProductUniqueName", "OrderLineProductDisplayName": "OrderLineProductDisplayName", "OrderLineSkuName": "OrderLineSkuName", diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs index a7e172fb..898b4480 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/IOrderLine.cs @@ -12,7 +12,7 @@ namespace EasyAbp.EShop.Orders.Orders DateTime ProductDetailModificationTime { get; } - string ProductTypeUniqueName { get; } + string ProductGroupName { get; } string ProductUniqueName { get; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs index 22f8521c..f8e95a46 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain.Shared/EasyAbp/EShop/Orders/Orders/OrderLineEto.cs @@ -15,7 +15,7 @@ namespace EasyAbp.EShop.Orders.Orders public DateTime ProductDetailModificationTime { get; set; } - public string ProductTypeUniqueName { get; set; } + public string ProductGroupName { get; set; } public string ProductUniqueName { get; set; } diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs index 2ba7d8fc..128e3feb 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Domain/EasyAbp/EShop/Orders/Orders/OrderLine.cs @@ -15,7 +15,10 @@ namespace EasyAbp.EShop.Orders.Orders public virtual DateTime ProductDetailModificationTime { get; protected set; } [NotNull] - public virtual string ProductTypeUniqueName { get; protected set; } + public virtual string ProductGroupName { get; protected set; } + + [NotNull] + public virtual string ProductGroupDisplayName { get; protected set; } [CanBeNull] public virtual string ProductUniqueName { get; protected set; } @@ -57,7 +60,8 @@ namespace EasyAbp.EShop.Orders.Orders Guid productSkuId, DateTime productModificationTime, DateTime productDetailModificationTime, - [NotNull] string productTypeUniqueName, + [NotNull] string productGroupName, + [NotNull] string productGroupDisplayName, [CanBeNull] string productUniqueName, [NotNull] string productDisplayName, [CanBeNull] string skuName, @@ -74,7 +78,8 @@ namespace EasyAbp.EShop.Orders.Orders ProductSkuId = productSkuId; ProductModificationTime = productModificationTime; ProductDetailModificationTime = productDetailModificationTime; - ProductTypeUniqueName = productTypeUniqueName; + ProductGroupName = productGroupName; + ProductGroupDisplayName = productGroupDisplayName; ProductUniqueName = productUniqueName; ProductDisplayName = productDisplayName; SkuName = skuName; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs index dd51ebde..04cd27a7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissionDefinitionProvider.cs @@ -11,8 +11,6 @@ namespace EasyAbp.EShop.Products.Permissions { var moduleGroup = context.AddGroup(ProductsPermissions.GroupName, L("Permission:Products")); - var productTypes = moduleGroup.AddPermission(ProductsPermissions.ProductTypes.Default, L("Permission:ProductType")); - var categories = moduleGroup.AddPermission(ProductsPermissions.Categories.Default, L("Permission:Category")); categories.AddChild(ProductsPermissions.Categories.CrossStore, L("Permission:CrossStore")); categories.AddChild(ProductsPermissions.Categories.Create, L("Permission:Create")); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs index 49f882ba..1fb855c1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Permissions/ProductsPermissions.cs @@ -6,11 +6,6 @@ namespace EasyAbp.EShop.Products.Permissions { public const string GroupName = "EasyAbp.EShop.Products"; - public class ProductTypes - { - public const string Default = GroupName + ".ProductType"; - } - public class Categories { public const string Default = GroupName + ".Category"; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/Dtos/ProductTypeDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/Dtos/ProductTypeDto.cs deleted file mode 100644 index 383e25dd..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/Dtos/ProductTypeDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using Volo.Abp.Application.Dtos; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Products.ProductTypes.Dtos -{ - public class ProductTypeDto : FullAuditedEntityDto - { - public string UniqueName { get; set; } - - public string DisplayName { get; set; } - - public string Description { get; set; } - - public MultiTenancySides MultiTenancySide { get; set; } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/IProductTypeAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/IProductTypeAppService.cs deleted file mode 100644 index 4aaa30ad..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/ProductTypes/IProductTypeAppService.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using EasyAbp.EShop.Products.ProductTypes.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public interface IProductTypeAppService : - IReadOnlyAppService< - ProductTypeDto, - Guid, - PagedAndSortedResultRequestDto> - { - - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs index b4a73206..f7799540 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/CreateUpdateProductDto.cs @@ -8,8 +8,8 @@ namespace EasyAbp.EShop.Products.Products.Dtos { public class CreateUpdateProductDto : IValidatableObject { - [DisplayName("ProductProductTypeId")] - public Guid ProductTypeId { get; set; } + [DisplayName("ProductProductGroupName")] + public string ProductGroupName { get; set; } [DisplayName("ProductDetailId")] public Guid ProductDetailId { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs index 1de547c5..01d3f9a1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductDto.cs @@ -8,9 +8,9 @@ namespace EasyAbp.EShop.Products.Products.Dtos [Serializable] public class ProductDto : FullAuditedEntityDto { - public Guid ProductTypeId { get; set; } + public string ProductGroupName { get; set; } - public string ProductTypeUniqueName { get; set; } + public string ProductGroupDisplayName { get; set; } public Guid ProductDetailId { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductGroupDto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductGroupDto.cs new file mode 100644 index 00000000..3448da11 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/Dtos/ProductGroupDto.cs @@ -0,0 +1,14 @@ +using System; + +namespace EasyAbp.EShop.Products.Products.Dtos +{ + [Serializable] + public class ProductGroupDto + { + public string Name { get; set; } + + public string DisplayName { get; set; } + + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs index e120831d..b6f18cef 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application.Contracts/EasyAbp/EShop/Products/Products/IProductAppService.cs @@ -1,6 +1,7 @@ using EasyAbp.EShop.Products.Products.Dtos; using System; using System.Threading.Tasks; +using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; namespace EasyAbp.EShop.Products.Products @@ -24,5 +25,7 @@ namespace EasyAbp.EShop.Products.Products Task GetByCodeAsync(string code, Guid storeId); Task DeleteSkuAsync(Guid productId, Guid productSkuId, Guid storeId); + + Task> GetProductGroupListAsync(); } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTypes/ProductTypeAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTypes/ProductTypeAppService.cs deleted file mode 100644 index 353baf90..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductTypes/ProductTypeAppService.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using EasyAbp.EShop.Products.Permissions; -using EasyAbp.EShop.Products.ProductTypes.Dtos; -using Volo.Abp.Application.Dtos; -using Volo.Abp.Application.Services; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductTypeAppService : ReadOnlyAppService, - IProductTypeAppService - { - protected override string GetPolicyName { get; set; } = ProductsPermissions.ProductTypes.Default; - protected override string GetListPolicyName { get; set; } = ProductsPermissions.ProductTypes.Default; - - private readonly IProductTypeRepository _repository; - - public ProductTypeAppService(IProductTypeRepository repository) : base(repository) - { - _repository = repository; - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs index 9504331c..9803249c 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/Products/ProductAppService.cs @@ -1,12 +1,13 @@ using EasyAbp.EShop.Products.Permissions; using EasyAbp.EShop.Products.Products.Dtos; using EasyAbp.EShop.Products.ProductStores; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Stores.Authorization; using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EasyAbp.EShop.Products.Options; +using Microsoft.Extensions.Options; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; @@ -25,25 +26,25 @@ namespace EasyAbp.EShop.Products.Products protected override string GetListPolicyName { get; set; } = null; private readonly IProductManager _productManager; + private readonly EShopProductsOptions _options; private readonly IProductInventoryProvider _productInventoryProvider; private readonly IAttributeOptionIdsSerializer _attributeOptionIdsSerializer; private readonly IProductStoreRepository _productStoreRepository; - private readonly IProductTypeRepository _productTypeRepository; private readonly IProductRepository _repository; public ProductAppService( IProductManager productManager, + IOptions options, IProductInventoryProvider productInventoryProvider, IAttributeOptionIdsSerializer attributeOptionIdsSerializer, IProductStoreRepository productStoreRepository, - IProductTypeRepository productTypeRepository, IProductRepository repository) : base(repository) { _productManager = productManager; + _options = options.Value; _productInventoryProvider = productInventoryProvider; _attributeOptionIdsSerializer = attributeOptionIdsSerializer; _productStoreRepository = productStoreRepository; - _productTypeRepository = productTypeRepository; _repository = repository; } @@ -77,7 +78,7 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, input.StoreId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } @@ -102,7 +103,7 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, input.StoreId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } @@ -218,19 +219,21 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } - protected virtual async Task LoadDtosProductTypeUniqueNameAsync(IEnumerable dtos) + protected virtual Task LoadDtosProductGroupDisplayNameAsync(IEnumerable dtos) { - var dict = (await _productTypeRepository.GetListAsync()).ToDictionary(x => x.Id, x => x.UniqueName); + var dict = _options.Groups.GetConfigurationsDictionary(); foreach (var dto in dtos) { - dto.ProductTypeUniqueName = dict[dto.ProductTypeId]; + dto.ProductGroupDisplayName = dict[dto.ProductGroupName].DisplayName; } + + return Task.CompletedTask; } public virtual async Task GetByCodeAsync(string code, Guid storeId) @@ -247,7 +250,7 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } @@ -291,7 +294,7 @@ namespace EasyAbp.EShop.Products.Products items.Add(productDto); } - await LoadDtosProductTypeUniqueNameAsync(items); + await LoadDtosProductGroupDisplayNameAsync(items); return new PagedResultDto(totalCount, items); } @@ -386,7 +389,7 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } @@ -412,7 +415,7 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } @@ -435,9 +438,23 @@ namespace EasyAbp.EShop.Products.Products var dto = MapToGetOutputDto(product); await LoadDtoExtraDataAsync(product, dto, storeId); - await LoadDtosProductTypeUniqueNameAsync(new[] {dto}); + await LoadDtosProductGroupDisplayNameAsync(new[] {dto}); return dto; } + + public virtual Task> GetProductGroupListAsync() + { + var dict = _options.Groups.GetConfigurationsDictionary(); + + return Task.FromResult(new ListResultDto(dict.Select(x => + new ProductGroupDto + { + Name = x.Key, + DisplayName = x.Value.DisplayName, + Description = x.Value.Description + } + ).ToList())); + } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs index f9d7bfc1..4b562fb4 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Application/EasyAbp/EShop/Products/ProductsApplicationAutoMapperProfile.cs @@ -13,8 +13,6 @@ using EasyAbp.EShop.Products.ProductInventories; using EasyAbp.EShop.Products.ProductInventories.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; -using EasyAbp.EShop.Products.ProductTypes; -using EasyAbp.EShop.Products.ProductTypes.Dtos; using System.Linq; using Volo.Abp.AutoMapper; using Volo.Abp.DependencyInjection; @@ -29,7 +27,7 @@ namespace EasyAbp.EShop.Products * Alternatively, you can split your mapping configurations * into multiple profile classes for a better organization. */ CreateMap() - .Ignore(dto => dto.ProductTypeUniqueName) + .Ignore(dto => dto.ProductGroupDisplayName) .Ignore(dto => dto.Sold) .Ignore(dto => dto.MinimumPrice) .Ignore(dto => dto.MaximumPrice); @@ -64,7 +62,6 @@ namespace EasyAbp.EShop.Products CreateMap(MemberList.Source); CreateMap(); CreateMap(MemberList.Source); - CreateMap(); CreateMap(); CreateMap(); CreateMap(); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json index 6087d675..a1cf0241 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/cs.json @@ -4,7 +4,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -58,15 +59,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json index 0bf6372a..c6c83473 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/en.json @@ -5,7 +5,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -59,15 +60,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the product type {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json index fe57f76b..578d46e7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pl.json @@ -4,7 +4,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -58,15 +59,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json index 588971b0..2e65c15a 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/pt-BR.json @@ -4,7 +4,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -58,15 +59,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json index 1c50cf10..ea37b1c8 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/sl.json @@ -5,7 +5,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -59,15 +60,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json index 665f5c7a..f920667d 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/tr.json @@ -5,7 +5,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -59,15 +60,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json index 810cb298..76985981 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/vi.json @@ -4,7 +4,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -58,15 +59,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json index 9053df08..413f078f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hans.json @@ -5,7 +5,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -59,15 +60,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json index 088df3f2..c67d8299 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Localization/Products/zh-Hant.json @@ -5,7 +5,8 @@ "Menu:Product": "MenuProduct", "Product": "Product", "ProductStore": "ProductStore", - "ProductProductTypeId": "ProductProductTypeId", + "ProductProductGroupName": "ProductProductGroupName", + "ProductProductGroupDisplayName": "ProductProductGroupDisplayName", "ProductDetailId": "ProductDetailId", "ProductProductStoreId": "ProductProductStoreId", "ProductUniqueName": "ProductUniqueName", @@ -59,15 +60,6 @@ "CreateCategory": "CreateCategory", "EditCategory": "EditCategory", "CategoryDeletionConfirmationMessage": "Are you sure to delete the category {0}?", - "Menu:ProductType": "MenuProductType", - "ProductType": "ProductType", - "ProductTypeUniqueName": "ProductTypeUniqueName", - "ProductTypeDisplayName": "ProductTypeDisplayName", - "ProductTypeDescription": "ProductTypeDescription", - "ProductTypeMultiTenancySide": "ProductTypeMultiTenancySide", - "CreateProductType": "CreateProductType", - "EditProductType": "EditProductType", - "ProductTypeDeletionConfirmationMessage": "Are you sure to delete the producttype {0}?", "Menu:ProductCategory": "MenuProductCategory", "ProductCategory": "ProductCategory", "ProductCategoryTenantId": "ProductCategoryTenantId", diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProduct.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProduct.cs index 8545d7bf..8b678d63 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProduct.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/IProduct.cs @@ -6,7 +6,7 @@ namespace EasyAbp.EShop.Products.Products { public interface IProduct : IHasExtraProperties { - Guid ProductTypeId { get; } + string ProductGroupName { get; } Guid ProductDetailId { get; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs index be91b374..1b831d71 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/Products/ProductEto.cs @@ -7,8 +7,8 @@ namespace EasyAbp.EShop.Products.Products { public Guid Id { get; set; } - public Guid ProductTypeId { get; set; } - + public string ProductGroupName { get; set; } + public Guid ProductDetailId { get; set; } public string UniqueName { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs index 24f0fe75..9684e57f 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain.Shared/EasyAbp/EShop/Products/ProductsConsts.cs @@ -2,6 +2,10 @@ { public static class ProductsConsts { - public const string DefaultProductType = "Default"; + public const string DefaultProductGroupName = "Default"; + + public const string DefaultProductGroupDisplayName = "Default"; + + public const string DefaultProductGroupDescription = ""; } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/EShopProductsDomainModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/EShopProductsDomainModule.cs index bb78a7fa..284c7abf 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/EShopProductsDomainModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/EShopProductsDomainModule.cs @@ -1,4 +1,6 @@ using EasyAbp.Abp.Trees; +using EasyAbp.EShop.Products.Options; +using EasyAbp.EShop.Products.Options.ProductGroups; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Stores; using Microsoft.Extensions.DependencyInjection; @@ -23,6 +25,15 @@ namespace EasyAbp.EShop.Products options.AutoEventSelectors.Add(); }); + + Configure(options => + { + options.Groups.Configure(group => + { + group.DisplayName = ProductsConsts.DefaultProductGroupDisplayName; + group.Description = ProductsConsts.DefaultProductGroupDescription; + }); + }); } public override void ConfigureServices(ServiceConfigurationContext context) diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/EShopProductsOptions.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/EShopProductsOptions.cs new file mode 100644 index 00000000..6f654ba6 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/EShopProductsOptions.cs @@ -0,0 +1,17 @@ +using System; +using EasyAbp.EShop.Products.Options.ProductGroups; + +namespace EasyAbp.EShop.Products.Options +{ + public class EShopProductsOptions + { + public ProductGroupConfigurations Groups { get; } + + public Type DefaultFileDownloadProviderType { get; set; } + + public EShopProductsOptions() + { + Groups = new ProductGroupConfigurations(); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/DefaultProductGroup.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/DefaultProductGroup.cs new file mode 100644 index 00000000..31ce4370 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/DefaultProductGroup.cs @@ -0,0 +1,8 @@ +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + [ProductGroupName(ProductsConsts.DefaultProductGroupName)] + public class DefaultProductGroup + { + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs new file mode 100644 index 00000000..17c95391 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroup.cs @@ -0,0 +1,7 @@ +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public interface IProductGroup + { + + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroupConfigurationProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroupConfigurationProvider.cs new file mode 100644 index 00000000..7d6c03bd --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/IProductGroupConfigurationProvider.cs @@ -0,0 +1,7 @@ +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public interface IProductGroupConfigurationProvider + { + ProductGroupConfiguration Get(string productGroupName); + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfiguration.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfiguration.cs new file mode 100644 index 00000000..6a1715c2 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfiguration.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public class ProductGroupConfiguration + { + public string DisplayName { get; set; } + + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurationProvider.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurationProvider.cs new file mode 100644 index 00000000..ad4b0989 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurationProvider.cs @@ -0,0 +1,20 @@ +using Microsoft.Extensions.Options; +using Volo.Abp.DependencyInjection; + +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public class ProductGroupConfigurationProvider : IProductGroupConfigurationProvider, ITransientDependency + { + private readonly EShopProductsOptions _options; + + public ProductGroupConfigurationProvider(IOptions options) + { + _options = options.Value; + } + + public ProductGroupConfiguration Get(string productGroupName) + { + return _options.Groups.GetConfiguration(productGroupName); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurations.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurations.cs new file mode 100644 index 00000000..881e0756 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupConfigurations.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using JetBrains.Annotations; +using Volo.Abp; + +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public class ProductGroupConfigurations + { + private readonly Dictionary _groups; + + public ProductGroupConfigurations() + { + _groups = new Dictionary(); + } + + public ProductGroupConfigurations Configure( + Action configureAction) + { + return Configure( + ProductGroupNameAttribute.GetGroupName(), + configureAction + ); + } + + public ProductGroupConfigurations Configure( + [NotNull] string name, + [NotNull] Action configureAction) + { + Check.NotNullOrWhiteSpace(name, nameof(name)); + Check.NotNull(configureAction, nameof(configureAction)); + + configureAction( + _groups.GetOrAdd( + name, + () => new ProductGroupConfiguration() + ) + ); + + return this; + } + + public ProductGroupConfigurations ConfigureAll(Action configureAction) + { + foreach (var group in _groups) + { + configureAction(group.Key, group.Value); + } + + return this; + } + + [NotNull] + public ProductGroupConfiguration GetConfiguration() + { + return GetConfiguration(ProductGroupNameAttribute.GetGroupName()); + } + + [NotNull] + public ProductGroupConfiguration GetConfiguration([NotNull] string name) + { + Check.NotNullOrWhiteSpace(name, nameof(name)); + + return _groups.GetOrDefault(name); + } + + [NotNull] + public Dictionary GetConfigurationsDictionary() + { + return _groups; + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupNameAttribute.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupNameAttribute.cs new file mode 100644 index 00000000..9042a8e6 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Options/ProductGroups/ProductGroupNameAttribute.cs @@ -0,0 +1,42 @@ +using System; +using System.Reflection; +using JetBrains.Annotations; +using Volo.Abp; + +namespace EasyAbp.EShop.Products.Options.ProductGroups +{ + public class ProductGroupNameAttribute : Attribute + { + [NotNull] + public string Name { get; } + + public ProductGroupNameAttribute([NotNull] string name) + { + Check.NotNullOrWhiteSpace(name, nameof(name)); + + Name = name; + } + + public virtual string GetName(Type type) + { + return Name; + } + + public static string GetGroupName() + { + return GetGroupName(typeof(T)); + } + + public static string GetGroupName(Type type) + { + var nameAttribute = type.GetCustomAttribute(); + + if (nameAttribute == null) + { + return type.FullName; + } + + return nameAttribute.GetName(type); + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeDataSeeder.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeDataSeeder.cs deleted file mode 100644 index 9f8e9c77..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeDataSeeder.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Data; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public interface IProductTypeDataSeeder - { - Task SeedAsync(DataSeedContext context); - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeRepository.cs deleted file mode 100644 index 1c4c0d6e..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/IProductTypeRepository.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using Volo.Abp.Domain.Repositories; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public interface IProductTypeRepository : IRepository - { - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductType.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductType.cs deleted file mode 100644 index 584f4d13..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductType.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using JetBrains.Annotations; -using Volo.Abp.Domain.Entities.Auditing; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductType : FullAuditedAggregateRoot - { - public virtual string UniqueName { get; protected set; } - - [NotNull] - public virtual string DisplayName { get; protected set; } - - [CanBeNull] - public virtual string Description { get; protected set; } - - public virtual MultiTenancySides MultiTenancySide { get; protected set; } - - protected ProductType() - { - } - - public ProductType( - Guid id, - string uniqueName, - string displayName, - string description, - MultiTenancySides multiTenancySide - ) :base(id) - { - UniqueName = uniqueName; - DisplayName = displayName; - Description = description; - MultiTenancySide = multiTenancySide; - } - } -} diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductTypeDataSeeder.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductTypeDataSeeder.cs deleted file mode 100644 index 94bdfaf6..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductTypes/ProductTypeDataSeeder.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Threading.Tasks; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Guids; -using Volo.Abp.MultiTenancy; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductTypeDataSeeder : IProductTypeDataSeeder, ITransientDependency - { - private readonly IGuidGenerator _guidGenerator; - private readonly IProductTypeRepository _productTypeRepository; - - public ProductTypeDataSeeder( - IGuidGenerator guidGenerator, - IProductTypeRepository productTypeRepository) - { - _guidGenerator = guidGenerator; - _productTypeRepository = productTypeRepository; - } - - public async Task SeedAsync(DataSeedContext context) - { - if (await _productTypeRepository.GetCountAsync() == 0) - { - await _productTypeRepository.InsertAsync(new ProductType(_guidGenerator.Create(), ProductsConsts.DefaultProductType, "Default", - null, MultiTenancySides.Both), true); - } - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/NonexistentProductGroupException.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/NonexistentProductGroupException.cs new file mode 100644 index 00000000..aa698577 --- /dev/null +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/NonexistentProductGroupException.cs @@ -0,0 +1,14 @@ +using System; +using Volo.Abp; + +namespace EasyAbp.EShop.Products.Products +{ + public class NonexistentProductGroupException : BusinessException + { + public NonexistentProductGroupException(string productGroupName) : base( + "NonexistentProductGroup", + $"The specified product group ({productGroupName}) is nonexistent.") + { + } + } +} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs index 979bbcaf..b12346f4 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/Product.cs @@ -7,7 +7,8 @@ namespace EasyAbp.EShop.Products.Products { public class Product : FullAuditedAggregateRoot, IProduct { - public virtual Guid ProductTypeId { get; protected set; } + [NotNull] + public virtual string ProductGroupName { get; protected set; } public virtual Guid ProductDetailId { get; protected set; } @@ -40,7 +41,7 @@ namespace EasyAbp.EShop.Products.Products public Product( Guid id, - Guid productTypeId, + [NotNull] string productGroupName, Guid productDetailId, [CanBeNull] string code, [NotNull] string displayName, @@ -52,7 +53,7 @@ namespace EasyAbp.EShop.Products.Products int displayOrder ) : base(id) { - ProductTypeId = productTypeId; + ProductGroupName = productGroupName; ProductDetailId = productDetailId; UniqueName = code?.Trim(); DisplayName = displayName; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs index cd513785..9bbe5aa7 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/Products/ProductManager.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using EasyAbp.EShop.Products.Options.ProductGroups; using EasyAbp.EShop.Products.ProductCategories; using EasyAbp.EShop.Products.ProductStores; using Microsoft.Extensions.DependencyInjection; @@ -16,19 +17,22 @@ namespace EasyAbp.EShop.Products.Products private readonly IProductPriceProvider _productPriceProvider; private readonly IProductCategoryRepository _productCategoryRepository; private readonly IProductInventoryProvider _productInventoryProvider; + private readonly IProductGroupConfigurationProvider _productGroupConfigurationProvider; public ProductManager( IProductRepository productRepository, IProductStoreRepository productStoreRepository, IProductPriceProvider productPriceProvider, IProductCategoryRepository productCategoryRepository, - IProductInventoryProvider productInventoryProvider) + IProductInventoryProvider productInventoryProvider, + IProductGroupConfigurationProvider productGroupConfigurationProvider) { _productRepository = productRepository; _productStoreRepository = productStoreRepository; _productPriceProvider = productPriceProvider; _productCategoryRepository = productCategoryRepository; _productInventoryProvider = productInventoryProvider; + _productGroupConfigurationProvider = productGroupConfigurationProvider; } public virtual async Task CreateAsync(Product product, Guid? storeId = null, @@ -36,7 +40,9 @@ namespace EasyAbp.EShop.Products.Products { product.TrimCode(); - await CheckProductCodeUniqueAsync(product); + await CheckProductGroupNameAsync(product); + + await CheckProductUniqueNameAsync(product); await _productRepository.InsertAsync(product, autoSave: true); @@ -51,10 +57,22 @@ namespace EasyAbp.EShop.Products.Products return product; } - + + protected virtual Task CheckProductGroupNameAsync(Product product) + { + if (_productGroupConfigurationProvider.Get(product.ProductGroupName) == null) + { + throw new NonexistentProductGroupException(product.DisplayName); + } + + return Task.CompletedTask; + } + public virtual async Task UpdateAsync(Product product, IEnumerable categoryIds = null) { - await CheckProductCodeUniqueAsync(product); + await CheckProductGroupNameAsync(product); + + await CheckProductUniqueNameAsync(product); await _productRepository.UpdateAsync(product, autoSave: true); @@ -141,7 +159,7 @@ namespace EasyAbp.EShop.Products.Products storeId, productId, true), true); } - protected virtual async Task CheckProductCodeUniqueAsync(Product product) + protected virtual async Task CheckProductUniqueNameAsync(Product product) { if (product.UniqueName.IsNullOrEmpty()) { diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductsDataSeedContributor.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductsDataSeedContributor.cs deleted file mode 100644 index 82c00acc..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Domain/EasyAbp/EShop/Products/ProductsDataSeedContributor.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Threading.Tasks; -using EasyAbp.EShop.Products.ProductTypes; -using Volo.Abp.Data; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Uow; - -namespace EasyAbp.EShop.Products -{ - public class ProductsDataSeedContributor : IDataSeedContributor, ITransientDependency - { - private readonly IProductTypeDataSeeder _productTypeDataSeeder; - - public ProductsDataSeedContributor(IProductTypeDataSeeder productTypeDataSeeder) - { - _productTypeDataSeeder = productTypeDataSeeder; - } - - [UnitOfWork(true)] - public async Task SeedAsync(DataSeedContext context) - { - await _productTypeDataSeeder.SeedAsync(context); - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs index 048c82d8..18d44301 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/EShopProductsEntityFrameworkCoreModule.cs @@ -4,7 +4,6 @@ using EasyAbp.EShop.Products.ProductDetailHistories; using EasyAbp.EShop.Products.ProductHistories; using EasyAbp.EShop.Products.ProductStores; using EasyAbp.EShop.Products.ProductCategories; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Categories; using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.Products; @@ -31,7 +30,6 @@ namespace EasyAbp.EShop.Products.EntityFrameworkCore options.AddRepository(); options.AddRepository(); options.AddRepository(); - options.AddRepository(); options.AddRepository(); options.AddRepository(); options.AddRepository(); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/IProductsDbContext.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/IProductsDbContext.cs index 98ca6054..cd954d6b 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/IProductsDbContext.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/IProductsDbContext.cs @@ -3,7 +3,6 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Categories; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.ProductCategories; using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.ProductStores; @@ -25,7 +24,6 @@ namespace EasyAbp.EShop.Products.EntityFrameworkCore DbSet ProductAttributeOptions { get; set; } DbSet ProductSkus { get; set; } DbSet Categories { get; set; } - DbSet ProductTypes { get; set; } DbSet ProductCategories { get; set; } DbSet ProductStores { get; set; } DbSet ProductHistories { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContext.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContext.cs index 7dabeb2f..0c54c8f5 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContext.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContext.cs @@ -3,7 +3,6 @@ using Volo.Abp.Data; using Volo.Abp.EntityFrameworkCore; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Categories; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.ProductCategories; using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.ProductStores; @@ -25,7 +24,6 @@ namespace EasyAbp.EShop.Products.EntityFrameworkCore public DbSet ProductAttributeOptions { get; set; } public DbSet ProductSkus { get; set; } public DbSet Categories { get; set; } - public DbSet ProductTypes { get; set; } public DbSet ProductCategories { get; set; } public DbSet ProductStores { get; set; } public DbSet ProductHistories { get; set; } diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs index b04497c2..b3ce66ba 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/EntityFrameworkCore/ProductsDbContextModelCreatingExtensions.cs @@ -3,7 +3,6 @@ using EasyAbp.EShop.Products.ProductDetailHistories; using EasyAbp.EShop.Products.ProductHistories; using EasyAbp.EShop.Products.ProductStores; using EasyAbp.EShop.Products.ProductCategories; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Categories; using EasyAbp.EShop.Products.Products; using System; @@ -97,13 +96,6 @@ namespace EasyAbp.EShop.Products.EntityFrameworkCore b.HasIndex(x => x.UniqueName).IsUnique(); }); - builder.Entity(b => - { - b.ToTable(options.TablePrefix + "ProductTypes", options.Schema); - b.ConfigureByConvention(); - /* Configure more properties here */ - }); - builder.Entity(b => { b.ToTable(options.TablePrefix + "ProductCategories", options.Schema); diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductTypes/ProductTypeRepository.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductTypes/ProductTypeRepository.cs deleted file mode 100644 index 6b043d26..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.EntityFrameworkCore/EasyAbp/EShop/Products/ProductTypes/ProductTypeRepository.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using EasyAbp.EShop.Products.EntityFrameworkCore; -using Volo.Abp.Domain.Repositories.EntityFrameworkCore; -using Volo.Abp.EntityFrameworkCore; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductTypeRepository : EfCoreRepository, IProductTypeRepository - { - public ProductTypeRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) - { - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/ProductTypes/ProductTypeController.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/ProductTypes/ProductTypeController.cs deleted file mode 100644 index bce93db2..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/ProductTypes/ProductTypeController.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Products.ProductTypes.Dtos; -using Microsoft.AspNetCore.Mvc; -using Volo.Abp; -using Volo.Abp.Application.Dtos; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - [RemoteService(Name = "EShopProducts")] - [Route("/api/eShop/products/productType")] - public class ProductTypeController : ProductsController, IProductTypeAppService - { - private readonly IProductTypeAppService _service; - - public ProductTypeController(IProductTypeAppService service) - { - _service = service; - } - - [HttpGet] - [Route("{id}")] - public Task GetAsync(Guid id) - { - return _service.GetAsync(id); - } - - [HttpGet] - public Task> GetListAsync(PagedAndSortedResultRequestDto input) - { - return _service.GetListAsync(input); - } - } -} \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs index d9c36ecd..21c0af38 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.HttpApi/EasyAbp/EShop/Products/Products/ProductController.cs @@ -94,5 +94,12 @@ namespace EasyAbp.EShop.Products.Products { return _service.DeleteSkuAsync(id, productSkuId, storeId); } + + [HttpGet] + [Route("productGroup")] + public Task> GetProductGroupListAsync() + { + return _service.GetProductGroupListAsync(); + } } } \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs index 55b46a33..f86f7044 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenuContributor.cs @@ -24,13 +24,6 @@ namespace EasyAbp.EShop.Products.Web.Menus var productManagementMenuItem = new ApplicationMenuItem(ProductsMenus.Prefix, l["Menu:ProductManagement"]); - if (await context.IsGrantedAsync(ProductsPermissions.ProductTypes.Default)) - { - productManagementMenuItem.AddItem( - new ApplicationMenuItem(ProductsMenus.ProductType, l["Menu:ProductType"], "/EShop/Products/ProductTypes/ProductType") - ); - } - if (await context.IsGrantedAsync(ProductsPermissions.Categories.Default)) { productManagementMenuItem.AddItem( diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs index ef679742..23d44aa4 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Menus/ProductsMenus.cs @@ -6,8 +6,6 @@ public const string Prefix = ModuleGroupPrefix + ".Products"; - public const string ProductType = Prefix + ".ProductType"; - public const string Category = Prefix + ".Category"; public const string Product = Prefix + ".Product"; diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml deleted file mode 100644 index 817a55e1..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml +++ /dev/null @@ -1,45 +0,0 @@ -@page -@using EasyAbp.EShop.Products.Localization -@using EasyAbp.EShop.Products.Web.Menus -@using EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType -@using Microsoft.AspNetCore.Mvc.Localization -@using Volo.Abp.AspNetCore.Mvc.UI.Layout -@model IndexModel -@inject IPageLayout PageLayout -@inject IHtmlLocalizer L -@{ - PageLayout.Content.Title = L["ProductType"].Value; - PageLayout.Content.BreadCrumb.Add(L["Menu:ProductType"].Value); - PageLayout.Content.MenuItemName = ProductsMenus.ProductType; -} - -@section scripts -{ - -} -@section styles -{ - -} - - - - - - @L["ProductType"] - - - - - - - - @L["ProductTypeUniqueName"] - @L["ProductTypeDisplayName"] - @L["ProductTypeDescription"] - @L["ProductTypeMultiTenancySide"] - - - - - \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml.cs deleted file mode 100644 index 02c8adb7..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/Index.cshtml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Threading.Tasks; - -namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.ProductTypes.ProductType -{ - public class IndexModel : ProductsPageModel - { - public async Task OnGetAsync() - { - await Task.CompletedTask; - } - } -} diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.css b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.css deleted file mode 100644 index e69de29b..00000000 diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.js b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.js deleted file mode 100644 index 114a9826..00000000 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/ProductTypes/ProductType/index.js +++ /dev/null @@ -1,23 +0,0 @@ -$(function () { - - var l = abp.localization.getResource('EasyAbpEShopProducts'); - - var service = easyAbp.eShop.products.productTypes.productType; - - var dataTable = $('#ProductTypeTable').DataTable(abp.libs.datatables.normalizeConfiguration({ - processing: true, - serverSide: true, - paging: true, - searching: false, - autoWidth: false, - scrollCollapse: true, - order: [[1, "asc"]], - ajax: abp.libs.datatables.createAjax(service.getList), - columnDefs: [ - { data: "uniqueName" }, - { data: "displayName" }, - { data: "description" }, - { data: "multiTenancySide" }, - ] - })); -}); \ No newline at end of file diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs index a2980c13..ed6e013e 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/CreateModal.cshtml.cs @@ -4,7 +4,6 @@ using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -24,22 +23,19 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product [BindProperty] public CreateEditProductViewModel Product { get; set; } - public ICollection ProductTypes { get; set; } + public ICollection ProductGroups { get; set; } public ICollection Categories { get; set; } - private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; private readonly IProductAppService _service; public CreateModalModel( - IProductTypeAppService productTypeAppService, ICategoryAppService categoryAppService, IProductDetailAppService productDetailAppService, IProductAppService service) { - _productTypeAppService = productTypeAppService; _categoryAppService = categoryAppService; _productDetailAppService = productDetailAppService; _service = service; @@ -47,10 +43,9 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product public virtual async Task OnGetAsync(Guid? categoryId) { - ProductTypes = - (await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto - { MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount })).Items - .Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList(); + ProductGroups = + (await _service.GetProductGroupListAsync()).Items + .Select(dto => new SelectListItem(dto.DisplayName, dto.Name)).ToList(); Categories = (await _categoryAppService.GetListAsync(new GetCategoryListDto diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs index f5779624..3f200fff 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/EditModal.cshtml.cs @@ -6,7 +6,6 @@ using EasyAbp.EShop.Products.ProductDetails; using EasyAbp.EShop.Products.ProductDetails.Dtos; using EasyAbp.EShop.Products.Products; using EasyAbp.EShop.Products.Products.Dtos; -using EasyAbp.EShop.Products.ProductTypes; using EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewModels; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Rendering; @@ -27,24 +26,21 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product [BindProperty] public CreateEditProductViewModel Product { get; set; } - public ICollection ProductTypes { get; set; } + public ICollection ProductGroups { get; set; } public ICollection Categories { get; set; } - private readonly IProductTypeAppService _productTypeAppService; private readonly ICategoryAppService _categoryAppService; private readonly IProductDetailAppService _productDetailAppService; private readonly IProductCategoryAppService _productCategoryAppService; private readonly IProductAppService _service; public EditModalModel( - IProductTypeAppService productTypeAppService, ICategoryAppService categoryAppService, IProductDetailAppService productDetailAppService, IProductCategoryAppService productCategoryAppService, IProductAppService service) { - _productTypeAppService = productTypeAppService; _categoryAppService = categoryAppService; _productDetailAppService = productDetailAppService; _productCategoryAppService = productCategoryAppService; @@ -53,10 +49,9 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product public virtual async Task OnGetAsync(Guid storeId) { - ProductTypes = - (await _productTypeAppService.GetListAsync(new PagedAndSortedResultRequestDto - {MaxResultCount = LimitedResultRequestDto.MaxMaxResultCount})).Items - .Select(dto => new SelectListItem(dto.DisplayName, dto.Id.ToString())).ToList(); + ProductGroups = + (await _service.GetProductGroupListAsync()).Items + .Select(dto => new SelectListItem(dto.DisplayName, dto.Name)).ToList(); Categories = (await _categoryAppService.GetListAsync(new GetCategoryListDto diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml index c5ef3d60..1879c5f4 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/Index.cshtml @@ -45,7 +45,7 @@ @L["Actions"] - @L["ProductProductTypeId"] + @L["ProductProductGroupDisplayName"] @L["ProductUniqueName"] @L["ProductDisplayName"] @L["ProductInventoryStrategy"] diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs index e0f7fd02..ce1fef5b 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/ViewModels/CreateEditProductViewModel.cs @@ -16,9 +16,9 @@ namespace EasyAbp.EShop.Products.Web.Pages.EShop.Products.Products.Product.ViewM public Guid StoreId { get; set; } [Required] - [SelectItems("ProductTypes")] - [Display(Name = "ProductType")] - public Guid ProductTypeId { get; set; } + [SelectItems("ProductGroups")] + [Display(Name = "ProductGroupName")] + public string ProductGroupName { get; set; } [SelectItems("Categories")] [Display(Name = "ProductCategory")] diff --git a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js index 99b0f255..534cd5f1 100644 --- a/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js +++ b/modules/EasyAbp.EShop.Products/src/EasyAbp.EShop.Products.Web/Pages/EShop/Products/Products/Product/index.js @@ -13,7 +13,6 @@ $(function () { searching: false, autoWidth: false, scrollCollapse: true, - order: [[1, "asc"]], ajax: abp.libs.datatables.createAjax(service.getList, function () { return { storeId: storeId, categoryId: categoryId, showHidden: true } }), @@ -50,7 +49,7 @@ $(function () { ] } }, - { data: "productTypeId" }, + { data: "productGroupDisplayName" }, { data: "uniqueName" }, { data: "displayName" }, { data: "inventoryStrategy" }, diff --git a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Application.Tests/ProductTypes/ProductTypeAppServiceTests.cs b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Application.Tests/ProductTypes/ProductTypeAppServiceTests.cs deleted file mode 100644 index f04cf542..00000000 --- a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Application.Tests/ProductTypes/ProductTypeAppServiceTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Shouldly; -using System.Threading.Tasks; -using Xunit; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductTypeAppServiceTests : ProductsApplicationTestBase - { - private readonly IProductTypeAppService _productTypeAppService; - - public ProductTypeAppServiceTests() - { - _productTypeAppService = GetRequiredService(); - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Act - - // Assert - } - } -} diff --git a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Domain.Tests/ProductTypes/ProductTypeDomainTests.cs b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Domain.Tests/ProductTypes/ProductTypeDomainTests.cs deleted file mode 100644 index e5e58fc4..00000000 --- a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.Domain.Tests/ProductTypes/ProductTypeDomainTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; -using Shouldly; -using Xunit; - -namespace EasyAbp.EShop.Products.ProductTypes -{ - public class ProductTypeDomainTests : ProductsDomainTestBase - { - public ProductTypeDomainTests() - { - } - - [Fact] - public async Task Test1() - { - // Arrange - - // Assert - - // Assert - } - } -} diff --git a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTypes/ProductTypeRepositoryTests.cs b/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTypes/ProductTypeRepositoryTests.cs deleted file mode 100644 index ff418b6e..00000000 --- a/modules/EasyAbp.EShop.Products/test/EasyAbp.EShop.Products.EntityFrameworkCore.Tests/EntityFrameworkCore/ProductTypes/ProductTypeRepositoryTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Threading.Tasks; -using EasyAbp.EShop.Products.ProductTypes; -using Volo.Abp.Domain.Repositories; -using Xunit; - -namespace EasyAbp.EShop.Products.EntityFrameworkCore.ProductTypes -{ - public class ProductTypeRepositoryTests : ProductsEntityFrameworkCoreTestBase - { - private readonly IRepository _productTypeRepository; - - public ProductTypeRepositoryTests() - { - _productTypeRepository = GetRequiredService>(); - } - - [Fact] - public async Task Test1() - { - await WithUnitOfWorkAsync(async () => - { - // Arrange - - // Act - - //Assert - }); - } - } -} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.Designer.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.Designer.cs new file mode 100644 index 00000000..1ff07a79 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.Designer.cs @@ -0,0 +1,4235 @@ +// +using System; +using EShopSample.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Volo.Abp.EntityFrameworkCore; + +namespace EShopSample.Migrations +{ + [DbContext(typeof(EShopSampleMigrationsDbContext))] + [Migration("20200901104922_RemovedProductTypeEntity")] + partial class RemovedProductTypeEntity + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) + .HasAnnotation("ProductVersion", "3.1.5") + .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CancellationReason") + .HasColumnType("nvarchar(max)"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderNumber") + .HasColumnType("nvarchar(450)"); + + b.Property("OrderStatus") + .HasColumnType("int"); + + b.Property("PaidTime") + .HasColumnType("datetime2"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("ReducedInventoryAfterPaymentTime") + .HasColumnType("datetime2"); + + b.Property("ReducedInventoryAfterPlacingTime") + .HasColumnType("datetime2"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderNumber") + .IsUnique() + .HasFilter("[OrderNumber] IS NOT NULL"); + + b.ToTable("EasyAbpEShopOrdersOrders"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualTotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductDetailModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("OrderId"); + + b.ToTable("EasyAbpEShopOrdersOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsPayments"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpEShopPaymentsPaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopPaymentsRefunds"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("OrderLineId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundedQuantity") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("RefundItemId"); + + b.ToTable("EasyAbpEShopPaymentsRefundItemOrderLines"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.BasketItems.BasketItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("BasketName") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsInvalid") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductUniqueName") + .HasColumnType("nvarchar(max)"); + + b.Property("Quantity") + .HasColumnType("int"); + + b.Property("SkuDescription") + .HasColumnType("nvarchar(max)"); + + b.Property("SkuName") + .HasColumnType("nvarchar(max)"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("TotalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UnitPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpEShopPluginsBasketsBasketItems"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Plugins.Baskets.ProductUpdates.ProductUpdate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopPluginsBasketsProductUpdates"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Level") + .HasColumnType("int"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("ParentId"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductCategories.ProductCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CategoryId") + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductCategories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetailHistories.ProductDetailHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductDetailId"); + + b.ToTable("EasyAbpEShopProductsProductDetailHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductDetails.ProductDetail", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductDetails"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductHistories.ProductHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("ModificationTime") + .HasColumnType("datetime2"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedEntityData") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ModificationTime"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductHistories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductInventories.ProductInventory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Inventory") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductSkuId") + .HasColumnType("uniqueidentifier"); + + b.Property("Sold") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProductSkuId"); + + b.ToTable("EasyAbpEShopProductsProductInventories"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.ProductStores.ProductStore", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsOwner") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopProductsProductStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("InventoryStrategy") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("IsHidden") + .HasColumnType("bit"); + + b.Property("IsPublished") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("UniqueName") + .HasColumnType("nvarchar(450)"); + + b.HasKey("Id"); + + b.HasIndex("UniqueName") + .IsUnique() + .HasFilter("[UniqueName] IS NOT NULL"); + + b.ToTable("EasyAbpEShopProductsProducts"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductAttributes"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("DisplayOrder") + .HasColumnType("int"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductAttributeId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("ProductAttributeId"); + + b.ToTable("EasyAbpEShopProductsProductAttributeOptions"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("MediaResources") + .HasColumnType("nvarchar(max)"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderMaxQuantity") + .HasColumnType("int"); + + b.Property("OrderMinQuantity") + .HasColumnType("int"); + + b.Property("OriginalPrice") + .HasColumnType("decimal(20,8)"); + + b.Property("Price") + .HasColumnType("decimal(20,8)"); + + b.Property("ProductDetailId") + .HasColumnType("uniqueidentifier"); + + b.Property("ProductId") + .HasColumnType("uniqueidentifier"); + + b.Property("SerializedAttributeOptionIds") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("ProductId"); + + b.ToTable("EasyAbpEShopProductsProductSkus"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.StoreOwners.StoreOwner", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OwnerUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("OwnerUserId", "StoreId") + .IsUnique(); + + b.ToTable("EasyAbpEShopStoresStoreOwners"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Stores.Store", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresStores"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Stores.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("Amount") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OrderId") + .HasColumnType("uniqueidentifier"); + + b.Property("StoreId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpEShopStoresTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.Payment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletionTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PayeeAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServicePayments"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ActualPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ItemKey") + .HasColumnType("nvarchar(max)"); + + b.Property("ItemType") + .HasColumnType("nvarchar(max)"); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("OriginalPaymentAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentDiscount") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PendingRefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServicePaymentItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Accounts.Account", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountGroupName") + .HasColumnType("nvarchar(max)"); + + b.Property("Balance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentAccounts"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Prepayment.Transactions.Transaction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccountId") + .HasColumnType("uniqueidentifier"); + + b.Property("AccountUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("ActionName") + .HasColumnType("nvarchar(max)"); + + b.Property("ChangedBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("OriginalBalance") + .HasColumnType("decimal(20,8)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TransactionType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("AccountId"); + + b.HasIndex("AccountUserId"); + + b.ToTable("EasyAbpPaymentServicePrepaymentTransactions"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.Refund", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CanceledTime") + .HasColumnType("datetime2"); + + b.Property("CompletedTime") + .HasColumnType("datetime2"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Currency") + .HasColumnType("nvarchar(max)"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayReason") + .HasColumnType("nvarchar(max)"); + + b.Property("ExternalTradingCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundPaymentMethod") + .HasColumnType("nvarchar(max)"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.ToTable("EasyAbpPaymentServiceRefunds"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("CustomerRemark") + .HasColumnType("nvarchar(max)"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("PaymentItemId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAmount") + .HasColumnType("decimal(20,8)"); + + b.Property("RefundId") + .HasColumnType("uniqueidentifier"); + + b.Property("StaffRemark") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("RefundId"); + + b.ToTable("EasyAbpPaymentServiceRefundItems"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.PaymentRecords.PaymentRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("Attach") + .HasColumnType("nvarchar(max)"); + + b.Property("BankType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponCount") + .HasColumnType("int"); + + b.Property("CouponFee") + .HasColumnType("int"); + + b.Property("CouponFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeviceInfo") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ErrCodeDes") + .HasColumnType("nvarchar(max)"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("IsSubscribe") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("Openid") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("ResultCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TimeEnd") + .HasColumnType("nvarchar(max)"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TradeType") + .HasColumnType("nvarchar(max)"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayPaymentRecords"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.WeChatPay.RefundRecords.RefundRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AppId") + .HasColumnType("nvarchar(max)"); + + b.Property("CashFee") + .HasColumnType("int"); + + b.Property("CashFeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("CashRefundFee") + .HasColumnType("int"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CouponIds") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponRefundCount") + .HasColumnType("int"); + + b.Property("CouponRefundFee") + .HasColumnType("int"); + + b.Property("CouponRefundFees") + .HasColumnType("nvarchar(max)"); + + b.Property("CouponTypes") + .HasColumnType("nvarchar(max)"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FeeType") + .HasColumnType("nvarchar(max)"); + + b.Property("MchId") + .HasColumnType("nvarchar(max)"); + + b.Property("OutRefundNo") + .HasColumnType("nvarchar(max)"); + + b.Property("OutTradeNo") + .HasColumnType("nvarchar(max)"); + + b.Property("PaymentId") + .HasColumnType("uniqueidentifier"); + + b.Property("RefundAccount") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundFee") + .HasColumnType("int"); + + b.Property("RefundId") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRecvAccout") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundRequestSource") + .HasColumnType("nvarchar(max)"); + + b.Property("RefundStatus") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnCode") + .HasColumnType("nvarchar(max)"); + + b.Property("ReturnMsg") + .HasColumnType("nvarchar(max)"); + + b.Property("SettlementRefundFee") + .HasColumnType("int"); + + b.Property("SettlementTotalFee") + .HasColumnType("int"); + + b.Property("SuccessTime") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TotalFee") + .HasColumnType("int"); + + b.Property("TransactionId") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.HasIndex("PaymentId"); + + b.ToTable("EasyAbpPaymentServiceWeChatPayRefundRecords"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ApplicationName") + .HasColumnName("ApplicationName") + .HasColumnType("nvarchar(96)") + .HasMaxLength(96); + + b.Property("BrowserInfo") + .HasColumnName("BrowserInfo") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("ClientId") + .HasColumnName("ClientId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientIpAddress") + .HasColumnName("ClientIpAddress") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ClientName") + .HasColumnName("ClientName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Comments") + .HasColumnName("Comments") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CorrelationId") + .HasColumnName("CorrelationId") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Exceptions") + .HasColumnName("Exceptions") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("HttpMethod") + .HasColumnName("HttpMethod") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("HttpStatusCode") + .HasColumnName("HttpStatusCode") + .HasColumnType("int"); + + b.Property("ImpersonatorTenantId") + .HasColumnName("ImpersonatorTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("ImpersonatorUserId") + .HasColumnName("ImpersonatorUserId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantName") + .HasColumnType("nvarchar(max)"); + + b.Property("Url") + .HasColumnName("Url") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("UserId") + .HasColumnName("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserName") + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("TenantId", "ExecutionTime"); + + b.HasIndex("TenantId", "UserId", "ExecutionTime"); + + b.ToTable("AbpAuditLogs"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ExecutionDuration") + .HasColumnName("ExecutionDuration") + .HasColumnType("int"); + + b.Property("ExecutionTime") + .HasColumnName("ExecutionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("MethodName") + .HasColumnName("MethodName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Parameters") + .HasColumnName("Parameters") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ServiceName") + .HasColumnName("ServiceName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); + + b.ToTable("AbpAuditLogActions"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AuditLogId") + .HasColumnName("AuditLogId") + .HasColumnType("uniqueidentifier"); + + b.Property("ChangeTime") + .HasColumnName("ChangeTime") + .HasColumnType("datetime2"); + + b.Property("ChangeType") + .HasColumnName("ChangeType") + .HasColumnType("tinyint"); + + b.Property("EntityId") + .IsRequired() + .HasColumnName("EntityId") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("EntityTenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("EntityTypeFullName") + .IsRequired() + .HasColumnName("EntityTypeFullName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("AuditLogId"); + + b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); + + b.ToTable("AbpEntityChanges"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("EntityChangeId") + .HasColumnType("uniqueidentifier"); + + b.Property("NewValue") + .HasColumnName("NewValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("OriginalValue") + .HasColumnName("OriginalValue") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("PropertyName") + .IsRequired() + .HasColumnName("PropertyName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("PropertyTypeFullName") + .IsRequired() + .HasColumnName("PropertyTypeFullName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("EntityChangeId"); + + b.ToTable("AbpEntityPropertyChanges"); + }); + + modelBuilder.Entity("Volo.Abp.BackgroundJobs.BackgroundJobRecord", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsAbandoned") + .ValueGeneratedOnAdd() + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("JobArgs") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(1048576); + + b.Property("JobName") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("LastTryTime") + .HasColumnType("datetime2"); + + b.Property("NextTryTime") + .HasColumnType("datetime2"); + + b.Property("Priority") + .ValueGeneratedOnAdd() + .HasColumnType("tinyint") + .HasDefaultValue((byte)15); + + b.Property("TryCount") + .ValueGeneratedOnAdd() + .HasColumnType("smallint") + .HasDefaultValue((short)0); + + b.HasKey("Id"); + + b.HasIndex("IsAbandoned", "NextTryTime"); + + b.ToTable("AbpBackgroundJobs"); + }); + + modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpFeatureValues"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityClaimType", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("Description") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Regex") + .HasColumnType("nvarchar(512)") + .HasMaxLength(512); + + b.Property("RegexDescription") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ValueType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("AbpClaimTypes"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDefault") + .HasColumnName("IsDefault") + .HasColumnType("bit"); + + b.Property("IsPublic") + .HasColumnName("IsPublic") + .HasColumnType("bit"); + + b.Property("IsStatic") + .HasColumnName("IsStatic") + .HasColumnType("bit"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName"); + + b.ToTable("AbpRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AbpRoleClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AccessFailedCount") + .ValueGeneratedOnAdd() + .HasColumnName("AccessFailedCount") + .HasColumnType("int") + .HasDefaultValue(0); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Email") + .IsRequired() + .HasColumnName("Email") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("EmailConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LockoutEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("LockoutEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LockoutEnd") + .HasColumnType("datetimeoffset"); + + b.Property("Name") + .HasColumnName("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("NormalizedEmail") + .IsRequired() + .HasColumnName("NormalizedEmail") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .IsRequired() + .HasColumnName("NormalizedUserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnName("PasswordHash") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("PhoneNumber") + .HasColumnName("PhoneNumber") + .HasColumnType("nvarchar(16)") + .HasMaxLength(16); + + b.Property("PhoneNumberConfirmed") + .ValueGeneratedOnAdd() + .HasColumnName("PhoneNumberConfirmed") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("SecurityStamp") + .IsRequired() + .HasColumnName("SecurityStamp") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("Surname") + .HasColumnName("Surname") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("TwoFactorEnabled") + .ValueGeneratedOnAdd() + .HasColumnName("TwoFactorEnabled") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("UserName") + .IsRequired() + .HasColumnName("UserName") + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("Email"); + + b.HasIndex("NormalizedEmail"); + + b.HasIndex("NormalizedUserName"); + + b.HasIndex("UserName"); + + b.ToTable("AbpUsers"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("ClaimType") + .IsRequired() + .HasColumnType("nvarchar(256)") + .HasMaxLength(256); + + b.Property("ClaimValue") + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AbpUserClaims"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderDisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(196)") + .HasMaxLength(196); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "LoginProvider"); + + b.HasIndex("LoginProvider", "ProviderKey"); + + b.ToTable("AbpUserLogins"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "UserId"); + + b.HasIndex("UserId", "OrganizationUnitId"); + + b.ToTable("AbpUserOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId", "UserId"); + + b.ToTable("AbpUserRoles"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("uniqueidentifier"); + + b.Property("LoginProvider") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Name") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Value") + .HasColumnType("nvarchar(max)"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AbpUserTokens"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Code") + .IsRequired() + .HasColumnName("Code") + .HasColumnType("nvarchar(95)") + .HasMaxLength(95); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnName("DisplayName") + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("ParentId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Code"); + + b.HasIndex("ParentId"); + + b.ToTable("AbpOrganizationUnits"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.Property("OrganizationUnitId") + .HasColumnType("uniqueidentifier"); + + b.Property("RoleId") + .HasColumnType("uniqueidentifier"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("OrganizationUnitId", "RoleId"); + + b.HasIndex("RoleId", "OrganizationUnitId"); + + b.ToTable("AbpOrganizationUnitRoles"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerApiResources"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Type"); + + b.ToTable("IdentityServerApiClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("ApiResourceId", "Name"); + + b.ToTable("IdentityServerApiScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ApiResourceId", "Name", "Type"); + + b.ToTable("IdentityServerApiScopeClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.Property("ApiResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ApiResourceId", "Type", "Value"); + + b.ToTable("IdentityServerApiSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("AbsoluteRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenLifetime") + .HasColumnType("int"); + + b.Property("AccessTokenType") + .HasColumnType("int"); + + b.Property("AllowAccessTokensViaBrowser") + .HasColumnType("bit"); + + b.Property("AllowOfflineAccess") + .HasColumnType("bit"); + + b.Property("AllowPlainTextPkce") + .HasColumnType("bit"); + + b.Property("AllowRememberConsent") + .HasColumnType("bit"); + + b.Property("AlwaysIncludeUserClaimsInIdToken") + .HasColumnType("bit"); + + b.Property("AlwaysSendClientClaims") + .HasColumnType("bit"); + + b.Property("AuthorizationCodeLifetime") + .HasColumnType("int"); + + b.Property("BackChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("BackChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ClientClaimsPrefix") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("ConsentLifetime") + .HasColumnType("int"); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DeviceCodeLifetime") + .HasColumnType("int"); + + b.Property("EnableLocalLogin") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("FrontChannelLogoutSessionRequired") + .HasColumnType("bit"); + + b.Property("FrontChannelLogoutUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("IdentityTokenLifetime") + .HasColumnType("int"); + + b.Property("IncludeJwtId") + .HasColumnType("bit"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("LogoUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("PairWiseSubjectSalt") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ProtocolType") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("RefreshTokenExpiration") + .HasColumnType("int"); + + b.Property("RefreshTokenUsage") + .HasColumnType("int"); + + b.Property("RequireClientSecret") + .HasColumnType("bit"); + + b.Property("RequireConsent") + .HasColumnType("bit"); + + b.Property("RequirePkce") + .HasColumnType("bit"); + + b.Property("SlidingRefreshTokenLifetime") + .HasColumnType("int"); + + b.Property("UpdateAccessTokenClaimsOnRefresh") + .HasColumnType("bit"); + + b.Property("UserCodeType") + .HasColumnType("nvarchar(100)") + .HasMaxLength(100); + + b.Property("UserSsoLifetime") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.ToTable("IdentityServerClients"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Origin") + .HasColumnType("nvarchar(150)") + .HasMaxLength(150); + + b.HasKey("ClientId", "Origin"); + + b.ToTable("IdentityServerClientCorsOrigins"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("GrantType") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.HasKey("ClientId", "GrantType"); + + b.ToTable("IdentityServerClientGrantTypes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Provider") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Provider"); + + b.ToTable("IdentityServerClientIdPRestrictions"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("PostLogoutRedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "PostLogoutRedirectUri"); + + b.ToTable("IdentityServerClientPostLogoutRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Key") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "Key"); + + b.ToTable("IdentityServerClientProperties"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("RedirectUri") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.HasKey("ClientId", "RedirectUri"); + + b.ToTable("IdentityServerClientRedirectUris"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Scope") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("ClientId", "Scope"); + + b.ToTable("IdentityServerClientScopes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.Property("ClientId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(250)") + .HasMaxLength(250); + + b.Property("Value") + .HasColumnType("nvarchar(4000)") + .HasMaxLength(4000); + + b.Property("Description") + .HasColumnType("nvarchar(2000)") + .HasMaxLength(2000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.HasKey("ClientId", "Type", "Value"); + + b.ToTable("IdentityServerClientSecrets"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Devices.DeviceFlowCodes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("DeviceCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Expiration") + .IsRequired() + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("UserCode") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("Id"); + + b.HasIndex("DeviceCode") + .IsUnique(); + + b.HasIndex("Expiration"); + + b.HasIndex("UserCode") + .IsUnique(); + + b.ToTable("IdentityServerDeviceFlowCodes"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Grants.PersistedGrant", b => + { + b.Property("Key") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnType("datetime2"); + + b.Property("Data") + .IsRequired() + .HasColumnType("nvarchar(max)") + .HasMaxLength(50000); + + b.Property("Expiration") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("Id") + .HasColumnType("uniqueidentifier"); + + b.Property("SubjectId") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Type") + .IsRequired() + .HasColumnType("nvarchar(50)") + .HasMaxLength(50); + + b.HasKey("Key"); + + b.HasIndex("Expiration"); + + b.HasIndex("SubjectId", "ClientId", "Type"); + + b.ToTable("IdentityServerPersistedGrants"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.Property("IdentityResourceId") + .HasColumnType("uniqueidentifier"); + + b.Property("Type") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.HasKey("IdentityResourceId", "Type"); + + b.ToTable("IdentityServerIdentityClaims"); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("Description") + .HasColumnType("nvarchar(1000)") + .HasMaxLength(1000); + + b.Property("DisplayName") + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Emphasize") + .HasColumnType("bit"); + + b.Property("Enabled") + .HasColumnType("bit"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(200)") + .HasMaxLength(200); + + b.Property("Properties") + .HasColumnType("nvarchar(max)"); + + b.Property("Required") + .HasColumnType("bit"); + + b.Property("ShowInDiscoveryDocument") + .HasColumnType("bit"); + + b.HasKey("Id"); + + b.ToTable("IdentityServerIdentityResources"); + }); + + modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("TenantId") + .HasColumnName("TenantId") + .HasColumnType("uniqueidentifier"); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpPermissionGrants"); + }); + + modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(128)") + .HasMaxLength(128); + + b.Property("ProviderKey") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("ProviderName") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(2048)") + .HasMaxLength(2048); + + b.HasKey("Id"); + + b.HasIndex("Name", "ProviderName", "ProviderKey"); + + b.ToTable("AbpSettings"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uniqueidentifier"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnName("ConcurrencyStamp") + .HasColumnType("nvarchar(40)") + .HasMaxLength(40); + + b.Property("CreationTime") + .HasColumnName("CreationTime") + .HasColumnType("datetime2"); + + b.Property("CreatorId") + .HasColumnName("CreatorId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeleterId") + .HasColumnName("DeleterId") + .HasColumnType("uniqueidentifier"); + + b.Property("DeletionTime") + .HasColumnName("DeletionTime") + .HasColumnType("datetime2"); + + b.Property("ExtraProperties") + .HasColumnName("ExtraProperties") + .HasColumnType("nvarchar(max)"); + + b.Property("IsDeleted") + .ValueGeneratedOnAdd() + .HasColumnName("IsDeleted") + .HasColumnType("bit") + .HasDefaultValue(false); + + b.Property("LastModificationTime") + .HasColumnName("LastModificationTime") + .HasColumnType("datetime2"); + + b.Property("LastModifierId") + .HasColumnName("LastModifierId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .IsRequired() + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.HasKey("Id"); + + b.HasIndex("Name"); + + b.ToTable("AbpTenants"); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.Property("TenantId") + .HasColumnType("uniqueidentifier"); + + b.Property("Name") + .HasColumnType("nvarchar(64)") + .HasMaxLength(64); + + b.Property("Value") + .IsRequired() + .HasColumnType("nvarchar(1024)") + .HasMaxLength(1024); + + b.HasKey("TenantId", "Name"); + + b.ToTable("AbpTenantConnectionStrings"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Orders.Orders.OrderLine", b => + { + b.HasOne("EasyAbp.EShop.Orders.Orders.Order", null) + .WithMany("OrderLines") + .HasForeignKey("OrderId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Payments.Refunds.RefundItemOrderLine", b => + { + b.HasOne("EasyAbp.EShop.Payments.Refunds.RefundItem", null) + .WithMany("RefundItemOrderLines") + .HasForeignKey("RefundItemId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Categories.Category", b => + { + b.HasOne("EasyAbp.EShop.Products.Categories.Category", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttribute", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductAttributes") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductAttributeOption", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.ProductAttribute", null) + .WithMany("ProductAttributeOptions") + .HasForeignKey("ProductAttributeId"); + }); + + modelBuilder.Entity("EasyAbp.EShop.Products.Products.ProductSku", b => + { + b.HasOne("EasyAbp.EShop.Products.Products.Product", null) + .WithMany("ProductSkus") + .HasForeignKey("ProductId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Payments.PaymentItem", b => + { + b.HasOne("EasyAbp.PaymentService.Payments.Payment", null) + .WithMany("PaymentItems") + .HasForeignKey("PaymentId"); + }); + + modelBuilder.Entity("EasyAbp.PaymentService.Refunds.RefundItem", b => + { + b.HasOne("EasyAbp.PaymentService.Refunds.Refund", null) + .WithMany("RefundItems") + .HasForeignKey("RefundId"); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("Actions") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) + .WithMany("EntityChanges") + .HasForeignKey("AuditLogId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => + { + b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) + .WithMany("PropertyChanges") + .HasForeignKey("EntityChangeId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityRoleClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany("Claims") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserClaim", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Claims") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserLogin", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Logins") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserOrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("OrganizationUnits") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserRole", b => + { + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Roles") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.IdentityUserToken", b => + { + b.HasOne("Volo.Abp.Identity.IdentityUser", null) + .WithMany("Tokens") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnit", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany() + .HasForeignKey("ParentId"); + }); + + modelBuilder.Entity("Volo.Abp.Identity.OrganizationUnitRole", b => + { + b.HasOne("Volo.Abp.Identity.OrganizationUnit", null) + .WithMany("Roles") + .HasForeignKey("OrganizationUnitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Volo.Abp.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiResourceClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Scopes") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiScopeClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiScope", null) + .WithMany("UserClaims") + .HasForeignKey("ApiResourceId", "Name") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.ApiResources.ApiSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.ApiResources.ApiResource", null) + .WithMany("Secrets") + .HasForeignKey("ApiResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Claims") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientCorsOrigin", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedCorsOrigins") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientGrantType", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedGrantTypes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientIdPRestriction", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("IdentityProviderRestrictions") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientPostLogoutRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("PostLogoutRedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientProperty", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("Properties") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientRedirectUri", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("RedirectUris") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientScope", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("AllowedScopes") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.Clients.ClientSecret", b => + { + b.HasOne("Volo.Abp.IdentityServer.Clients.Client", null) + .WithMany("ClientSecrets") + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.IdentityServer.IdentityResources.IdentityClaim", b => + { + b.HasOne("Volo.Abp.IdentityServer.IdentityResources.IdentityResource", null) + .WithMany("UserClaims") + .HasForeignKey("IdentityResourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => + { + b.HasOne("Volo.Abp.TenantManagement.Tenant", null) + .WithMany("ConnectionStrings") + .HasForeignKey("TenantId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.cs new file mode 100644 index 00000000..bf31f679 --- /dev/null +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/20200901104922_RemovedProductTypeEntity.cs @@ -0,0 +1,89 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace EShopSample.Migrations +{ + public partial class RemovedProductTypeEntity : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "EasyAbpEShopProductsProductTypes"); + + migrationBuilder.DropColumn( + name: "ProductTypeId", + table: "EasyAbpEShopProductsProducts"); + + migrationBuilder.DropColumn( + name: "ProductTypeUniqueName", + table: "EasyAbpEShopOrdersOrderLines"); + + migrationBuilder.AddColumn( + name: "ProductGroupName", + table: "EasyAbpEShopProductsProducts", + nullable: true); + + migrationBuilder.AddColumn( + name: "ProductGroupDisplayName", + table: "EasyAbpEShopOrdersOrderLines", + nullable: true); + + migrationBuilder.AddColumn( + name: "ProductGroupName", + table: "EasyAbpEShopOrdersOrderLines", + nullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "ProductGroupName", + table: "EasyAbpEShopProductsProducts"); + + migrationBuilder.DropColumn( + name: "ProductGroupDisplayName", + table: "EasyAbpEShopOrdersOrderLines"); + + migrationBuilder.DropColumn( + name: "ProductGroupName", + table: "EasyAbpEShopOrdersOrderLines"); + + migrationBuilder.AddColumn( + name: "ProductTypeId", + table: "EasyAbpEShopProductsProducts", + type: "uniqueidentifier", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.AddColumn( + name: "ProductTypeUniqueName", + table: "EasyAbpEShopOrdersOrderLines", + type: "nvarchar(max)", + nullable: true); + + migrationBuilder.CreateTable( + name: "EasyAbpEShopProductsProductTypes", + columns: table => new + { + Id = table.Column(type: "uniqueidentifier", nullable: false), + ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), + CreationTime = table.Column(type: "datetime2", nullable: false), + CreatorId = table.Column(type: "uniqueidentifier", nullable: true), + DeleterId = table.Column(type: "uniqueidentifier", nullable: true), + DeletionTime = table.Column(type: "datetime2", nullable: true), + Description = table.Column(type: "nvarchar(max)", nullable: true), + DisplayName = table.Column(type: "nvarchar(max)", nullable: true), + ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), + IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), + LastModificationTime = table.Column(type: "datetime2", nullable: true), + LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), + MultiTenancySide = table.Column(type: "int", nullable: false), + UniqueName = table.Column(type: "nvarchar(max)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_EasyAbpEShopProductsProductTypes", x => x.Id); + }); + } + } +} diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs index a6415681..5ad6be79 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore.DbMigrations/Migrations/EShopSampleMigrationsDbContextModelSnapshot.cs @@ -191,6 +191,12 @@ namespace EShopSample.Migrations b.Property("ProductDisplayName") .HasColumnType("nvarchar(max)"); + b.Property("ProductGroupDisplayName") + .HasColumnType("nvarchar(max)"); + + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); + b.Property("ProductId") .HasColumnType("uniqueidentifier"); @@ -200,9 +206,6 @@ namespace EShopSample.Migrations b.Property("ProductSkuId") .HasColumnType("uniqueidentifier"); - b.Property("ProductTypeUniqueName") - .HasColumnType("nvarchar(max)"); - b.Property("ProductUniqueName") .HasColumnType("nvarchar(max)"); @@ -1115,69 +1118,6 @@ namespace EShopSample.Migrations b.ToTable("EasyAbpEShopProductsProductStores"); }); - modelBuilder.Entity("EasyAbp.EShop.Products.ProductTypes.ProductType", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("uniqueidentifier"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnName("ConcurrencyStamp") - .HasColumnType("nvarchar(40)") - .HasMaxLength(40); - - b.Property("CreationTime") - .HasColumnName("CreationTime") - .HasColumnType("datetime2"); - - b.Property("CreatorId") - .HasColumnName("CreatorId") - .HasColumnType("uniqueidentifier"); - - b.Property("DeleterId") - .HasColumnName("DeleterId") - .HasColumnType("uniqueidentifier"); - - b.Property("DeletionTime") - .HasColumnName("DeletionTime") - .HasColumnType("datetime2"); - - b.Property("Description") - .HasColumnType("nvarchar(max)"); - - b.Property("DisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("ExtraProperties") - .HasColumnName("ExtraProperties") - .HasColumnType("nvarchar(max)"); - - b.Property("IsDeleted") - .ValueGeneratedOnAdd() - .HasColumnName("IsDeleted") - .HasColumnType("bit") - .HasDefaultValue(false); - - b.Property("LastModificationTime") - .HasColumnName("LastModificationTime") - .HasColumnType("datetime2"); - - b.Property("LastModifierId") - .HasColumnName("LastModifierId") - .HasColumnType("uniqueidentifier"); - - b.Property("MultiTenancySide") - .HasColumnType("int"); - - b.Property("UniqueName") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("EasyAbpEShopProductsProductTypes"); - }); - modelBuilder.Entity("EasyAbp.EShop.Products.Products.Product", b => { b.Property("Id") @@ -1248,8 +1188,8 @@ namespace EShopSample.Migrations b.Property("ProductDetailId") .HasColumnType("uniqueidentifier"); - b.Property("ProductTypeId") - .HasColumnType("uniqueidentifier"); + b.Property("ProductGroupName") + .HasColumnType("nvarchar(max)"); b.Property("UniqueName") .HasColumnType("nvarchar(450)"); From d5901fc78dd9fb0c989efac4f022403a1deb8fba Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Wed, 2 Sep 2020 15:52:40 +0800 Subject: [PATCH 24/24] Rename GenerateNewOrderLineAsync to GenerateOrderLineAsync Add param "orderExtraProperties" to GenerateOrderLineAsync --- common.props | 2 +- .../EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/common.props b/common.props index 00da413f..f94ff832 100644 --- a/common.props +++ b/common.props @@ -1,7 +1,7 @@ latest - 0.12.0 + 0.13.0 $(NoWarn);CS1591 true EasyAbp Team diff --git a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs index 0b7bfc87..59c47ac5 100644 --- a/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs +++ b/modules/EasyAbp.EShop.Orders/src/EasyAbp.EShop.Orders.Application/EasyAbp/EShop/Orders/Orders/NewOrderGenerator.cs @@ -44,7 +44,7 @@ namespace EasyAbp.EShop.Orders.Orders foreach (var orderLine in input.OrderLines) { - orderLines.Add(await GenerateNewOrderLineAsync(orderLine, productDict)); + orderLines.Add(await GenerateOrderLineAsync(orderLine, productDict, orderExtraProperties)); } var productTotalPrice = orderLines.Select(x => x.TotalPrice).Sum(); @@ -77,7 +77,7 @@ namespace EasyAbp.EShop.Orders.Orders return order; } - protected virtual async Task GenerateNewOrderLineAsync(CreateOrderLineDto input, Dictionary productDict) + protected virtual async Task GenerateOrderLineAsync(CreateOrderLineDto input, Dictionary productDict, Dictionary orderExtraProperties) { var product = productDict[input.ProductId]; var productSku = product.GetSkuById(input.ProductSkuId);