Merge branch 'WitsData' into ClientFactory

This commit is contained in:
Roman Efremov 2024-12-11 14:56:31 +05:00
commit 21f7158fe5
29 changed files with 109 additions and 110 deletions

View File

@ -22,7 +22,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpPost("{idDiscriminator}")]
[ProducesResponseType(typeof(int), (int)HttpStatusCode.Created)]
public async Task<IActionResult> Add(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
[FromBody] DataWithWellDepthAndSectionDto dto,
CancellationToken token)
{
@ -35,7 +35,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpPost("range/{idDiscriminator}")]
[ProducesResponseType(typeof(int), (int)HttpStatusCode.Created)]
public async Task<IActionResult> AddRange(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
[FromBody] IEnumerable<DataWithWellDepthAndSectionDto> dtos,
CancellationToken token)
{
@ -68,7 +68,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpPost("replace/{idDiscriminator}")]
[ProducesResponseType(typeof(int), (int)HttpStatusCode.OK)]
public async Task<IActionResult> ClearAndAddRange(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
[FromBody] IEnumerable<DataWithWellDepthAndSectionDto> dtos,
CancellationToken token)
{
@ -104,7 +104,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpGet("{idDiscriminator}")]
[ProducesResponseType(typeof(PaginationContainer<DataWithWellDepthAndSectionDto>), (int)HttpStatusCode.OK)]
public async Task<IActionResult> GetCurrent(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
[FromQuery] SectionPartRequest filterRequest,
[FromQuery] PaginationRequest paginationRequest,
CancellationToken token)
@ -118,7 +118,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpGet("moment/{idDiscriminator}")]
[ProducesResponseType(typeof(PaginationContainer<DataWithWellDepthAndSectionDto>), (int)HttpStatusCode.OK)]
public async Task<IActionResult> GetByDate(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
DateTimeOffset moment,
[FromQuery] SectionPartRequest filterRequest,
[FromQuery] PaginationRequest paginationRequest,
@ -133,7 +133,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[ProducesResponseType(typeof(IEnumerable<ChangeLogDto>), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public async Task<IActionResult> GetChangeLogForDate(
[FromRoute] int idDiscriminator,
[FromRoute] Guid idDiscriminator,
DateTimeOffset dateBegin,
DateTimeOffset dateEnd,
CancellationToken token)
@ -146,7 +146,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpGet("datesChange/{idDiscriminator}")]
[ProducesResponseType(typeof(IEnumerable<DateOnly>), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public async Task<IActionResult> GetDatesChange([FromRoute] int idDiscriminator, CancellationToken token)
public async Task<IActionResult> GetDatesChange([FromRoute] Guid idDiscriminator, CancellationToken token)
{
var result = await repository.GetDatesChange(idDiscriminator, token);
@ -156,7 +156,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpGet("part/{idDiscriminator}")]
[ProducesResponseType(typeof(IEnumerable<DataWithWellDepthAndSectionDto>), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public async Task<ActionResult<IEnumerable<DataWithWellDepthAndSectionDto>>> GetPart([FromRoute] int idDiscriminator, DateTimeOffset dateBegin, int take = 86400, CancellationToken token = default)
public async Task<ActionResult<IEnumerable<DataWithWellDepthAndSectionDto>>> GetPart([FromRoute] Guid idDiscriminator, DateTimeOffset dateBegin, int take = 86400, CancellationToken token = default)
{
var result = await repository.GetGtDate(idDiscriminator, dateBegin, token);
@ -166,7 +166,7 @@ public class ChangeLogController : ControllerBase, IChangeLogApi
[HttpGet("datesRange/{idDiscriminator}")]
[ProducesResponseType(typeof(DatesRangeDto), (int)HttpStatusCode.OK)]
[ProducesResponseType((int)HttpStatusCode.NoContent)]
public async Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync([FromRoute] int idDiscriminator, CancellationToken token)
public async Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync([FromRoute] Guid idDiscriminator, CancellationToken token)
{
var result = await repository.GetDatesRange(idDiscriminator, token);

View File

@ -97,7 +97,6 @@ public class SetpointController : ControllerBase, ISetpointApi
/// </summary>
/// <param name="setpointKey"></param>
/// <param name="newValue"></param>
/// <param name="idUser"></param>
/// <param name="token"></param>
/// <returns></returns>
[HttpPost]

View File

@ -28,7 +28,7 @@ public class WitsDataController : ControllerBase, IWitsDataApi
/// <param name="token"></param>
/// <returns></returns>
[HttpGet("{discriminatorId}/datesRange")]
public async Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync([FromRoute] int discriminatorId, CancellationToken token)
public async Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync([FromRoute] Guid discriminatorId, CancellationToken token)
{
var result = await witsDataService.GetDatesRangeAsync(discriminatorId, token);
@ -44,7 +44,7 @@ public class WitsDataController : ControllerBase, IWitsDataApi
/// <param name="token"></param>
/// <returns></returns>
[HttpGet("{discriminatorId}/part")]
public async Task<ActionResult<IEnumerable<WitsDataDto>>> GetPart([FromRoute] int discriminatorId, [FromQuery] DateTimeOffset dateBegin, [FromQuery] int take, CancellationToken token)
public async Task<ActionResult<IEnumerable<WitsDataDto>>> GetPart([FromRoute] Guid discriminatorId, [FromQuery] DateTimeOffset dateBegin, [FromQuery] int take, CancellationToken token)
{
var result = await witsDataService.GetPart(discriminatorId, dateBegin, take, token);
@ -61,7 +61,7 @@ public class WitsDataController : ControllerBase, IWitsDataApi
/// <param name="token"></param>
/// <returns></returns>
[HttpGet("{discriminatorId}/graph")]
public async Task<ActionResult<IEnumerable<WitsDataDto>>> GetValuesForGraph([FromRoute] int discriminatorId,
public async Task<ActionResult<IEnumerable<WitsDataDto>>> GetValuesForGraph([FromRoute] Guid discriminatorId,
[FromQuery] DateTimeOffset dateFrom, [FromQuery] DateTimeOffset dateTo, [FromQuery] int approxPointsCount, CancellationToken token)
{
var result = await witsDataService.GetValuesForGraph(discriminatorId, dateFrom, dateTo, approxPointsCount, token);

View File

@ -154,7 +154,7 @@ public static class DependencyInjection
{
Implicit = new OpenApiOAuthFlow
{
AuthorizationUrl = new Uri(configuration["Authentication:AuthorizationUrl"]),
AuthorizationUrl = new Uri(configuration["Authentication:AuthorizationUrl"]!),
}
}
});

View File

@ -14,7 +14,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
this.refitChangeLogClient = refitChangeLogClient;
}
public async Task<int> ClearAndAddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
public async Task<int> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
{
var result = await ExecuteGetResponse<int>(
async () => await refitChangeLogClient.ClearAndAddRange(idDiscriminator, dtos, token), token);
@ -22,7 +22,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
return result;
}
public async Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(int idDiscriminator, DateTimeOffset moment,
public async Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment,
SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token)
{
var result = await ExecuteGetResponse<PaginationContainer<DataWithWellDepthAndSectionDto>>(
@ -31,7 +31,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
return result;
}
public async Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token)
public async Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token)
{
var result = await ExecuteGetResponse<IEnumerable<ChangeLogDto>>(
async () => await refitChangeLogClient.GetChangeLogForInterval(idDiscriminator, dateBegin, dateEnd, token), token);
@ -39,7 +39,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
return result;
}
public async Task<int> Add(int idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token)
public async Task<int> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token)
{
var result = await ExecutePostResponse(
async () => await refitChangeLogClient.Add(idDiscriminator, dto, token), token);
@ -47,7 +47,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
return result;
}
public async Task<int> AddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
public async Task<int> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
{
var result = await ExecutePostResponse(
async () => await refitChangeLogClient.AddRange(idDiscriminator, dtos, token), token);
@ -87,7 +87,7 @@ public class ChangeLogClient : BaseClient, IChangeLogClient
return result;
}
public async Task<DatesRangeDto?> GetDatesRange(int idDiscriminator, CancellationToken token)
public async Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token)
{
var result = await ExecuteGetResponse<DatesRangeDto?>(
async () => await refitChangeLogClient.GetDatesRange(idDiscriminator, token), token);

View File

@ -15,7 +15,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> Add(int idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
Task<int> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
/// <summary>
/// Добавить несколько записей
@ -24,7 +24,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<int> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Импорт с заменой: удаление старых строк и добавление новых
@ -33,7 +33,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> ClearAndAddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<int> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Удалить одну запись
@ -60,7 +60,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="paginationRequest"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(int idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
/// <summary>
/// Получение исторических данных за определенный период времени
@ -70,7 +70,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="dateEnd"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
/// <summary>
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
@ -78,7 +78,7 @@ public interface IChangeLogClient : IDisposable
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto?> GetDatesRange(int idDiscriminator, CancellationToken token);
Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token);
/// <summary>
/// Обновить одну запись

View File

@ -17,7 +17,7 @@ public interface IWitsDataClient : IDisposable
/// <param name="approxPointsCount"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WitsDataDto>> GetValuesForGraph(int discriminatorId, [Query] DateTimeOffset dateFrom, [Query] DateTimeOffset dateTo, [Query] int approxPointsCount, CancellationToken token);
Task<IEnumerable<WitsDataDto>> GetValuesForGraph(Guid discriminatorId, [Query] DateTimeOffset dateFrom, [Query] DateTimeOffset dateTo, [Query] int approxPointsCount, CancellationToken token);
/// <summary>
/// Сохранить набор параметров (Wits)
@ -35,7 +35,7 @@ public interface IWitsDataClient : IDisposable
/// <param name="take"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WitsDataDto>> GetPart(int discriminatorId, [Query] DateTimeOffset dateBegin, [Query] int take = 24 * 60 * 60, CancellationToken token = default);
Task<IEnumerable<WitsDataDto>> GetPart(Guid discriminatorId, [Query] DateTimeOffset dateBegin, [Query] int take = 24 * 60 * 60, CancellationToken token = default);
/// <summary>
/// Получить диапазон дат, для которых есть данные в репозитории
@ -43,5 +43,5 @@ public interface IWitsDataClient : IDisposable
/// <param name="discriminatorId"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto> GetDatesRangeAsync(int discriminatorId, CancellationToken token);
Task<DatesRangeDto> GetDatesRangeAsync(Guid discriminatorId, CancellationToken token);
}

View File

@ -9,24 +9,24 @@ public interface IRefitChangeLogClient : IDisposable
private const string BaseRoute = "/api/ChangeLog";
[Post($"{BaseRoute}/replace/{{idDiscriminator}}")]
Task<IApiResponse<int>> ClearAndAddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<IApiResponse<int>> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
[Get($"{BaseRoute}/moment/{{idDiscriminator}}")]
Task<IApiResponse<PaginationContainer<DataWithWellDepthAndSectionDto>>> GetByDate(
int idDiscriminator,
Guid idDiscriminator,
DateTimeOffset moment,
[Query] SectionPartRequest filterRequest,
[Query] PaginationRequest paginationRequest,
CancellationToken token);
[Get($"{BaseRoute}/history/{{idDiscriminator}}")]
Task<IApiResponse<IEnumerable<ChangeLogDto>>> GetChangeLogForInterval(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
Task<IApiResponse<IEnumerable<ChangeLogDto>>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
[Post($"{BaseRoute}/{{idDiscriminator}}")]
Task<IApiResponse<int>> Add(int idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
Task<IApiResponse<int>> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
[Post($"{BaseRoute}/range/{{idDiscriminator}}")]
Task<IApiResponse<int>> AddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<IApiResponse<int>> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
[Put($"{BaseRoute}")]
Task<IApiResponse<int>> Update(DataWithWellDepthAndSectionDto dto, CancellationToken token);
@ -41,6 +41,6 @@ public interface IRefitChangeLogClient : IDisposable
Task<IApiResponse<int>> DeleteRange([Body] IEnumerable<Guid> ids, CancellationToken token);
[Get($"{BaseRoute}/datesRange/{{idDiscriminator}}")]
Task<IApiResponse<DatesRangeDto?>> GetDatesRange(int idDiscriminator, CancellationToken token);
Task<IApiResponse<DatesRangeDto?>> GetDatesRange(Guid idDiscriminator, CancellationToken token);
}

View File

@ -8,14 +8,14 @@ public interface IRefitWitsDataClient : IDisposable
private const string BaseRoute = "/api/witsData";
[Get($"{BaseRoute}/{{discriminatorId}}/graph")]
Task<IApiResponse<IEnumerable<WitsDataDto>>> GetValuesForGraph(int discriminatorId, [Query] DateTimeOffset dateFrom, [Query] DateTimeOffset dateTo, [Query] int approxPointsCount, CancellationToken token);
Task<IApiResponse<IEnumerable<WitsDataDto>>> GetValuesForGraph(Guid discriminatorId, [Query] DateTimeOffset dateFrom, [Query] DateTimeOffset dateTo, [Query] int approxPointsCount, CancellationToken token);
[Post($"{BaseRoute}/")]
Task<IApiResponse<int>> AddRange(IEnumerable<WitsDataDto> dtos, CancellationToken token);
[Get($"{BaseRoute}/{{discriminatorId}}/part")]
Task<IApiResponse<IEnumerable<WitsDataDto>>> GetPart(int discriminatorId, [Query] DateTimeOffset dateBegin, [Query] int take = 24 * 60 * 60, CancellationToken token = default);
Task<IApiResponse<IEnumerable<WitsDataDto>>> GetPart(Guid discriminatorId, [Query] DateTimeOffset dateBegin, [Query] int take = 24 * 60 * 60, CancellationToken token = default);
[Get($"{BaseRoute}/{{discriminatorId}}/datesRange")]
Task<IApiResponse<DatesRangeDto>> GetDatesRangeAsync(int discriminatorId, CancellationToken token);
Task<IApiResponse<DatesRangeDto>> GetDatesRangeAsync(Guid discriminatorId, CancellationToken token);
}

View File

@ -22,7 +22,7 @@ public class WitsDataClient : BaseClient, IWitsDataClient
return result;
}
public async Task<DatesRangeDto> GetDatesRangeAsync(int discriminatorId, CancellationToken token)
public async Task<DatesRangeDto> GetDatesRangeAsync(Guid discriminatorId, CancellationToken token)
{
var result = await ExecuteGetResponse<DatesRangeDto>(
async () => await refitWitsDataClient.GetDatesRangeAsync(discriminatorId, token), token);
@ -30,7 +30,7 @@ public class WitsDataClient : BaseClient, IWitsDataClient
return result;
}
public async Task<IEnumerable<WitsDataDto>> GetPart(int discriminatorId, DateTimeOffset dateBegin, int take = 86400, CancellationToken token = default)
public async Task<IEnumerable<WitsDataDto>> GetPart(Guid discriminatorId, DateTimeOffset dateBegin, int take = 86400, CancellationToken token = default)
{
var result = await ExecuteGetResponse<IEnumerable<WitsDataDto>>(
async () => await refitWitsDataClient.GetPart(discriminatorId, dateBegin, take, token), token);
@ -38,7 +38,7 @@ public class WitsDataClient : BaseClient, IWitsDataClient
return result;
}
public async Task<IEnumerable<WitsDataDto>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo, int approxPointsCount, CancellationToken token)
public async Task<IEnumerable<WitsDataDto>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo, int approxPointsCount, CancellationToken token)
{
var result = await ExecuteGetResponse<IEnumerable<WitsDataDto>>(
async () => await refitWitsDataClient.GetValuesForGraph(discriminatorId, dateFrom, dateTo, approxPointsCount, token), token);

View File

@ -15,7 +15,7 @@ namespace Persistence.Database.Postgres.Migrations
name: "ParameterData",
columns: table => new
{
DiscriminatorId = table.Column<int>(type: "integer", nullable: false, comment: "Дискриминатор системы"),
DiscriminatorId = table.Column<Guid>(type: "uuid", nullable: false, comment: "Дискриминатор системы"),
ParameterId = table.Column<int>(type: "integer", nullable: false, comment: "Id параметра"),
Timestamp = table.Column<DateTimeOffset>(type: "timestamp with time zone", nullable: false, comment: "Временная отметка"),
Value = table.Column<string>(type: "varchar(256)", nullable: false, comment: "Значение параметра в виде строки")

View File

@ -15,7 +15,7 @@ public class ChangeLog : IChangeLog, IWithSectionPart
public Guid Id { get; set; }
[Comment("Дискриминатор таблицы")]
public int IdDiscriminator { get; set; }
public Guid IdDiscriminator { get; set; }
[Comment("Автор изменения")]
public Guid IdAuthor { get; set; }

View File

@ -39,7 +39,7 @@ public interface IChangeLog
/// <summary>
/// Дискриминатор таблицы
/// </summary>
public int IdDiscriminator { get; set; }
public Guid IdDiscriminator { get; set; }
/// <summary>
/// Значение

View File

@ -8,7 +8,7 @@ namespace Persistence.Database.Entity;
public class ParameterData
{
[Required, Comment("Дискриминатор системы")]
public int DiscriminatorId { get; set; }
public Guid DiscriminatorId { get; set; }
[Comment("Id параметра")]
public int ParameterId { get; set; }

View File

@ -29,7 +29,7 @@ public class ChangeLogControllerTest : BaseIntegrationTest
// arrange
dbContext.CleanupDbSet<ChangeLog>();
var idDiscriminator = 1;
var idDiscriminator = Guid.NewGuid();
var dtos = Generate(2, DateTimeOffset.UtcNow);
// act
@ -60,7 +60,7 @@ public class ChangeLogControllerTest : BaseIntegrationTest
{
// arrange
var count = 1;
var idDiscriminator = 1;
var idDiscriminator = Guid.NewGuid();
var dtos = Generate(count, DateTimeOffset.UtcNow);
var dto = dtos.FirstOrDefault()!;
@ -76,7 +76,7 @@ public class ChangeLogControllerTest : BaseIntegrationTest
{
// arrange
var count = 3;
var idDiscriminator = 1;
var idDiscriminator = Guid.NewGuid();
var dtos = Generate(count, DateTimeOffset.UtcNow);
// act
@ -92,7 +92,7 @@ public class ChangeLogControllerTest : BaseIntegrationTest
// arrange
dbContext.CleanupDbSet<ChangeLog>();
var idDiscriminator = 1;
var idDiscriminator = Guid.NewGuid();
var dtos = Generate(1, DateTimeOffset.UtcNow);
var dto = dtos.FirstOrDefault()!;
var result = await client.Add(idDiscriminator, dto, new CancellationToken());
@ -283,7 +283,7 @@ public class ChangeLogControllerTest : BaseIntegrationTest
var count = insertedCount;
var daysRange = (daysBeforeNowChangeLog, daysAfterNowChangeLog);
var changeLogItems = CreateChangeLogItems(count, daysRange);
var idDiscriminator = 1;
var idDiscriminator = changeLogItems.Item1;
var entities = changeLogItems.Item2;
foreach (var entity in entities)
@ -321,12 +321,12 @@ public class ChangeLogControllerTest : BaseIntegrationTest
}
private (int, ChangeLog[]) CreateChangeLogItems(int count, (int, int) daysRange)
private (Guid, ChangeLog[]) CreateChangeLogItems(int count, (int, int) daysRange)
{
var minDayCount = daysRange.Item1;
var maxDayCount = daysRange.Item2;
var idDiscriminator = 1;
var idDiscriminator = Guid.NewGuid();
var dtos = Generate(count, DateTimeOffset.UtcNow);
var entities = dtos.Select(d =>
{

View File

@ -26,7 +26,7 @@ public class WitsDataControllerTest : BaseIntegrationTest
//arrange
dbContext.CleanupDbSet<ParameterData>();
var discriminatorId = 1;
var discriminatorId = Guid.NewGuid();
//act
var response = await witsDataClient.GetDatesRangeAsync(discriminatorId, CancellationToken.None);
@ -41,7 +41,7 @@ public class WitsDataControllerTest : BaseIntegrationTest
//arrange
dbContext.CleanupDbSet<ParameterData>();
var discriminatorId = 1;
var discriminatorId = Guid.NewGuid();
var dateBegin = DateTimeOffset.UtcNow;
var take = 1;
@ -69,7 +69,7 @@ public class WitsDataControllerTest : BaseIntegrationTest
//arrange
dbContext.CleanupDbSet<ParameterData>();
var discriminatorId = 1;
var discriminatorId = Guid.NewGuid();
var dateFrom = DateTimeOffset.UtcNow;
var dateTo = DateTimeOffset.UtcNow;
var approxPointCount = 12;
@ -172,7 +172,7 @@ public class WitsDataControllerTest : BaseIntegrationTest
{
new WitsDataDto()
{
DiscriminatorId = -1, // < 0
DiscriminatorId = Guid.NewGuid(),
Timestamped = DateTimeOffset.UtcNow,
Values = new List<WitsValueDto>()
{
@ -201,13 +201,14 @@ public class WitsDataControllerTest : BaseIntegrationTest
private async Task<IEnumerable<WitsDataDto>> AddRange(int countToCreate = 10)
{
var dtos = new List<WitsDataDto>();
var discriminatorId = Guid.NewGuid();
var timestamped = DateTimeOffset.UtcNow;
for (var i = 0; i < countToCreate; i++)
{
var random = new Random();
dtos.Add(new WitsDataDto()
{
DiscriminatorId = 1,
DiscriminatorId = discriminatorId,
Timestamped = timestamped.AddSeconds(i),
Values = new List<WitsValueDto>()
{

View File

@ -16,7 +16,7 @@ public class ChangeLogRepository : IChangeLogRepository
this.db = db;
}
public async Task<int> AddRange(Guid idAuthor, int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
public async Task<int> AddRange(Guid idAuthor, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
{
var entities = new List<ChangeLog>();
foreach (var dto in dtos)
@ -49,7 +49,7 @@ public class ChangeLogRepository : IChangeLogRepository
return result;
}
public async Task<int> MarkAsDeleted(Guid idEditor, int idDiscriminator, CancellationToken token)
public async Task<int> MarkAsDeleted(Guid idEditor, Guid idDiscriminator, CancellationToken token)
{
var query = db.Set<ChangeLog>()
.Where(s => s.IdDiscriminator == idDiscriminator)
@ -75,7 +75,7 @@ public class ChangeLogRepository : IChangeLogRepository
return await db.SaveChangesAsync(token);
}
public async Task<int> ClearAndAddRange(Guid idAuthor, int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
public async Task<int> ClearAndAddRange(Guid idAuthor, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token)
{
var result = 0;
@ -127,7 +127,7 @@ public class ChangeLogRepository : IChangeLogRepository
}
public async Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(
int idDiscriminator,
Guid idDiscriminator,
DateTimeOffset momentUtc,
SectionPartRequest filterRequest,
PaginationRequest paginationRequest,
@ -142,14 +142,14 @@ public class ChangeLogRepository : IChangeLogRepository
return result;
}
private IQueryable<ChangeLog> CreateQuery(int idDiscriminator)
private IQueryable<ChangeLog> CreateQuery(Guid idDiscriminator)
{
var query = db.Set<ChangeLog>().Where(e => e.IdDiscriminator == idDiscriminator);
return query;
}
public async Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token)
public async Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token)
{
var query = db.Set<ChangeLog>().Where(s => s.IdDiscriminator == idDiscriminator);
@ -169,7 +169,7 @@ public class ChangeLogRepository : IChangeLogRepository
public async Task<IEnumerable<DateOnly>> GetDatesChange(int idDiscriminator, CancellationToken token)
public async Task<IEnumerable<DateOnly>> GetDatesChange(Guid idDiscriminator, CancellationToken token)
{
var query = db.Set<ChangeLog>().Where(e => e.IdDiscriminator == idDiscriminator);
@ -195,7 +195,7 @@ public class ChangeLogRepository : IChangeLogRepository
return datesOnly;
}
private ChangeLog CreateEntityFromDto(Guid idAuthor, int idDiscriminator, DataWithWellDepthAndSectionDto dto)
private ChangeLog CreateEntityFromDto(Guid idAuthor, Guid idDiscriminator, DataWithWellDepthAndSectionDto dto)
{
var entity = new ChangeLog()
{
@ -214,7 +214,7 @@ public class ChangeLogRepository : IChangeLogRepository
return entity;
}
public async Task<IEnumerable<DataWithWellDepthAndSectionDto>> GetGtDate(int idDiscriminator, DateTimeOffset dateBegin, CancellationToken token)
public async Task<IEnumerable<DataWithWellDepthAndSectionDto>> GetGtDate(Guid idDiscriminator, DateTimeOffset dateBegin, CancellationToken token)
{
var date = dateBegin.ToUniversalTime();
var query = this.db.Set<ChangeLog>()
@ -228,7 +228,7 @@ public class ChangeLogRepository : IChangeLogRepository
return dtos;
}
public async Task<DatesRangeDto?> GetDatesRange(int idDiscriminator, CancellationToken token)
public async Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token)
{
var query = db.Set<ChangeLog>()
.Where(e => e.IdDiscriminator == idDiscriminator)

View File

@ -17,7 +17,7 @@ public class ParameterRepository : IParameterRepository
protected virtual IQueryable<ParameterData> GetQueryReadOnly() => db.Set<ParameterData>();
public async Task<DatesRangeDto> GetDatesRangeAsync(int idDiscriminator, CancellationToken token)
public async Task<DatesRangeDto> GetDatesRangeAsync(Guid idDiscriminator, CancellationToken token)
{
var query = GetQueryReadOnly()
.Where(e => e.DiscriminatorId == idDiscriminator)
@ -37,7 +37,7 @@ public class ParameterRepository : IParameterRepository
return result;
}
public async Task<IEnumerable<ParameterDto>> GetPart(int idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token)
public async Task<IEnumerable<ParameterDto>> GetPart(Guid idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token)
{
var query = GetQueryReadOnly();
var universalDate = dateBegin.ToUniversalTime();
@ -50,7 +50,7 @@ public class ParameterRepository : IParameterRepository
return dtos;
}
public async Task<IEnumerable<ParameterDto>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
public async Task<IEnumerable<ParameterDto>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
int approxPointsCount, int? ratio, CancellationToken token)
{
var query = db.Set<ParameterData>().AsNoTracking();

View File

@ -34,7 +34,7 @@ namespace Persistence.Repository.Repositories
? request.SortSettings
: nameof(TechMessage.Timestamp);
var entities = await query
.SortBy(request.SortSettings)
.SortBy(request.SortSettings!)
.Skip(request.Skip)
.Take(request.Take)
.ToArrayAsync(token);

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc;
using System;
using Microsoft.AspNetCore.Mvc;
using Persistence.Models;
using Persistence.Models.Requests;
@ -16,7 +17,7 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> ClearAndAddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<IActionResult> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Получение данных на текущую дату (с пагинацией)
@ -26,7 +27,7 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="paginationRequest">параметры запроса пагинации</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetCurrent(int idDiscriminator, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
Task<IActionResult> GetCurrent(Guid idDiscriminator, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
/// <summary>
/// Получение данных на определенную дату (с пагинацией)
@ -37,7 +38,7 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="paginationRequest">параметры запроса пагинации</param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetByDate(int idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
Task<IActionResult> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
/// <summary>
/// Получение исторических данных за определенный период времени
@ -47,16 +48,16 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="dateEnd"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetChangeLogForDate(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
Task<IActionResult> GetChangeLogForDate(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
/// <summary>
/// Добавить одну запись
/// </summary>
/// <param name="idDiscriminator"></param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> Add(int idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
/// <summary>
/// Добавить одну запись
/// </summary>
/// <param name="idDiscriminator"></param>
/// <param name="dto"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto, CancellationToken token);
/// <summary>
/// Добавить несколько записей
@ -65,7 +66,7 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> AddRange(int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<IActionResult> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Обновить одну запись
@ -105,5 +106,5 @@ public interface IChangeLogApi : ISyncWithDiscriminatorApi<DataWithWellDepthAndS
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IActionResult> GetDatesChange(int idDiscriminator, CancellationToken token);
Task<IActionResult> GetDatesChange(Guid idDiscriminator, CancellationToken token);
}

View File

@ -16,7 +16,7 @@ public interface ISyncWithDiscriminatorApi<TDto>
/// <param name="take">количество записей</param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<IEnumerable<TDto>>> GetPart(int idDiscriminator, DateTimeOffset dateBegin, int take = 24 * 60 * 60, CancellationToken token = default);
Task<ActionResult<IEnumerable<TDto>>> GetPart(Guid idDiscriminator, DateTimeOffset dateBegin, int take = 24 * 60 * 60, CancellationToken token = default);
/// <summary>
/// Получить диапазон дат, для которых есть данные в репозитории
@ -24,5 +24,5 @@ public interface ISyncWithDiscriminatorApi<TDto>
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync(int idDiscriminator, CancellationToken token);
Task<ActionResult<DatesRangeDto>> GetDatesRangeAsync(Guid idDiscriminator, CancellationToken token);
}

View File

@ -17,7 +17,7 @@ public interface IWitsDataApi : ISyncWithDiscriminatorApi<WitsDataDto>
/// <param name="approxPointsCount"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<ActionResult<IEnumerable<WitsDataDto>>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
Task<ActionResult<IEnumerable<WitsDataDto>>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
int approxPointsCount, CancellationToken token);
/// <summary>

View File

@ -10,8 +10,7 @@ public class ParameterDto
/// <summary>
/// Дискриминатор системы
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "Дискриминатор системы не может быть меньше 0")]
public int DiscriminatorId { get; set; }
public Guid DiscriminatorId { get; set; }
/// <summary>
/// Id параметра

View File

@ -15,8 +15,7 @@ public class WitsDataDto
/// <summary>
/// Дискриминатор системы
/// </summary>
[Range(0, int.MaxValue, ErrorMessage = "Дискриминатор системы не может быть меньше 0")]
public required int DiscriminatorId { get; set; }
public required Guid DiscriminatorId { get; set; }
/// <summary>
/// Параметры

View File

@ -17,7 +17,7 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> AddRange(Guid idAuthor, int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<int> AddRange(Guid idAuthor, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Пометить записи как удаленные
@ -35,7 +35,7 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="idDiscriminator">дискриминатор таблицы</param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> MarkAsDeleted(Guid idEditor, int idDiscriminator, CancellationToken token);
Task<int> MarkAsDeleted(Guid idEditor, Guid idDiscriminator, CancellationToken token);
/// <summary>
/// Очистить и добавить новые
@ -45,7 +45,7 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> ClearAndAddRange(Guid idAuthor, int idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
Task<int> ClearAndAddRange(Guid idAuthor, Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos, CancellationToken token);
/// <summary>
/// Редактирование записей
@ -65,7 +65,7 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="paginationRequest">параметры запроса пагинации</param>
/// <param name="token"></param>
/// <returns></returns>
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(int idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
Task<PaginationContainer<DataWithWellDepthAndSectionDto>> GetByDate(Guid idDiscriminator, DateTimeOffset moment, SectionPartRequest filterRequest, PaginationRequest paginationRequest, CancellationToken token);
/// <summary>
/// Получение измененных записей за период времени
@ -75,7 +75,7 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="dateEnd"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(int idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
Task<IEnumerable<ChangeLogDto>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd, CancellationToken token);
/// <summary>
/// Получение списка дат, в которые происходили изменения (день, месяц, год, без времени)
@ -83,5 +83,5 @@ public interface IChangeLogRepository : ISyncWithDiscriminatorRepository<DataWit
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<DateOnly>> GetDatesChange(int idDiscriminator, CancellationToken token);
Task<IEnumerable<DateOnly>> GetDatesChange(Guid idDiscriminator, CancellationToken token);
}

View File

@ -10,14 +10,14 @@ public interface IParameterRepository
/// <param name="take"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ParameterDto>> GetPart(int idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token);
Task<IEnumerable<ParameterDto>> GetPart(Guid idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token);
/// <summary>
/// Получить диапазон дат, для которых есть данные в репозитории
/// </summary>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto> GetDatesRangeAsync(int idDiscriminator, CancellationToken token);
Task<DatesRangeDto> GetDatesRangeAsync(Guid idDiscriminator, CancellationToken token);
/// <summary>
/// Получить набор параметров (Wits) для построения графика
@ -29,7 +29,7 @@ public interface IParameterRepository
/// <param name="ratio"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<ParameterDto>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
Task<IEnumerable<ParameterDto>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
int approxPointsCount, int? ratio, CancellationToken token);
/// <summary>

View File

@ -15,7 +15,7 @@ public interface ISyncWithDiscriminatorRepository<TDto>
/// <param name="dateBegin">дата начала</param>
/// <param name="token"></param>
/// /// <returns></returns>
Task<IEnumerable<TDto>> GetGtDate(int idDiscriminator, DateTimeOffset dateBegin, CancellationToken token);
Task<IEnumerable<TDto>> GetGtDate(Guid idDiscriminator, DateTimeOffset dateBegin, CancellationToken token);
/// <summary>
@ -24,5 +24,5 @@ public interface ISyncWithDiscriminatorRepository<TDto>
/// <param name="idDiscriminator">дискриминатор таблицы</param>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto?> GetDatesRange(int idDiscriminator, CancellationToken token);
Task<DatesRangeDto?> GetDatesRange(Guid idDiscriminator, CancellationToken token);
}

View File

@ -13,7 +13,7 @@ public interface IWitsDataService
/// <param name="idDiscriminator"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<DatesRangeDto> GetDatesRangeAsync(int idDiscriminator, CancellationToken token);
Task<DatesRangeDto> GetDatesRangeAsync(Guid idDiscriminator, CancellationToken token);
/// <summary>
/// Получить порцию записей, начиная с заданной даты
@ -23,7 +23,7 @@ public interface IWitsDataService
/// <param name="take"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WitsDataDto>> GetPart(int idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token);
Task<IEnumerable<WitsDataDto>> GetPart(Guid idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token);
/// <summary>
/// Получить диапазон дат, для которых есть данные в репозитории
@ -34,7 +34,7 @@ public interface IWitsDataService
/// <param name="approxPointsCount"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<IEnumerable<WitsDataDto>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo, int approxPointsCount, CancellationToken token);
Task<IEnumerable<WitsDataDto>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo, int approxPointsCount, CancellationToken token);
/// <summary>
/// Сохранить набор параметров

View File

@ -25,14 +25,14 @@ public class WitsDataService : IWitsDataService
this.witsInfo = GetWitsInfo();
}
public Task<DatesRangeDto> GetDatesRangeAsync(int idDiscriminator, CancellationToken token)
public Task<DatesRangeDto> GetDatesRangeAsync(Guid idDiscriminator, CancellationToken token)
{
var result = witsDataRepository.GetDatesRangeAsync(idDiscriminator, token);
return result;
}
public async Task<IEnumerable<WitsDataDto>> GetPart(int idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token)
public async Task<IEnumerable<WitsDataDto>> GetPart(Guid idDiscriminator, DateTimeOffset dateBegin, int take, CancellationToken token)
{
var dtos = await witsDataRepository.GetPart(idDiscriminator, dateBegin, take, token);
@ -41,7 +41,7 @@ public class WitsDataService : IWitsDataService
return result;
}
public async Task<IEnumerable<WitsDataDto>> GetValuesForGraph(int discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
public async Task<IEnumerable<WitsDataDto>> GetValuesForGraph(Guid discriminatorId, DateTimeOffset dateFrom, DateTimeOffset dateTo,
int approxPointsCount, CancellationToken token)
{
var intervalSec = (dateTo - dateFrom).TotalSeconds;