Skip to content

Commit

Permalink
Refactor admin services and reorganize structure
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofPajak committed Nov 18, 2024
1 parent 9288c1c commit 875c74c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using Grand.Business.Core.Interfaces.System.Admin;
using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Business.Core.Interfaces.System.Reports;
using Grand.Business.Core.Interfaces.System.ScheduleTasks;
using Grand.Business.System.Services.Admin;
using Grand.Business.System.Services.BackgroundServices.ScheduleTasks;
using Grand.Business.System.Services.Reports;
using Grand.Infrastructure;
Expand All @@ -18,7 +16,6 @@ public void ConfigureServices(IServiceCollection services, IConfiguration config
{
RegisterReports(services);
RegisterTask(services);
RegisterAdmin(services);
}

public void Configure(IApplicationBuilder application, IWebHostEnvironment webHostEnvironment)
Expand Down Expand Up @@ -46,8 +43,4 @@ private void RegisterReports(IServiceCollection serviceCollection)
serviceCollection.AddScoped<IOrderReportService, OrderReportService>();
serviceCollection.AddScoped<IProductsReportService, ProductsReportService>();
}
private void RegisterAdmin(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<IAdminSiteMapService, AdminSiteMapService>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,7 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<Folder Include="Services\" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Grand.Business.System.Services.Admin;
using Grand.Data;
using Grand.Data;
using Grand.Domain.Admin;
using Grand.Infrastructure.Caching;
using Grand.Web.Common.Menu;
using MediatR;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Moq;

namespace Grand.Business.System.Tests.Services.Admin;
namespace Grand.Web.Common.Tests.Services.Admin;

[TestClass]
public class AdminSiteMapServiceTests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using Grand.Infrastructure.Extensions;
using MediatR;

namespace Grand.Business.System.Services.Admin;
namespace Grand.Web.Common.Menu;

public class AdminSiteMapService : IAdminSiteMapService
{
Expand Down
5 changes: 5 additions & 0 deletions src/Web/Grand.Web.Common/Startup/StartupApplication.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Grand.Business.Core.Interfaces.Common.Pdf;
using Grand.Business.Core.Interfaces.System.Admin;
using Grand.Data;
using Grand.Infrastructure;
using Grand.Infrastructure.Caching;
Expand All @@ -8,6 +9,7 @@
using Grand.Infrastructure.Configuration;
using Grand.Infrastructure.Validators;
using Grand.Web.Common.Localization;
using Grand.Web.Common.Menu;
using Grand.Web.Common.Middleware;
using Grand.Web.Common.Page;
using Grand.Web.Common.Routing;
Expand Down Expand Up @@ -97,6 +99,9 @@ private void RegisterContextService(IServiceCollection serviceCollection)

//Default theme view
serviceCollection.AddScoped<IThemeView, DefaultThemeView>();

//Admin site map service
serviceCollection.AddScoped<IAdminSiteMapService, AdminSiteMapService>();
}


Expand Down

0 comments on commit 875c74c

Please sign in to comment.