featute/ChangeLog #6

Merged
on.nemtina merged 25 commits from featute/ChangeLog into master 2024-12-09 17:44:48 +05:00
2 changed files with 10 additions and 10 deletions
Showing only changes of commit 8d2a22a38f - Show all commits

View File

@ -17,7 +17,7 @@ public interface IChangeLogClient
/// <param name="idDiscriminator"></param>
/// <param name="dtos"></param>
/// <returns></returns>
[Post($"{BaseRoute}/replace")]
[Post($"{BaseRoute}/replace/{{idDiscriminator}}")]
Task<IApiResponse<int>> ClearAndAddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
/// <summary>
@ -28,10 +28,10 @@ public interface IChangeLogClient
/// <param name="filterRequest">параметры запроса фильтрации</param>
/// <param name="paginationRequest">параметры запроса пагинации</param>
/// <returns></returns>
[Get($"{BaseRoute}/moment")]
[Get($"{BaseRoute}/moment/{{idDiscriminator}}")]
Task<IApiResponse<PaginationContainer<DataWithWellDepthAndSectionDto>>> GetByDate(
Guid idDiscriminator,
DateTimeOffset moment,
Guid idDiscriminator,
DateTimeOffset moment,
[Query] SectionPartRequest filterRequest,
[Query] PaginationRequest paginationRequest);
@ -42,7 +42,7 @@ public interface IChangeLogClient
/// <param name="dateBegin"></param>
/// <param name="dateEnd"></param>
/// <returns></returns>
[Get($"{BaseRoute}/history")]
[Get($"{BaseRoute}/history/{{idDiscriminator}}")]
Task<IApiResponse<IEnumerable<ChangeLogDto>>> GetChangeLogForInterval(Guid idDiscriminator, DateTimeOffset dateBegin, DateTimeOffset dateEnd);
/// <summary>
@ -51,7 +51,7 @@ public interface IChangeLogClient
/// <param name="idDiscriminator"></param>
/// <param name="dto"></param>
/// <returns></returns>
[Post($"{BaseRoute}")]
[Post($"{BaseRoute}/{{idDiscriminator}}")]
Task<IApiResponse<int>> Add(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto);
/// <summary>
@ -60,7 +60,7 @@ public interface IChangeLogClient
/// <param name="idDiscriminator"></param>
/// <param name="dtos"></param>
/// <returns></returns>
[Post($"{BaseRoute}/range")]
[Post($"{BaseRoute}/range/{{idDiscriminator}}")]
Task<IApiResponse<int>> AddRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
/// <summary>
@ -69,7 +69,7 @@ public interface IChangeLogClient
/// <param name="idDiscriminator"></param>
/// <param name="dto"></param>
/// <returns></returns>
[Put($"{BaseRoute}")]
[Put($"{BaseRoute}/{{idDiscriminator}}")]
Task<IApiResponse<int>> Update(Guid idDiscriminator, DataWithWellDepthAndSectionDto dto);
/// <summary>
@ -78,7 +78,7 @@ public interface IChangeLogClient
/// <param name="idDiscriminator"></param>
/// <param name="dtos"></param>
/// <returns></returns>
[Put($"{BaseRoute}/range")]
[Put($"{BaseRoute}/range/{{idDiscriminator}}")]
Task<IApiResponse<int>> UpdateRange(Guid idDiscriminator, IEnumerable<DataWithWellDepthAndSectionDto> dtos);
/// <summary>

View File

@ -35,7 +35,7 @@ public class ChangeLogRepository : IChangeLogRepository
{
Review

Стоит проверить, что количество записей совпадает с количеством ids. Если не совпадает - исключение

Стоит проверить, что количество записей совпадает с количеством ids. Если не совпадает - исключение
var query = db.Set<ChangeLog>()
.Where(s => ids.Contains(s.Id))
.Where(s => s.Obsolete != null);
.Where(s => s.Obsolete == null);
if (query.Count() != ids.Count())
{