From dfb77cd8fa67105b1ea948325ff91ea0506ac8e1 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Tue, 28 Mar 2023 15:14:28 +0800 Subject: [PATCH] Initialize the new `Promotions` plugin module --- EShop.sln | 121 ++++++++ plugins/Promotions/.gitattributes | 1 + plugins/Promotions/.gitignore | 262 ++++++++++++++++++ plugins/Promotions/.prettierrc | 5 + ...syAbp.EShop.Plugins.Promotions.abpmdl.json | 111 ++++++++ ...syAbp.EShop.Plugins.Promotions.abpsln.json | 7 + .../EasyAbp.EShop.Plugins.Promotions.sln | 146 ++++++++++ ...p.EShop.Plugins.Promotions.sln.DotSettings | 23 ++ plugins/Promotions/NuGet.Config | 5 + ...Plugins.Promotions.Host.Shared.abppkg.json | 1 + ...Shop.Plugins.Promotions.Host.Shared.csproj | 11 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MultiTenancy/MultiTenancyConsts.cs | 9 + ...omotions.Application.Contracts.abppkg.json | 3 + ...ns.Promotions.Application.Contracts.csproj | 17 ++ ...insPromotionsApplicationContractsModule.cs | 15 + .../PromotionsPermissionDefinitionProvider.cs | 18 ++ .../Permissions/PromotionsPermissions.cs | 13 + .../PromotionsRemoteServiceConsts.cs | 8 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Plugins.Promotions.Application.abppkg.json | 3 + ...Shop.Plugins.Promotions.Application.csproj | 18 ++ .../EShopPluginsPromotionsAppService.cs | 13 + ...EShopPluginsPromotionsApplicationModule.cs | 24 ++ .../PromotionsApplicationAutoMapperProfile.cs | 13 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...ugins.Promotions.Domain.Shared.abppkg.json | 3 + ...op.Plugins.Promotions.Domain.Shared.csproj | 25 ++ ...ShopPluginsPromotionsDomainSharedModule.cs | 36 +++ .../Localization/PromotionsResource.cs | 9 + .../Plugins/Promotions/Localization/en.json | 5 + .../Promotions/Localization/zh-Hans.json | 5 + .../Promotions/Localization/zh-Hant.json | 5 + .../Promotions/PromotionsErrorCodes.cs | 6 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Shop.Plugins.Promotions.Domain.abppkg.json | 3 + ...Abp.EShop.Plugins.Promotions.Domain.csproj | 16 ++ .../EShopPluginsPromotionsDomainModule.cs | 13 + .../Promotions/PromotionsDbProperties.cs | 10 + .../PromotionsSettingDefinitionProvider.cs | 13 + .../Promotions/Settings/PromotionsSettings.cs | 10 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...Promotions.EntityFrameworkCore.abppkg.json | 3 + ...gins.Promotions.EntityFrameworkCore.csproj | 20 ++ ...ginsPromotionsEntityFrameworkCoreModule.cs | 22 ++ .../IPromotionsDbContext.cs | 12 + .../PromotionsDbContext.cs | 26 ++ ...motionsDbContextModelCreatingExtensions.cs | 33 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...gins.Promotions.HttpApi.Client.abppkg.json | 3 + ...p.Plugins.Promotions.HttpApi.Client.csproj | 21 ++ ...hopPluginsPromotionsHttpApiClientModule.cs | 26 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...hop.Plugins.Promotions.HttpApi.abppkg.json | 3 + ...bp.EShop.Plugins.Promotions.HttpApi.csproj | 16 ++ .../EShopPluginsPromotionsHttpApiModule.cs | 32 +++ .../Promotions/PromotionsController.cs | 12 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ....EShop.Plugins.Promotions.Installer.csproj | 21 ++ .../EShopPluginsPromotionsInstallerModule.cs | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ ...hop.Plugins.Promotions.MongoDB.abppkg.json | 3 + ...bp.EShop.Plugins.Promotions.MongoDB.csproj | 20 ++ .../EShopPluginsPromotionsMongoDbModule.cs | 22 ++ .../MongoDB/IPromotionsMongoDbContext.cs | 12 + .../MongoDB/PromotionsMongoDbContext.cs | 19 ++ .../PromotionsMongoDbContextExtensions.cs | 13 + .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../EShopPluginsPromotionsWebModule.cs | 58 ++++ ...p.EShop.Plugins.Promotions.Web.abppkg.json | 3 + ...asyAbp.EShop.Plugins.Promotions.Web.csproj | 45 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../Menus/PromotionsMenuContributor.cs | 22 ++ .../Menus/PromotionsMenus.cs | 10 + .../Pages/PromotionsPageModel.cs | 15 + .../Pages/_ViewImports.cshtml | 4 + .../PromotionsWebAutoMapperProfile.cs | 13 + .../Properties/launchSettings.json | 12 + ...s.Promotions.Application.Tests.abppkg.json | 3 + ...lugins.Promotions.Application.Tests.csproj | 17 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsApplicationTestBase.cs | 9 + .../PromotionsApplicationTestModule.cs | 12 + ...lugins.Promotions.Domain.Tests.abppkg.json | 3 + ...hop.Plugins.Promotions.Domain.Tests.csproj | 16 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsDomainTestBase.cs | 9 + .../PromotionsDomainTestModule.cs | 16 ++ ...ions.EntityFrameworkCore.Tests.abppkg.json | 3 + ...romotions.EntityFrameworkCore.Tests.csproj | 19 ++ .../PromotionsEntityFrameworkCoreTestBase.cs | 9 + ...PromotionsEntityFrameworkCoreTestModule.cs | 45 +++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../ClientDemoService.cs | 143 ++++++++++ .../ConsoleTestAppHostedService.cs | 40 +++ ....HttpApi.Client.ConsoleTestApp.abppkg.json | 1 + ...tions.HttpApi.Client.ConsoleTestApp.csproj | 33 +++ .../Program.cs | 22 ++ .../PromotionsConsoleApiClientModule.cs | 15 + .../appsettings.json | 21 ++ .../appsettings.secrets.json | 2 + ...ugins.Promotions.MongoDB.Tests.abppkg.json | 3 + ...op.Plugins.Promotions.MongoDB.Tests.csproj | 18 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../MongoDB/MongoDbFixture.cs | 21 ++ .../MongoDB/MongoTestCollection.cs | 9 + .../MongoDB/PromotionsMongoDbTestBase.cs | 9 + .../MongoDB/PromotionsMongoDbTestModule.cs | 26 ++ ...op.Plugins.Promotions.TestBase.abppkg.json | 1 + ...p.EShop.Plugins.Promotions.TestBase.csproj | 28 ++ .../FodyWeavers.xml | 3 + .../FodyWeavers.xsd | 30 ++ .../PromotionsDataSeedContributor.cs | 32 +++ .../PromotionsTestBase.cs | 59 ++++ .../PromotionsTestBaseModule.cs | 41 +++ .../Security/FakeCurrentPrincipalAccessor.cs | 27 ++ .../EShopSample.Application.Contracts.csproj | 1 + .../EShopSample.Application.csproj | 1 + .../EShopSample.Domain.Shared.csproj | 1 + .../EShopSample.Domain.csproj | 1 + .../EShopSample.EntityFrameworkCore.csproj | 1 + .../EShopSample.HttpApi.Client.csproj | 1 + .../EShopSample.HttpApi.csproj | 1 + .../EShopSample.Web/EShopSample.Web.csproj | 1 + .../EShopSample.Web/EShopSampleWebModule.cs | 9 + .../src/EShopSample.Web/Pages/Index.cshtml | 6 + 141 files changed, 2808 insertions(+) create mode 100644 plugins/Promotions/.gitattributes create mode 100644 plugins/Promotions/.gitignore create mode 100644 plugins/Promotions/.prettierrc create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln create mode 100644 plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings create mode 100644 plugins/Promotions/NuGet.Config create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd create mode 100644 plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs create mode 100644 plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs create mode 100644 plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs diff --git a/EShop.sln b/EShop.sln index 15b9023c..dff3e078 100644 --- a/EShop.sln +++ b/EShop.sln @@ -469,6 +469,44 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Products.Plug EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests", "plugins\FlashSales\test\EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests\EasyAbp.EShop.Orders.Plugins.FlashSales.Application.Tests.csproj", "{17A3486C-1845-4B4E-B1A6-752106F0C309}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Promotions", "Promotions", "{5DF280FF-28A9-4406-8D7A-1E10150B9AB0}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2661CE36-99D1-4D28-A956-6581552F8889}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Application\EasyAbp.EShop.Plugins.Promotions.Application.csproj", "{7E8FB015-17C9-4170-86DD-2A588F0C328A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application.Contracts", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Application.Contracts\EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj", "{3F40E7BB-A864-440B-91D5-5EBA0F52514B}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Domain\EasyAbp.EShop.Plugins.Promotions.Domain.csproj", "{C8AE050A-D84F-4487-98F1-0992DCB54E22}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Shared", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Domain.Shared\EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj", "{29EB001D-B020-4380-B0F6-C3C4EAD63C29}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj", "{A03EAB5F-C165-452C-8CFD-EBF2E935C599}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.HttpApi\EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj", "{4F349BA1-4EAD-4690-B271-9B920BDD2DF6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj", "{35894E48-7E52-475F-AB6F-DB9E73010271}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Installer", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Installer\EasyAbp.EShop.Plugins.Promotions.Installer.csproj", "{FA8FA705-5675-44FB-B9B0-60B32885C7B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.MongoDB\EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj", "{F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Web", "plugins\Promotions\src\EasyAbp.EShop.Plugins.Promotions.Web\EasyAbp.EShop.Plugins.Promotions.Web.csproj", "{A31CA5E7-4E45-4572-8CF4-67C4316CE47A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9AE8FE82-7A05-4E2A-98E2-A98F5845B02A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Application.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.Application.Tests\EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj", "{6485CCBD-EC99-468B-B005-886F2AD5AA9A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.Domain.Tests\EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj", "{3EE730D4-C8F6-4729-AD34-A7A485E3B932}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj", "{846C3769-2DC7-441F-94C1-714B30110FC5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj", "{5F0FE595-625E-4657-ADF2-25F0803D4578}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj", "{B43EB182-F725-4DBD-891B-E576A5B8D2D2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.TestBase", "plugins\Promotions\test\EasyAbp.EShop.Plugins.Promotions.TestBase\EasyAbp.EShop.Plugins.Promotions.TestBase.csproj", "{E590820A-A125-4133-9E9C-DA47BCC8FCE6}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1227,6 +1265,70 @@ Global {17A3486C-1845-4B4E-B1A6-752106F0C309}.Debug|Any CPU.Build.0 = Debug|Any CPU {17A3486C-1845-4B4E-B1A6-752106F0C309}.Release|Any CPU.ActiveCfg = Release|Any CPU {17A3486C-1845-4B4E-B1A6-752106F0C309}.Release|Any CPU.Build.0 = Release|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7E8FB015-17C9-4170-86DD-2A588F0C328A}.Release|Any CPU.Build.0 = Release|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F40E7BB-A864-440B-91D5-5EBA0F52514B}.Release|Any CPU.Build.0 = Release|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C8AE050A-D84F-4487-98F1-0992DCB54E22}.Release|Any CPU.Build.0 = Release|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29EB001D-B020-4380-B0F6-C3C4EAD63C29}.Release|Any CPU.Build.0 = Release|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A03EAB5F-C165-452C-8CFD-EBF2E935C599}.Release|Any CPU.Build.0 = Release|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6}.Release|Any CPU.Build.0 = Release|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35894E48-7E52-475F-AB6F-DB9E73010271}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8FA705-5675-44FB-B9B0-60B32885C7B1}.Release|Any CPU.Build.0 = Release|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE}.Release|Any CPU.Build.0 = Release|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A}.Release|Any CPU.Build.0 = Release|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6485CCBD-EC99-468B-B005-886F2AD5AA9A}.Release|Any CPU.Build.0 = Release|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3EE730D4-C8F6-4729-AD34-A7A485E3B932}.Release|Any CPU.Build.0 = Release|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {846C3769-2DC7-441F-94C1-714B30110FC5}.Release|Any CPU.Build.0 = Release|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5F0FE595-625E-4657-ADF2-25F0803D4578}.Release|Any CPU.Build.0 = Release|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B43EB182-F725-4DBD-891B-E576A5B8D2D2}.Release|Any CPU.Build.0 = Release|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E590820A-A125-4133-9E9C-DA47BCC8FCE6}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1461,6 +1563,25 @@ Global {B137BF4B-8C0A-4CE2-AF22-BD9BD29C86B7} = {F29C5BCD-E6C0-4556-A631-CACA41B1050B} {274769DC-5DD6-4CFD-8078-5E0E0CE8D6D8} = {F29C5BCD-E6C0-4556-A631-CACA41B1050B} {17A3486C-1845-4B4E-B1A6-752106F0C309} = {9C180C9E-50E9-4624-BE06-5C8C24A028E4} + {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} = {94CC5A11-DA0F-413C-96CA-01DB0FC426E0} + {2661CE36-99D1-4D28-A956-6581552F8889} = {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} + {7E8FB015-17C9-4170-86DD-2A588F0C328A} = {2661CE36-99D1-4D28-A956-6581552F8889} + {3F40E7BB-A864-440B-91D5-5EBA0F52514B} = {2661CE36-99D1-4D28-A956-6581552F8889} + {C8AE050A-D84F-4487-98F1-0992DCB54E22} = {2661CE36-99D1-4D28-A956-6581552F8889} + {29EB001D-B020-4380-B0F6-C3C4EAD63C29} = {2661CE36-99D1-4D28-A956-6581552F8889} + {A03EAB5F-C165-452C-8CFD-EBF2E935C599} = {2661CE36-99D1-4D28-A956-6581552F8889} + {4F349BA1-4EAD-4690-B271-9B920BDD2DF6} = {2661CE36-99D1-4D28-A956-6581552F8889} + {35894E48-7E52-475F-AB6F-DB9E73010271} = {2661CE36-99D1-4D28-A956-6581552F8889} + {FA8FA705-5675-44FB-B9B0-60B32885C7B1} = {2661CE36-99D1-4D28-A956-6581552F8889} + {F718CA0B-0564-4D7F-9AE8-F0F5CB8E5BFE} = {2661CE36-99D1-4D28-A956-6581552F8889} + {A31CA5E7-4E45-4572-8CF4-67C4316CE47A} = {2661CE36-99D1-4D28-A956-6581552F8889} + {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} = {5DF280FF-28A9-4406-8D7A-1E10150B9AB0} + {6485CCBD-EC99-468B-B005-886F2AD5AA9A} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {3EE730D4-C8F6-4729-AD34-A7A485E3B932} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {846C3769-2DC7-441F-94C1-714B30110FC5} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {5F0FE595-625E-4657-ADF2-25F0803D4578} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {B43EB182-F725-4DBD-891B-E576A5B8D2D2} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} + {E590820A-A125-4133-9E9C-DA47BCC8FCE6} = {9AE8FE82-7A05-4E2A-98E2-A98F5845B02A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {28315BFD-90E7-4E14-A2EA-F3D23AF4126F} diff --git a/plugins/Promotions/.gitattributes b/plugins/Promotions/.gitattributes new file mode 100644 index 00000000..c941e526 --- /dev/null +++ b/plugins/Promotions/.gitattributes @@ -0,0 +1 @@ +**/wwwroot/libs/** linguist-vendored diff --git a/plugins/Promotions/.gitignore b/plugins/Promotions/.gitignore new file mode 100644 index 00000000..0c71d45f --- /dev/null +++ b/plugins/Promotions/.gitignore @@ -0,0 +1,262 @@ +## 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 + +# Promotions +host/EasyAbp.EShop.Plugins.Promotions.AuthServer/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Web.Host/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Web.Unified/Logs/logs.txt +host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host/Logs/logs.txt + +# Use abp install-libs to restore. +**/wwwroot/libs/* diff --git a/plugins/Promotions/.prettierrc b/plugins/Promotions/.prettierrc new file mode 100644 index 00000000..56af76bd --- /dev/null +++ b/plugins/Promotions/.prettierrc @@ -0,0 +1,5 @@ +{ + "singleQuote": true, + "useTabs": false, + "tabWidth": 4 +} diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json new file mode 100644 index 00000000..41c36add --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpmdl.json @@ -0,0 +1,111 @@ +{ + "folders": { + "items": { + "src": {}, + "test": {}, + "host": {} + } + }, + "packages": { + "EasyAbp.EShop.Plugins.Promotions.Domain.Shared": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Domain": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Application.Contracts": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Application": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.MongoDB": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.TestBase": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Domain.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Application.Tests": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host/EasyAbp.EShop.Plugins.Promotions.HttpApi.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Web": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp": { + "path": "test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json", + "folder": "test" + }, + "EasyAbp.EShop.Plugins.Promotions.Web.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Web.Host/EasyAbp.EShop.Plugins.Promotions.Web.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.AuthServer": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.AuthServer/EasyAbp.EShop.Plugins.Promotions.AuthServer.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Host.Shared": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Web.Unified": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Web.Unified/EasyAbp.EShop.Plugins.Promotions.Web.Unified.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor/EasyAbp.EShop.Plugins.Promotions.Blazor.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Blazor.Host/EasyAbp.EShop.Plugins.Promotions.Blazor.Host.abppkg.json", + "folder": "host" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Server": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor.Server/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly": { + "path": "src/EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly/EasyAbp.EShop.Plugins.Promotions.Blazor.WebAssembly.abppkg.json", + "folder": "src" + }, + "EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host": { + "path": "host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host/EasyAbp.EShop.Plugins.Promotions.Blazor.Server.Host.abppkg.json", + "folder": "host" + } + } +} diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json new file mode 100644 index 00000000..0588ac37 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.abpsln.json @@ -0,0 +1,7 @@ +{ + "modules": { + "EasyAbp.EShop.Plugins.Promotions": { + "path": "EasyAbp.EShop.Plugins.Promotions.abpmdl.json" + } + } +} \ No newline at end of file diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln new file mode 100644 index 00000000..30289be9 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln @@ -0,0 +1,146 @@ + +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.Promotions.Domain.Shared", "src\EasyAbp.EShop.Plugins.Promotions.Domain.Shared\EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Domain", "src\EasyAbp.EShop.Plugins.Promotions.Domain\EasyAbp.EShop.Plugins.Promotions.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application.Contracts", "src\EasyAbp.EShop.Plugins.Promotions.Application.Contracts\EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application", "src\EasyAbp.EShop.Plugins.Promotions.Application\EasyAbp.EShop.Plugins.Promotions.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.Promotions.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB", "src\EasyAbp.EShop.Plugins.Promotions.MongoDB\EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi", "src\EasyAbp.EShop.Plugins.Promotions.HttpApi\EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client", "src\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.TestBase", "test\EasyAbp.EShop.Plugins.Promotions.TestBase\EasyAbp.EShop.Plugins.Promotions.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests\EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Domain.Tests", "test\EasyAbp.EShop.Plugins.Promotions.Domain.Tests\EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Application.Tests", "test\EasyAbp.EShop.Plugins.Promotions.Application.Tests\EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Web", "src\EasyAbp.EShop.Plugins.Promotions.Web\EasyAbp.EShop.Plugins.Promotions.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Promotions.Host.Shared", "host\EasyAbp.EShop.Plugins.Promotions.Host.Shared\EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Promotions.Installer", "src\EasyAbp.EShop.Plugins.Promotions.Installer\EasyAbp.EShop.Plugins.Promotions.Installer.csproj", "{BE39FD00-745B-4049-8161-FC129817CBE4}" +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 + {BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BE39FD00-745B-4049-8161-FC129817CBE4}.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} + {BE39FD00-745B-4049-8161-FC129817CBE4} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} + EndGlobalSection +EndGlobal diff --git a/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.sln.DotSettings new file mode 100644 index 00000000..cb0b2c91 --- /dev/null +++ b/plugins/Promotions/EasyAbp.EShop.Plugins.Promotions.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/Promotions/NuGet.Config b/plugins/Promotions/NuGet.Config new file mode 100644 index 00000000..bdc45197 --- /dev/null +++ b/plugins/Promotions/NuGet.Config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj new file mode 100644 index 00000000..5f0f99af --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/EasyAbp.EShop.Plugins.Promotions.Host.Shared.csproj @@ -0,0 +1,11 @@ + + + + + + netstandard2.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.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/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs new file mode 100644 index 00000000..b911c9cc --- /dev/null +++ b/plugins/Promotions/host/EasyAbp.EShop.Plugins.Promotions.Host.Shared/MultiTenancy/MultiTenancyConsts.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json new file mode 100644 index 00000000..49032794 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application-contracts" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj new file mode 100644 index 00000000..e24a4a33 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp.EShop.Plugins.Promotions.Application.Contracts.csproj @@ -0,0 +1,17 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs new file mode 100644 index 00000000..d1a2206b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationContractsModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Application; +using Volo.Abp.Modularity; +using Volo.Abp.Authorization; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainSharedModule), + typeof(AbpDddApplicationContractsModule), + typeof(AbpAuthorizationModule) + )] +public class EShopPluginsPromotionsApplicationContractsModule : AbpModule +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs new file mode 100644 index 00000000..209ac19e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissionDefinitionProvider.cs @@ -0,0 +1,18 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Authorization.Permissions; +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.Promotions.Permissions; + +public class PromotionsPermissionDefinitionProvider : PermissionDefinitionProvider +{ + public override void Define(IPermissionDefinitionContext context) + { + var myGroup = context.AddGroup(PromotionsPermissions.GroupName, L("Permission:Promotions")); + } + + private static LocalizableString L(string name) + { + return LocalizableString.Create(name); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs new file mode 100644 index 00000000..bbd17e43 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/Permissions/PromotionsPermissions.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Reflection; + +namespace EasyAbp.EShop.Plugins.Promotions.Permissions; + +public class PromotionsPermissions +{ + public const string GroupName = "EasyAbp.EShop.Plugins.Promotions"; + + public static string[] GetAll() + { + return ReflectionHelper.GetPublicConstantsRecursively(typeof(PromotionsPermissions)); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs new file mode 100644 index 00000000..f60fa78c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/EasyAbp/EShop/Plugins/Promotions/PromotionsRemoteServiceConsts.cs @@ -0,0 +1,8 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsRemoteServiceConsts +{ + public const string RemoteServiceName = "EasyAbpEShopPluginsPromotions"; + + public const string ModuleName = "easyAbpEShopPluginsPromotions"; +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application.Contracts/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json new file mode 100644 index 00000000..412567ac --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.application" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj new file mode 100644 index 00000000..303ab2bb --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp.EShop.Plugins.Promotions.Application.csproj @@ -0,0 +1,18 @@ + + + + + + net7.0 + enable + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs new file mode 100644 index 00000000..332f0ff3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsAppService.cs @@ -0,0 +1,13 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Application.Services; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public abstract class EShopPluginsPromotionsAppService : ApplicationService +{ + protected EShopPluginsPromotionsAppService() + { + LocalizationResource = typeof(PromotionsResource); + ObjectMapperContext = typeof(EShopPluginsPromotionsApplicationModule); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs new file mode 100644 index 00000000..65931d0a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsApplicationModule.cs @@ -0,0 +1,24 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.AutoMapper; +using Volo.Abp.Modularity; +using Volo.Abp.Application; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpDddApplicationModule), + typeof(AbpAutoMapperModule) + )] +public class EShopPluginsPromotionsApplicationModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs new file mode 100644 index 00000000..1ace252b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/EasyAbp/EShop/Plugins/Promotions/PromotionsApplicationAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsApplicationAutoMapperProfile : Profile +{ + public PromotionsApplicationAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Application/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json new file mode 100644 index 00000000..8b3de05f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain-shared" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj new file mode 100644 index 00000000..feef7612 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp.EShop.Plugins.Promotions.Domain.Shared.csproj @@ -0,0 +1,25 @@ + + + + + + netstandard2.0 + enable + + true + + + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs new file mode 100644 index 00000000..afab57b1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainSharedModule.cs @@ -0,0 +1,36 @@ +using Volo.Abp.Modularity; +using Volo.Abp.Localization; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.Localization.ExceptionHandling; +using Volo.Abp.Validation; +using Volo.Abp.Validation.Localization; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpValidationModule) +)] +public class EShopPluginsPromotionsDomainSharedModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + Configure(options => + { + options.Resources + .Add("en") + .AddBaseTypes(typeof(AbpValidationResource)) + .AddVirtualJson("/EasyAbp/EShop/Plugins/Promotions/Localization"); + }); + + Configure(options => + { + options.MapCodeNamespace("EasyAbp.EShop.Plugins.Promotions", typeof(PromotionsResource)); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs new file mode 100644 index 00000000..0ee6930a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/PromotionsResource.cs @@ -0,0 +1,9 @@ +using Volo.Abp.Localization; + +namespace EasyAbp.EShop.Plugins.Promotions.Localization; + +[LocalizationResourceName("Promotions")] +public class PromotionsResource +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json new file mode 100644 index 00000000..189662ee --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/en.json @@ -0,0 +1,5 @@ +{ + "culture": "en", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json new file mode 100644 index 00000000..df772fa6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hans.json @@ -0,0 +1,5 @@ +{ + "culture": "zh-Hans", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json new file mode 100644 index 00000000..7de37982 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/Localization/zh-Hant.json @@ -0,0 +1,5 @@ +{ + "culture": "zh-Hant", + "texts": { + } +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs new file mode 100644 index 00000000..ec39ee5a --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/EasyAbp/EShop/Plugins/Promotions/PromotionsErrorCodes.cs @@ -0,0 +1,6 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionsErrorCodes +{ + //Add your business exception error codes here... +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain.Shared/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json new file mode 100644 index 00000000..1d574efe --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.domain" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj new file mode 100644 index 00000000..10cf83ed --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp.EShop.Plugins.Promotions.Domain.csproj @@ -0,0 +1,16 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs new file mode 100644 index 00000000..b380c9d0 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsDomainModule.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Domain; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpDddDomainModule), + typeof(EShopPluginsPromotionsDomainSharedModule) +)] +public class EShopPluginsPromotionsDomainModule : AbpModule +{ + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs new file mode 100644 index 00000000..954ca9a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/PromotionsDbProperties.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +public static class PromotionsDbProperties +{ + public static string DbTablePrefix { get; set; } = "EasyAbpEShopPluginsPromotions"; + + public static string? DbSchema { get; set; } = null; + + public const string ConnectionStringName = "EasyAbpEShopPluginsPromotions"; +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs new file mode 100644 index 00000000..0b4df8aa --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettingDefinitionProvider.cs @@ -0,0 +1,13 @@ +using Volo.Abp.Settings; + +namespace EasyAbp.EShop.Plugins.Promotions.Settings; + +public class PromotionsSettingDefinitionProvider : SettingDefinitionProvider +{ + public override void Define(ISettingDefinitionContext context) + { + /* Define module settings here. + * Use names from PromotionsSettings class. + */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs new file mode 100644 index 00000000..776f55a3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/EasyAbp/EShop/Plugins/Promotions/Settings/PromotionsSettings.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions.Settings; + +public static class PromotionsSettings +{ + public const string GroupName = "EasyAbp.EShop.Plugins.Promotions"; + + /* Add constants for setting names. Example: + * public const string MySettingName = GroupName + ".MySettingName"; + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Domain/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json new file mode 100644 index 00000000..e1c64f01 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.ef" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj new file mode 100644 index 00000000..961f21c1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.csproj @@ -0,0 +1,20 @@ + + + + + + net7.0 + enable + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs new file mode 100644 index 00000000..cf2dcebb --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/EShopPluginsPromotionsEntityFrameworkCoreModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(AbpEntityFrameworkCoreModule) +)] +public class EShopPluginsPromotionsEntityFrameworkCoreModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAbpDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs new file mode 100644 index 00000000..848c9467 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/IPromotionsDbContext.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public interface IPromotionsDbContext : IEfCoreDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * DbSet Questions { get; } + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs new file mode 100644 index 00000000..e3b282a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContext.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp.Data; +using Volo.Abp.EntityFrameworkCore; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public class PromotionsDbContext : AbpDbContext, IPromotionsDbContext +{ + /* Add DbSet for each Aggregate Root here. Example: + * public DbSet Questions { get; set; } + */ + + public PromotionsDbContext(DbContextOptions options) + : base(options) + { + + } + + protected override void OnModelCreating(ModelBuilder builder) + { + base.OnModelCreating(builder); + + builder.ConfigureEShopPluginsPromotions(); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs new file mode 100644 index 00000000..4dad1816 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/EasyAbp/EShop/Plugins/Promotions/EntityFrameworkCore/PromotionsDbContextModelCreatingExtensions.cs @@ -0,0 +1,33 @@ +using Microsoft.EntityFrameworkCore; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +public static class PromotionsDbContextModelCreatingExtensions +{ + public static void ConfigureEShopPluginsPromotions( + this ModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + + /* Configure all entities here. Example: + + builder.Entity(b => + { + //Configure table & schema name + b.ToTable(PromotionsDbProperties.DbTablePrefix + "Questions", PromotionsDbProperties.DbSchema); + + 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); + }); + */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json new file mode 100644 index 00000000..7deef5e3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api-client" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj new file mode 100644 index 00000000..eccecb96 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.csproj @@ -0,0 +1,21 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs new file mode 100644 index 00000000..b347384e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiClientModule.cs @@ -0,0 +1,26 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Http.Client; +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpHttpClientModule))] +public class EShopPluginsPromotionsHttpApiClientModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddHttpClientProxies( + typeof(EShopPluginsPromotionsApplicationContractsModule).Assembly, + PromotionsRemoteServiceConsts.RemoteServiceName + ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json new file mode 100644 index 00000000..515bfe64 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.http-api" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj new file mode 100644 index 00000000..aeee4280 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp.EShop.Plugins.Promotions.HttpApi.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs new file mode 100644 index 00000000..c9c3e207 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsHttpApiModule.cs @@ -0,0 +1,32 @@ +using Localization.Resources.AbpUi; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Localization; +using Volo.Abp.Modularity; +using Microsoft.Extensions.DependencyInjection; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpAspNetCoreMvcModule))] +public class EShopPluginsPromotionsHttpApiModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(EShopPluginsPromotionsHttpApiModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.Resources + .Get() + .AddBaseTypes(typeof(AbpUiResource)); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs new file mode 100644 index 00000000..7a5198e1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/EasyAbp/EShop/Plugins/Promotions/PromotionsController.cs @@ -0,0 +1,12 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public abstract class PromotionsController : AbpControllerBase +{ + protected PromotionsController() + { + LocalizationResource = typeof(PromotionsResource); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.HttpApi/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj new file mode 100644 index 00000000..a3539ad5 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp.EShop.Plugins.Promotions.Installer.csproj @@ -0,0 +1,21 @@ + + + + + + net7.0 + enable + true + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs new file mode 100644 index 00000000..14075bb1 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/EasyAbp/EShop/Plugins/Promotions/EShopPluginsPromotionsInstallerModule.cs @@ -0,0 +1,18 @@ +using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpVirtualFileSystemModule) + )] +public class EShopPluginsPromotionsInstallerModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml new file mode 100644 index 00000000..be0de3a9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/FodyWeavers.xsd new file mode 100644 index 00000000..3f3946e2 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Installer/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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json new file mode 100644 index 00000000..8b23fd1e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.mongodb" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj new file mode 100644 index 00000000..565089bd --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp.EShop.Plugins.Promotions.MongoDB.csproj @@ -0,0 +1,20 @@ + + + + + + netstandard2.0 + enable + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs new file mode 100644 index 00000000..57bddb08 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/EShopPluginsPromotionsMongoDbModule.cs @@ -0,0 +1,22 @@ +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[DependsOn( + typeof(EShopPluginsPromotionsDomainModule), + typeof(AbpMongoDbModule) + )] +public class EShopPluginsPromotionsMongoDbModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddMongoDbContext(options => + { + /* Add custom repositories here. Example: + * options.AddRepository(); + */ + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs new file mode 100644 index 00000000..8c8b0dda --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/IPromotionsMongoDbContext.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public interface IPromotionsMongoDbContext : IAbpMongoDbContext +{ + /* Define mongo collections here. Example: + * IMongoCollection Questions { get; } + */ +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs new file mode 100644 index 00000000..bd84d6f3 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContext.cs @@ -0,0 +1,19 @@ +using Volo.Abp.Data; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[ConnectionStringName(PromotionsDbProperties.ConnectionStringName)] +public class PromotionsMongoDbContext : AbpMongoDbContext, IPromotionsMongoDbContext +{ + /* Add mongo collections here. Example: + * public IMongoCollection Questions => Collection(); + */ + + protected override void CreateModel(IMongoModelBuilder modelBuilder) + { + base.CreateModel(modelBuilder); + + modelBuilder.ConfigureEShopPluginsPromotions(); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs new file mode 100644 index 00000000..fe79215e --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/EasyAbp/EShop/Plugins/Promotions/MongoDB/PromotionsMongoDbContextExtensions.cs @@ -0,0 +1,13 @@ +using Volo.Abp; +using Volo.Abp.MongoDB; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +public static class PromotionsMongoDbContextExtensions +{ + public static void ConfigureEShopPluginsPromotions( + this IMongoModelBuilder builder) + { + Check.NotNull(builder, nameof(builder)); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.MongoDB/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs new file mode 100644 index 00000000..e3a5f917 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EShopPluginsPromotionsWebModule.cs @@ -0,0 +1,58 @@ +using Microsoft.AspNetCore.Mvc.RazorPages; +using Microsoft.Extensions.DependencyInjection; +using EasyAbp.EShop.Plugins.Promotions.Localization; +using EasyAbp.EShop.Plugins.Promotions.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.Promotions.Permissions; + +namespace EasyAbp.EShop.Plugins.Promotions.Web; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationContractsModule), + typeof(AbpAspNetCoreMvcUiThemeSharedModule), + typeof(AbpAutoMapperModule) + )] +public class EShopPluginsPromotionsWebModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + context.Services.PreConfigure(options => + { + options.AddAssemblyResource(typeof(PromotionsResource), typeof(EShopPluginsPromotionsWebModule).Assembly); + }); + + PreConfigure(mvcBuilder => + { + mvcBuilder.AddApplicationPartIfNotExists(typeof(EShopPluginsPromotionsWebModule).Assembly); + }); + } + + public override void ConfigureServices(ServiceConfigurationContext context) + { + Configure(options => + { + options.MenuContributors.Add(new PromotionsMenuContributor()); + }); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); + + context.Services.AddAutoMapperObjectMapper(); + Configure(options => + { + options.AddMaps(validate: true); + }); + + Configure(options => + { + //Configure authorization. + }); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json new file mode 100644 index 00000000..930c4018 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.mvc" +} \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj new file mode 100644 index 00000000..8c4ef6e9 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/EasyAbp.EShop.Plugins.Promotions.Web.csproj @@ -0,0 +1,45 @@ + + + + + + net7.0 + enable + $(AssetTargetFallback);portable-net45+win8+wp8+wpa81; + true + Library + EasyAbp.EShop.Plugins.Promotions.Web + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs new file mode 100644 index 00000000..545921a6 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenuContributor.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Volo.Abp.UI.Navigation; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Menus; + +public class PromotionsMenuContributor : IMenuContributor +{ + public async Task ConfigureMenuAsync(MenuConfigurationContext context) + { + if (context.Menu.Name == StandardMenus.Main) + { + await ConfigureMainMenuAsync(context); + } + } + + private Task ConfigureMainMenuAsync(MenuConfigurationContext context) + { + //Add main menu items. + + return Task.CompletedTask; + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs new file mode 100644 index 00000000..df493461 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Menus/PromotionsMenus.cs @@ -0,0 +1,10 @@ +namespace EasyAbp.EShop.Plugins.Promotions.Web.Menus; + +public class PromotionsMenus +{ + public const string Prefix = "EasyAbp.EShop.Plugins.Promotions"; + + //Add your menu items here... + //public const string Home = Prefix + ".MyNewMenuItem"; + +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs new file mode 100644 index 00000000..f48af135 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/PromotionsPageModel.cs @@ -0,0 +1,15 @@ +using EasyAbp.EShop.Plugins.Promotions.Localization; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EasyAbp.EShop.Plugins.Promotions.Web.Pages; + +/* Inherit your PageModel classes from this class. + */ +public abstract class PromotionsPageModel : AbpPageModel +{ + protected PromotionsPageModel() + { + LocalizationResourceType = typeof(PromotionsResource); + ObjectMapperContext = typeof(EShopPluginsPromotionsWebModule); + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_ViewImports.cshtml new file mode 100644 index 00000000..c1da1f5f --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Pages/_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/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs new file mode 100644 index 00000000..8dcc71f2 --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/PromotionsWebAutoMapperProfile.cs @@ -0,0 +1,13 @@ +using AutoMapper; + +namespace EasyAbp.EShop.Plugins.Promotions.Web; + +public class PromotionsWebAutoMapperProfile : Profile +{ + public PromotionsWebAutoMapperProfile() + { + /* You can configure your AutoMapper mapping configuration here. + * Alternatively, you can split your mapping configurations + * into multiple profile classes for a better organization. */ + } +} diff --git a/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json new file mode 100644 index 00000000..d23ed2ba --- /dev/null +++ b/plugins/Promotions/src/EasyAbp.EShop.Plugins.Promotions.Web/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "EasyAbp.EShop.Plugins.Promotions.Web": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:50266;http://localhost:50267" + } + } +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj new file mode 100644 index 00000000..29ba9e55 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/EasyAbp.EShop.Plugins.Promotions.Application.Tests.csproj @@ -0,0 +1,17 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs new file mode 100644 index 00000000..430b4664 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +/* Inherit from this class for your application layer tests. + * See SampleAppService_Tests for example. + */ +public abstract class PromotionsApplicationTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs new file mode 100644 index 00000000..a5c4b05c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Application.Tests/PromotionsApplicationTestModule.cs @@ -0,0 +1,12 @@ +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(EShopPluginsPromotionsApplicationModule), + typeof(PromotionsDomainTestModule) + )] +public class PromotionsApplicationTestModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj new file mode 100644 index 00000000..ac776ffb --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/EasyAbp.EShop.Plugins.Promotions.Domain.Tests.csproj @@ -0,0 +1,16 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs new file mode 100644 index 00000000..47cad980 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions; + +/* Inherit from this class for your domain layer tests. + * See SampleManager_Tests for example. + */ +public abstract class PromotionsDomainTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs new file mode 100644 index 00000000..757a8be7 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.Domain.Tests/PromotionsDomainTestModule.cs @@ -0,0 +1,16 @@ +using EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +/* 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(PromotionsEntityFrameworkCoreTestModule) + )] +public class PromotionsDomainTestModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj new file mode 100644 index 00000000..eaaeb3b0 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,19 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs new file mode 100644 index 00000000..4e2d0508 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.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 PromotionsEntityFrameworkCoreTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs new file mode 100644 index 00000000..3af583e5 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/EntityFrameworkCore/PromotionsEntityFrameworkCoreTestModule.cs @@ -0,0 +1,45 @@ +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; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore; + +[DependsOn( + typeof(PromotionsTestBaseModule), + typeof(EShopPluginsPromotionsEntityFrameworkCoreModule), + typeof(AbpEntityFrameworkCoreSqliteModule) + )] +public class PromotionsEntityFrameworkCoreTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + context.Services.AddAlwaysDisableUnitOfWorkTransaction(); + + 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 PromotionsDbContext( + new DbContextOptionsBuilder().UseSqlite(connection).Options + ).GetService().CreateTables(); + + return connection; + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.EntityFrameworkCore.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs new file mode 100644 index 00000000..b6054c55 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs @@ -0,0 +1,143 @@ +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.Promotions; + +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 async Task TestWithDynamicProxiesAsync() + { + Console.WriteLine(); + Console.WriteLine($"***** {nameof(TestWithDynamicProxiesAsync)} *****"); + } + + /* 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:Promotions:BaseUrl"] + + "api/Promotions/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. + */ + 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:Promotions:BaseUrl"] + + "api/Promotions/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); + } + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs new file mode 100644 index 00000000..153c17ae --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/ConsoleTestAppHostedService.cs @@ -0,0 +1,40 @@ +using Microsoft.Extensions.Hosting; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; + +namespace EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp; + +public class ConsoleTestAppHostedService : IHostedService +{ + private readonly IConfiguration _configuration; + + public ConsoleTestAppHostedService(IConfiguration configuration) + { + _configuration = configuration; + } + + public async Task StartAsync(CancellationToken cancellationToken) + { + using (var application = await AbpApplicationFactory.CreateAsync(options => + { + options.Services.ReplaceConfiguration(_configuration); + options.UseAutofac(); + })) + { + await application.InitializeAsync(); + + var demo = application.ServiceProvider.GetRequiredService(); + await demo.RunAsync(); + + await application.ShutdownAsync(); + } + } + + public Task StopAsync(CancellationToken cancellationToken) + { + return Task.CompletedTask; + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj new file mode 100644 index 00000000..5d9cafbe --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp.csproj @@ -0,0 +1,33 @@ + + + + Exe + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + + + PreserveNewest + Always + + + + PreserveNewest + Always + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs new file mode 100644 index 00000000..6c9cb6af --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/Program.cs @@ -0,0 +1,22 @@ +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; + +namespace EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp; + +class Program +{ + static async Task Main(string[] args) + { + await CreateHostBuilder(args).RunConsoleAsync(); + } + + public static IHostBuilder CreateHostBuilder(string[] args) => + Host.CreateDefaultBuilder(args) + .AddAppSettingsSecretsJson() + .ConfigureServices((hostContext, services) => + { + services.AddHostedService(); + }); +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs new file mode 100644 index 00000000..4f1daa5f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/PromotionsConsoleApiClientModule.cs @@ -0,0 +1,15 @@ +using Volo.Abp.Autofac; +using Volo.Abp.Http.Client.IdentityModel; +using Volo.Abp.Modularity; + +namespace EasyAbp.EShop.Plugins.Promotions; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(EShopPluginsPromotionsHttpApiClientModule), + typeof(AbpHttpClientIdentityModelModule) + )] +public class PromotionsConsoleApiClientModule : AbpModule +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json new file mode 100644 index 00000000..00f523c4 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.json @@ -0,0 +1,21 @@ +{ + "RemoteServices": { + "Default": { + "BaseUrl": "https://localhost:44332/" + }, + "Promotions": { + "BaseUrl": "https://localhost:44320/" + } + }, + "IdentityClients": { + "Default": { + "GrantType": "password", + "ClientId": "Promotions_App", + "ClientSecret": "1q2w3e*", + "UserName": "admin", + "UserPassword": "1q2w3E*", + "Authority": "https://localhost:44332/", + "Scope": "Promotions" + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json new file mode 100644 index 00000000..7a73a41b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.HttpApi.Client.ConsoleTestApp/appsettings.secrets.json @@ -0,0 +1,2 @@ +{ +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json new file mode 100644 index 00000000..a686451f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.abppkg.json @@ -0,0 +1,3 @@ +{ + "role": "lib.test" +} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj new file mode 100644 index 00000000..17c9b64f --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests.csproj @@ -0,0 +1,18 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs new file mode 100644 index 00000000..9588c437 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoDbFixture.cs @@ -0,0 +1,21 @@ +using System; +using Mongo2Go; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +public class MongoDbFixture : IDisposable +{ + private static readonly MongoDbRunner MongoDbRunner; + public static readonly string ConnectionString; + + static MongoDbFixture() + { + MongoDbRunner = MongoDbRunner.Start(singleNodeReplSet: true, singleNodeReplSetWaitTimeout: 20); + ConnectionString = MongoDbRunner.ConnectionString; + } + + public void Dispose() + { + MongoDbRunner?.Dispose(); + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs new file mode 100644 index 00000000..3df639ca --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/MongoTestCollection.cs @@ -0,0 +1,9 @@ +using Xunit; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[CollectionDefinition(Name)] +public class MongoTestCollection : ICollectionFixture +{ + public const string Name = "MongoDB Collection"; +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs new file mode 100644 index 00000000..6d7ff5c1 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestBase.cs @@ -0,0 +1,9 @@ +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +/* This class can be used as a base class for MongoDB integration tests, + * while SampleRepository_Tests uses a different approach. + */ +public abstract class PromotionsMongoDbTestBase : PromotionsTestBase +{ + +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs new file mode 100644 index 00000000..6a07872c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.MongoDB.Tests/MongoDB/PromotionsMongoDbTestModule.cs @@ -0,0 +1,26 @@ +using System; +using Volo.Abp.Data; +using Volo.Abp.Modularity; +using Volo.Abp.Uow; + +namespace EasyAbp.EShop.Plugins.Promotions.MongoDB; + +[DependsOn( + typeof(PromotionsTestBaseModule), + typeof(EShopPluginsPromotionsMongoDbModule) + )] +public class PromotionsMongoDbTestModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var stringArray = MongoDbFixture.ConnectionString.Split('?'); + var connectionString = stringArray[0].EnsureEndsWith('/') + + "Db_" + + Guid.NewGuid().ToString("N") + "/?" + stringArray[1]; + + Configure(options => + { + options.ConnectionStrings.Default = connectionString; + }); + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.abppkg.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj new file mode 100644 index 00000000..e2d846fb --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/EasyAbp.EShop.Plugins.Promotions.TestBase.csproj @@ -0,0 +1,28 @@ + + + + + + net7.0 + enable + EasyAbp.EShop.Plugins.Promotions + + + + + + + all + runtime; build; native; contentfiles; analyzers + + + + + + + + + + + + diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml new file mode 100644 index 00000000..1715698c --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/FodyWeavers.xsd new file mode 100644 index 00000000..ffa6fc4b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs new file mode 100644 index 00000000..2148792a --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsDataSeedContributor.cs @@ -0,0 +1,32 @@ +using System.Threading.Tasks; +using Volo.Abp.Data; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Guids; +using Volo.Abp.MultiTenancy; + +namespace EasyAbp.EShop.Plugins.Promotions; + +public class PromotionsDataSeedContributor : IDataSeedContributor, ITransientDependency +{ + private readonly IGuidGenerator _guidGenerator; + private readonly ICurrentTenant _currentTenant; + + public PromotionsDataSeedContributor( + IGuidGenerator guidGenerator, ICurrentTenant currentTenant) + { + _guidGenerator = guidGenerator; + _currentTenant = currentTenant; + } + + public Task SeedAsync(DataSeedContext context) + { + /* Instead of returning the Task.CompletedTask, you can insert your test data + * at this point! + */ + + using (_currentTenant.Change(context?.TenantId)) + { + return Task.CompletedTask; + } + } +} diff --git a/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs new file mode 100644 index 00000000..d998f060 --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBase.cs @@ -0,0 +1,59 @@ +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.Promotions; + +/* All test classes are derived from this class, directly or indirectly. */ +public abstract class PromotionsTestBase : 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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs new file mode 100644 index 00000000..318dbc6b --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/PromotionsTestBaseModule.cs @@ -0,0 +1,41 @@ +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.Promotions; + +[DependsOn( + typeof(AbpAutofacModule), + typeof(AbpTestBaseModule), + typeof(AbpAuthorizationModule), + typeof(EShopPluginsPromotionsDomainModule) + )] +public class PromotionsTestBaseModule : 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/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs new file mode 100644 index 00000000..f54f2d7a --- /dev/null +++ b/plugins/Promotions/test/EasyAbp.EShop.Plugins.Promotions.TestBase/Security/FakeCurrentPrincipalAccessor.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using System.Security.Claims; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; + +namespace EasyAbp.EShop.Plugins.Promotions.Security; + +[Dependency(ReplaceServices = true)] +public class FakeCurrentPrincipalAccessor : ThreadCurrentPrincipalAccessor +{ + protected override ClaimsPrincipal GetClaimsPrincipal() + { + return GetPrincipal(); + } + + private ClaimsPrincipal GetPrincipal() + { + return 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") + } + ) + ); + } +} 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 d947e429..56750be0 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 @@ -14,6 +14,7 @@ + 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 1429072d..337748a9 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Application/EShopSample.Application.csproj @@ -16,6 +16,7 @@ + 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 22e80e65..1aa3282c 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 @@ -26,6 +26,7 @@ + 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 fc1961b0..456f192f 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Domain/EShopSample.Domain.csproj @@ -13,6 +13,7 @@ + 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 176450ff..a0d6d80a 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.EntityFrameworkCore/EShopSample.EntityFrameworkCore.csproj @@ -13,6 +13,7 @@ + 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 8674fdc6..dff55491 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 @@ -14,6 +14,7 @@ + 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 7298f474..313479e6 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.HttpApi/EShopSample.HttpApi.csproj @@ -14,6 +14,7 @@ + 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 e9785dfc..26c0ff13 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSample.Web.csproj @@ -43,6 +43,7 @@ + diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs index c69bd88f..f4a8ae32 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/EShopSampleWebModule.cs @@ -57,6 +57,8 @@ using Volo.Abp.UI.Navigation; using Volo.Abp.VirtualFileSystem; using EasyAbp.EShop.Plugins.FlashSales.Web; using EasyAbp.EShop.Plugins.FlashSales; +using EasyAbp.EShop.Plugins.Promotions; +using EasyAbp.EShop.Plugins.Promotions.Web; namespace EShopSample.Web { @@ -79,6 +81,7 @@ namespace EShopSample.Web typeof(EShopPluginsBookingWebModule), typeof(EShopPluginsCouponsWebModule), typeof(EShopPluginsFlashSalesWebModule), + typeof(EShopPluginsPromotionsWebModule), typeof(PaymentServiceWebModule), typeof(PaymentServiceWeChatPayWebModule), typeof(PaymentServicePrepaymentWebModule), @@ -227,6 +230,12 @@ namespace EShopSample.Web options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Application.Contracts")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Application")); options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}FlashSales{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.FlashSales.Web")); + + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Domain.Shared")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Domain")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Application.Contracts")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Application")); + options.FileSets.ReplaceEmbeddedByPhysical(Path.Combine(hostingEnvironment.ContentRootPath, $"..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}..{Path.DirectorySeparatorChar}plugins{Path.DirectorySeparatorChar}Promotions{Path.DirectorySeparatorChar}src{Path.DirectorySeparatorChar}EasyAbp.EShop.Plugins.Promotions.Web")); }); } } diff --git a/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml b/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml index e120a0b4..488230d5 100644 --- a/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml +++ b/samples/EShopSample/aspnet-core/src/EShopSample.Web/Pages/Index.cshtml @@ -1,6 +1,12 @@ @page @inherits EShopSample.Web.Pages.EShopSamplePage @using EasyAbp.EShop.Orders.Orders +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Alert +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Blockquote +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Button +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Tab +@using Volo.Abp.AspNetCore.Mvc.UI.Bootstrap.TagHelpers.Table +@using Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers @model EShopSample.Web.Pages.IndexModel @section styles {