feat(bll, dal): WeekendDayService + БД. CalendarService - получение рабочих дней за период
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PARR.BLL\PARR.BLL.csproj" />
|
||||
<ProjectReference Include="..\PARR.DAL\PARR.DAL.csproj" />
|
||||
<ProjectReference Include="..\PARR.EsppApi\PARR.EsppApi.csproj" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using PARR.BLL;
|
||||
using PARR.EsppApi;
|
||||
using PARR.DAL;
|
||||
using PARR.Test;
|
||||
using Serilog;
|
||||
|
||||
@@ -8,6 +9,7 @@ IHost host = Host.CreateDefaultBuilder(args)
|
||||
{
|
||||
services.InstallEsppApiServices(hostContext.Configuration);
|
||||
services.InstallBllServices(hostContext.Configuration);
|
||||
services.InstallDalServices(hostContext.Configuration);
|
||||
|
||||
services.AddHostedService<Worker>();
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using PARR.BLL.Services.Interfaces;
|
||||
using PARR.Constants;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.EsppApi;
|
||||
using PARR.EsppApi.Constants;
|
||||
using PARR.EsppApi.Models.Query;
|
||||
@@ -12,18 +13,21 @@ namespace PARR.Test
|
||||
private readonly IEsppApiService esppApiService;
|
||||
private readonly IIntervalService intervalService;
|
||||
private readonly ICalendarService calendarService;
|
||||
private readonly IServiceProvider serviceProvider;
|
||||
|
||||
public Worker(
|
||||
ILogger<Worker> logger,
|
||||
IEsppApiService esppApiService,
|
||||
IIntervalService intervalService,
|
||||
ICalendarService calendarService
|
||||
ICalendarService calendarService,
|
||||
IServiceProvider serviceProvider
|
||||
)
|
||||
{
|
||||
_logger = logger;
|
||||
this.esppApiService = esppApiService;
|
||||
this.intervalService = intervalService;
|
||||
this.calendarService = calendarService;
|
||||
this.serviceProvider = serviceProvider;
|
||||
}
|
||||
|
||||
protected override async Task ExecuteAsync(CancellationToken stoppingToken)
|
||||
@@ -38,9 +42,18 @@ namespace PARR.Test
|
||||
|
||||
#region Calendar
|
||||
|
||||
var testCalendar = new BLL.Services.Implementations.Test(calendarService);
|
||||
//var testCalendar = new BLL.Services.Implementations.Test(calendarService);
|
||||
|
||||
testCalendar.Ttt() ;
|
||||
//testCalendar.Ttt() ;
|
||||
//using (var scope = serviceProvider.CreateScope())
|
||||
//{
|
||||
// var weekendDayService = scope.ServiceProvider.GetService<IWeekendDayService>();
|
||||
|
||||
// var workDays = calendarService.GetWorkDatesForPeriod(new DateOnly(2024, 07, 01), TimeSpan.Parse("30:00:00:00"), weekendDayService!.GetWeekends);
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"DefaultConnection": "Server=10.99.253.184;Database=parr;User Id=app_parr; Password=PosdfkhT&)%sdfligL&%5546;"
|
||||
},
|
||||
"Logging": {
|
||||
"LogLevel": {
|
||||
"Default": "Information",
|
||||
|
||||
Reference in New Issue
Block a user