Правки по результатам ревью

This commit is contained in:
Olga Nemt 2024-05-23 12:25:37 +03:00
parent 7f683bc361
commit 28d9e74e45
4 changed files with 22 additions and 60 deletions

View File

@ -6,18 +6,13 @@ namespace AsbCloudApp.Data;
/// <summary>
/// Часть записи описывающая изменение
/// </summary>
public class ChangeLogDto<T>
public class ChangeLogDto<T> where T: IId
{
/// <summary>
/// Запись
/// </summary>
public required T Item { get; set; }
/// <summary>
/// ИД записи
/// </summary>
public int Id { get; set; }
/// <summary>
/// Автор
/// </summary>

View File

@ -1,10 +1,9 @@
using System;
using AsbCloudApp.Data;
using AsbCloudApp.Requests;
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using AsbCloudApp.Data;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Requests;
namespace AsbCloudApp.Repositories;
@ -12,26 +11,26 @@ namespace AsbCloudApp.Repositories;
/// Репозиторий для записей с историей
/// </summary>
public interface IChangeLogRepository<TDto, TRequest>
where TDto : ProcessMapPlanBaseDto
where TDto : IId
where TRequest : ChangeLogBaseRequest
{
/// <summary>
/// Добавление записей
/// </summary>
/// <param name="idUser"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> InsertRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
/// <summary>
/// Добавление записей
/// </summary>
/// <param name="idUser"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> InsertRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
/// <summary>
/// Редактирование записей
/// </summary>
/// <param name="idUser"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> UpdateRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
/// <summary>
/// Редактирование записей
/// </summary>
/// <param name="idUser"></param>
/// <param name="dtos"></param>
/// <param name="token"></param>
/// <returns></returns>
Task<int> UpdateRange(int idUser, IEnumerable<TDto> dtos, CancellationToken token);
/// <summary>
/// Добавляет Dto у которых id == 0, изменяет dto у которых id != 0

View File

@ -1,24 +0,0 @@
using System;
namespace AsbCloudApp.Requests;
/// <summary>
/// Запрос для получения РТК план
/// </summary>
public class ProcessMapPlanRequest
{
/// <summary>
/// Идентификатор скважины
/// </summary>
public int IdWell { get; set; }
/// <summary>
/// Тип секции
/// </summary>
public int? IdWellSectionType { get; set; }
/// <summary>
/// Дата обновления
/// </summary>
public DateTimeOffset? UpdateFrom { get; set; }
}

View File

@ -53,15 +53,7 @@ public class WellCompositeRepository : IWellCompositeRepository
/// <inheritdoc/>
public async Task<IEnumerable<ProcessMapPlanDrillingDto>> GetCompositeProcessMap(int idWell, CancellationToken token)
{
var dtos = await GetAsync(idWell, token);
var requests = dtos.Select(x => new ProcessMapPlanRequest {
IdWell = x.IdWellSrc,
IdWellSectionType = x.IdWellSectionType
});
//var result = await processMapPlanDrillingRepository.GetAsync(requests, token);
return Enumerable.Empty<ProcessMapPlanDrillingDto>();
return await Task.FromResult(Enumerable.Empty<ProcessMapPlanDrillingDto>());
}
private static WellComposite Convert(int idWell, WellCompositeDto dto)