Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

Further changes - move IConsentCookie/ICookiePreference/IRobotsTxtService to CMS project

support179fa3cd6591
diff --git a/src/Business/Grand.Business.Common/Interfaces/Directory/IConsentCookie.cs b/src/Business/Grand.Business.Cms/Interfaces/IConsentCookie.cs
similarity index 82%
rename from src/Business/Grand.Business.Common/Interfaces/Directory/IConsentCookie.cs
rename to src/Business/Grand.Business.Cms/Interfaces/IConsentCookie.cs
index 948cfaa5e..87c2f0c27 100644
--- a/src/Business/Grand.Business.Common/Interfaces/Directory/IConsentCookie.cs
+++ b/src/Business/Grand.Business.Cms/Interfaces/IConsentCookie.cs
@@ -1,4 +1,4 @@
-namespace Grand.Business.Common.Interfaces.Directory
+namespace Grand.Business.Cms.Interfaces
{
public interface IConsentCookie
{
diff --git a/src/Business/Grand.Business.Common/Interfaces/Directory/ICookiePreference.cs b/src/Business/Grand.Business.Cms/Interfaces/ICookiePreference.cs
similarity index 82%
rename from src/Business/Grand.Business.Common/Interfaces/Directory/ICookiePreference.cs
rename to src/Business/Grand.Business.Cms/Interfaces/ICookiePreference.cs
index f34597716..5a9f59aa4 100644
--- a/src/Business/Grand.Business.Common/Interfaces/Directory/ICookiePreference.cs
+++ b/src/Business/Grand.Business.Cms/Interfaces/ICookiePreference.cs
@@ -1,7 +1,7 @@
using Grand.Domain.Customers;
using Grand.Domain.Stores;
-namespace Grand.Business.Common.Interfaces.Directory
+namespace Grand.Business.Cms.Interfaces
{
public interface ICookiePreference
{
diff --git a/src/Business/Grand.Business.Common/Interfaces/Directory/IRobotsTxtService.cs b/src/Business/Grand.Business.Cms/Interfaces/IRobotsTxtService.cs
similarity index 94%
rename from src/Business/Grand.Business.Common/Interfaces/Directory/IRobotsTxtService.cs
rename to src/Business/Grand.Business.Cms/Interfaces/IRobotsTxtService.cs
index 40b747578..4ac3fa849 100644
--- a/src/Business/Grand.Business.Common/Interfaces/Directory/IRobotsTxtService.cs
+++ b/src/Business/Grand.Business.Cms/Interfaces/IRobotsTxtService.cs
@@ -1,6 +1,6 @@
using Grand.Domain.Common;
-namespace Grand.Business.Common.Interfaces.Directory
+namespace Grand.Business.Cms.Interfaces
{
public partial interface IRobotsTxtService
{
diff --git a/src/Business/Grand.Business.Common/Services/Directory/CookiePreference.cs b/src/Business/Grand.Business.Cms/Services/CookiePreference.cs
similarity index 90%
rename from src/Business/Grand.Business.Common/Services/Directory/CookiePreference.cs
rename to src/Business/Grand.Business.Cms/Services/CookiePreference.cs
index 79dc32bbc..e2597bb43 100644
--- a/src/Business/Grand.Business.Common/Services/Directory/CookiePreference.cs
+++ b/src/Business/Grand.Business.Cms/Services/CookiePreference.cs
@@ -1,8 +1,9 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Domain.Customers;
using Grand.Domain.Stores;
-namespace Grand.Business.Common.Services.Directory
+namespace Grand.Business.Cms.Services
{
public class CookiePreference : ICookiePreference
{
diff --git a/src/Business/Grand.Business.Common/Services/Directory/RobotsTxtService.cs b/src/Business/Grand.Business.Cms/Services/RobotsTxtService.cs
similarity index 97%
rename from src/Business/Grand.Business.Common/Services/Directory/RobotsTxtService.cs
rename to src/Business/Grand.Business.Cms/Services/RobotsTxtService.cs
index 3ff76362c..19661c600 100644
--- a/src/Business/Grand.Business.Common/Services/Directory/RobotsTxtService.cs
+++ b/src/Business/Grand.Business.Cms/Services/RobotsTxtService.cs
@@ -1,4 +1,4 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
using Grand.Domain.Common;
using Grand.Domain.Data;
using Grand.Infrastructure.Caching;
@@ -6,7 +6,7 @@ using Grand.Infrastructure.Caching.Constants;
using Grand.Infrastructure.Extensions;
using MediatR;
-namespace Grand.Business.Common.Services.Directory
+namespace Grand.Business.Cms.Services
{
public partial class RobotsTxtService : IRobotsTxtService
{
diff --git a/src/Business/Grand.Business.Cms/Startup/StartupApplication.cs b/src/Business/Grand.Business.Cms/Startup/StartupApplication.cs
index b8631e4df..77fc1f723 100644
--- a/src/Business/Grand.Business.Cms/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.Cms/Startup/StartupApplication.cs
@@ -12,10 +12,14 @@ namespace Grand.Business.Cms.Startup
{
public void ConfigureServices(IServiceCollection services, IConfiguration configuration)
{
- RegisterBlogService(services);
- RegisterWidgetService(services);
- RegisterNewsService(services);
- RegisterPagesService(services);
+ services.AddScoped<IBlogService, BlogService>();
+ services.AddScoped<IWidgetService, WidgetService>();
+ services.AddScoped<INewsService, NewsService>();
+ services.AddScoped<IPageLayoutService, PageLayoutService>();
+ services.AddScoped<IPageService, PageService>();
+ services.AddScoped<ICookiePreference, CookiePreference>();
+ services.AddScoped<IRobotsTxtService, RobotsTxtService>();
+
}
public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
{
@@ -24,25 +28,6 @@ namespace Grand.Business.Cms.Startup
public int Priority => 100;
public bool BeforeConfigure => false;
- private void RegisterBlogService(IServiceCollection serviceCollection)
- {
- serviceCollection.AddScoped<IBlogService, BlogService>();
- }
-
- private void RegisterWidgetService(IServiceCollection serviceCollection)
- {
- serviceCollection.AddScoped<IWidgetService, WidgetService>();
- }
- private void RegisterNewsService(IServiceCollection serviceCollection)
- {
- serviceCollection.AddScoped<INewsService, NewsService>();
- }
- private void RegisterPagesService(IServiceCollection serviceCollection)
- {
- serviceCollection.AddScoped<IPageLayoutService, PageLayoutService>();
- serviceCollection.AddScoped<IPageService, PageService>();
-
- }
}
}
diff --git a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs b/src/Business/Grand.Business.Common/Startup/StartupApplication.cs
index 03f1821ec..a5d7747ff 100644
--- a/src/Business/Grand.Business.Common/Startup/StartupApplication.cs
+++ b/src/Business/Grand.Business.Common/Startup/StartupApplication.cs
@@ -58,14 +58,12 @@ namespace Grand.Business.Common.Startup
private void RegisterDirectoryService(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<IDateTimeService, DateTimeService>();
- serviceCollection.AddScoped<ICookiePreference, CookiePreference>();
serviceCollection.AddScoped<IGeoLookupService, GeoLookupService>();
serviceCollection.AddScoped<ICountryService, CountryService>();
serviceCollection.AddScoped<ICurrencyService, CurrencyService>();
serviceCollection.AddScoped<IExchangeRateService, ExchangeRateService>();
serviceCollection.AddScoped<IMeasureService, MeasureService>();
serviceCollection.AddScoped<IGroupService, GroupService>();
- serviceCollection.AddScoped<IRobotsTxtService, RobotsTxtService>();
}
private void RegisterConfigurationService(IServiceCollection serviceCollection)
{
diff --git a/src/Plugins/Widgets.FacebookPixel/Components/WidgetsFacebookPixelViewComponent.cs b/src/Plugins/Widgets.FacebookPixel/Components/WidgetsFacebookPixelViewComponent.cs
index aa0a726e8..1b9a15d64 100644
--- a/src/Plugins/Widgets.FacebookPixel/Components/WidgetsFacebookPixelViewComponent.cs
+++ b/src/Plugins/Widgets.FacebookPixel/Components/WidgetsFacebookPixelViewComponent.cs
@@ -1,5 +1,5 @@
using Grand.Business.Checkout.Interfaces.Orders;
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
using Grand.Infrastructure;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json;
diff --git a/src/Plugins/Widgets.FacebookPixel/FacebookPixelConsentCookie.cs b/src/Plugins/Widgets.FacebookPixel/FacebookPixelConsentCookie.cs
index a94b27438..13719b5df 100644
--- a/src/Plugins/Widgets.FacebookPixel/FacebookPixelConsentCookie.cs
+++ b/src/Plugins/Widgets.FacebookPixel/FacebookPixelConsentCookie.cs
@@ -1,4 +1,4 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
namespace Widgets.FacebookPixel
{
diff --git a/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs b/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
index 41bca46e2..d9a50df6c 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
+++ b/src/Plugins/Widgets.GoogleAnalytics/Components/WidgetsGoogleAnalyticsViewComponent.cs
@@ -2,6 +2,7 @@
using Grand.Business.Catalog.Interfaces.Categories;
using Grand.Business.Catalog.Interfaces.Products;
using Grand.Business.Checkout.Interfaces.Orders;
+using Grand.Business.Cms.Interfaces;
using Grand.Business.Common.Interfaces.Directory;
using Grand.Business.Common.Interfaces.Logging;
using Grand.Domain.Logging;
diff --git a/src/Plugins/Widgets.GoogleAnalytics/GoogleAnalyticsConsentCookie.cs b/src/Plugins/Widgets.GoogleAnalytics/GoogleAnalyticsConsentCookie.cs
index 1a8c72720..8c08711fa 100644
--- a/src/Plugins/Widgets.GoogleAnalytics/GoogleAnalyticsConsentCookie.cs
+++ b/src/Plugins/Widgets.GoogleAnalytics/GoogleAnalyticsConsentCookie.cs
@@ -1,4 +1,4 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
namespace Widgets.GoogleAnalytics
{
diff --git a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CookiePreferenceTests.cs b/src/Tests/Grand.Business.Cms.Tests/Services/CookiePreferenceTests.cs
similarity index 92%
rename from src/Tests/Grand.Business.Common.Tests/Services/Directory/CookiePreferenceTests.cs
rename to src/Tests/Grand.Business.Cms.Tests/Services/CookiePreferenceTests.cs
index a2dffe386..c25abd5ce 100644
--- a/src/Tests/Grand.Business.Common.Tests/Services/Directory/CookiePreferenceTests.cs
+++ b/src/Tests/Grand.Business.Cms.Tests/Services/CookiePreferenceTests.cs
@@ -1,12 +1,13 @@
-using Grand.Business.Common.Interfaces.Directory;
-using Grand.Business.Common.Services.Directory;
+using Grand.Business.Cms.Interfaces;
+using Grand.Business.Cms.Services;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Domain;
using Grand.Domain.Customers;
using Grand.Domain.Stores;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;
-namespace Grand.Business.Common.Tests.Services.Directory
+namespace Grand.Business.Cms.Tests.Services
{
[TestClass()]
public class CookiePreferenceTests
diff --git a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
index 6a9cd3ceb..316fc545e 100644
--- a/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
+++ b/src/Web/Grand.Web.Admin/Controllers/MaintenanceController.cs
@@ -1,4 +1,5 @@
-using Grand.Business.Common.Extensions;
+using Grand.Business.Cms.Interfaces;
+using Grand.Business.Common.Extensions;
using Grand.Business.Common.Interfaces.Directory;
using Grand.Business.Common.Interfaces.Localization;
using Grand.Business.Common.Interfaces.Logging;
diff --git a/src/Web/Grand.Web/Features/Handlers/Common/GetPrivacyPreferenceModelHandler.cs b/src/Web/Grand.Web/Features/Handlers/Common/GetPrivacyPreferenceModelHandler.cs
index 5a30edaca..cbcef9d15 100644
--- a/src/Web/Grand.Web/Features/Handlers/Common/GetPrivacyPreferenceModelHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Common/GetPrivacyPreferenceModelHandler.cs
@@ -1,4 +1,5 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Domain.Common;
using Grand.Domain.Customers;
using Grand.Web.Features.Models.Common;
@@ -9,14 +10,10 @@ namespace Grand.Web.Features.Handlers.Common
{
public class GetPrivacyPreferenceModelHandler : IRequestHandler<GetPrivacyPreference, IList<PrivacyPreferenceModel>>
{
- private readonly IUserFieldService _userFieldService;
private readonly ICookiePreference _cookiePreference;
- public GetPrivacyPreferenceModelHandler(
- IUserFieldService userFieldService,
- ICookiePreference cookiePreference)
+ public GetPrivacyPreferenceModelHandler(ICookiePreference cookiePreference)
{
- _userFieldService = userFieldService;
_cookiePreference = cookiePreference;
}
diff --git a/src/Web/Grand.Web/Features/Handlers/Common/GetRobotsTextFileHandler.cs b/src/Web/Grand.Web/Features/Handlers/Common/GetRobotsTextFileHandler.cs
index 50787c5b2..959667b10 100644
--- a/src/Web/Grand.Web/Features/Handlers/Common/GetRobotsTextFileHandler.cs
+++ b/src/Web/Grand.Web/Features/Handlers/Common/GetRobotsTextFileHandler.cs
@@ -1,4 +1,5 @@
-using Grand.Business.Common.Interfaces.Directory;
+using Grand.Business.Cms.Interfaces;
+using Grand.Business.Common.Interfaces.Directory;
using Grand.Web.Features.Models.Common;
using MediatR;