feat(dal): Заготовка для IEsppScheduleTransformService
This commit is contained in:
@@ -50,6 +50,13 @@
|
||||
public static class Test
|
||||
{
|
||||
public const string GetMyIp = Base + "/tests/my-ip";
|
||||
|
||||
public const string GetNextScheduleDate = Base + "/tests/next-schedule-date/" + paramApplicationInWorkId + "/" + paramDate;
|
||||
|
||||
public const string GetNextSchedule = Base + "/tests/next-schedule/" + paramApplicationInWorkId + "/" + paramDate;
|
||||
|
||||
public const string paramDate = "{lastRunDate}";
|
||||
public const string paramApplicationInWorkId = "{applicationInWorkId}";
|
||||
}
|
||||
|
||||
public static class Template
|
||||
|
||||
@@ -3,16 +3,19 @@ using PARR.API.Contracts.V1;
|
||||
using PARR.API.Contracts.V1.Responses.Base;
|
||||
using PARR.API.Controllers.V1.Base;
|
||||
using PARR.API.Services.Interfaces;
|
||||
using PARR.DAL.TransformServices;
|
||||
|
||||
namespace PARR.API.Controllers.V1
|
||||
{
|
||||
public class TestController : BaseApiController
|
||||
{
|
||||
private readonly IClientService clientService;
|
||||
private readonly IEsppScheduleTransformService esppScheduleTransformService;
|
||||
|
||||
public TestController(IClientService clientService)
|
||||
public TestController(IClientService clientService, IEsppScheduleTransformService esppScheduleTransformService)
|
||||
{
|
||||
this.clientService = clientService;
|
||||
this.esppScheduleTransformService = esppScheduleTransformService;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,5 +34,33 @@ namespace PARR.API.Controllers.V1
|
||||
|
||||
return Ok(new Response<object>(new { ip }, true));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить следующую дату запуска
|
||||
/// </summary>
|
||||
/// <param name="applicationInWorkId"></param>
|
||||
/// <param name="lastRunDate"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Test.GetNextScheduleDate)]
|
||||
public async Task<IActionResult> GetNextScheduleDate([FromRoute] Guid applicationInWorkId, [FromRoute] DateTimeOffset lastRunDate)
|
||||
{
|
||||
var result = await esppScheduleTransformService.GetNextDateAsync(applicationInWorkId, lastRunDate);
|
||||
return Ok(result);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Получить следующее расписание
|
||||
/// </summary>
|
||||
/// <param name="applicationInWorkId"></param>
|
||||
/// <param name="lastRunDate"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet(ApiRoutes.Test.GetNextSchedule)]
|
||||
public async Task<IActionResult> GetNextSchedule([FromRoute] Guid applicationInWorkId, [FromRoute] DateTimeOffset lastRunDate)
|
||||
{
|
||||
var result = await esppScheduleTransformService.GetNextScheduleAsync(applicationInWorkId, lastRunDate);
|
||||
return Ok(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user