feat(dal): WeekendDayService - метод проверки на рабочий день
This commit is contained in:
@@ -53,6 +53,8 @@
|
||||
|
||||
public const string CreateCache = Base + "/tests/cache/";
|
||||
|
||||
public const string IsWorkDay = Base + "/tests/is-work-day/";
|
||||
|
||||
public const string paramDate = "{lastRunDate}";
|
||||
public const string paramApplicationInWorkId = "{applicationInWorkId}";
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Services.Interfaces;
|
||||
using PARR.DAL.CacheServices;
|
||||
using PARR.DAL.Services.Interfaces;
|
||||
using PARR.DAL.TransformServices;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
@@ -15,12 +16,19 @@ namespace PARR.API.Controllers.V1
|
||||
private readonly IClientService clientService;
|
||||
private readonly IEsppScheduleTransformService esppScheduleTransformService;
|
||||
private readonly IRedisCacheService redisCacheService;
|
||||
private readonly IWeekendDayService weekendDayService;
|
||||
|
||||
public TestController(IClientService clientService, IEsppScheduleTransformService esppScheduleTransformService, IRedisCacheService redisCacheService)
|
||||
public TestController(
|
||||
IClientService clientService,
|
||||
IEsppScheduleTransformService esppScheduleTransformService,
|
||||
IRedisCacheService redisCacheService,
|
||||
IWeekendDayService weekendDayService
|
||||
)
|
||||
{
|
||||
this.clientService = clientService;
|
||||
this.esppScheduleTransformService = esppScheduleTransformService;
|
||||
this.redisCacheService = redisCacheService;
|
||||
this.weekendDayService = weekendDayService;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +91,18 @@ namespace PARR.API.Controllers.V1
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Проверка, это рабочий день?
|
||||
/// </summary>
|
||||
/// <param name="date"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Test.IsWorkDay)]
|
||||
public async Task<IActionResult> IsWorkDay([FromQuery] DateOnly date)
|
||||
{
|
||||
return Ok(await weekendDayService.IsWorkDayAsync(date, true));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class CaheRequestTest
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
/// </summary>
|
||||
public TimeSpan UserCacheTtl { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Сколько хранить в кэше заблокированных пользователей (как долго блокировать пользователя)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user