правки после ревью

This commit is contained in:
Olga Nemt 2024-05-29 17:55:01 +05:00
parent ad83d00d4a
commit 63280b60e2
4 changed files with 4 additions and 8 deletions

View File

@ -53,8 +53,6 @@ public class ProcessMapPlanBaseRequestWithWell : ProcessMapPlanBaseRequest
: base(request) : base(request)
{ {
IdWell = idWell; IdWell = idWell;
UpdateFrom = request.UpdateFrom;
Moment = request.Moment;
} }
/// <summary> /// <summary>

View File

@ -251,7 +251,6 @@ public abstract class ChangeLogRepositoryAbstract<TDto, TEntity, TRequest> : ICh
var entities = await query var entities = await query
.Where(e => e.Obsolete == null) .Where(e => e.Obsolete == null)
.OrderBy(e => e.Creation) .OrderBy(e => e.Creation)
.ThenBy(e => e.Obsolete)
.ThenBy(e => e.Id) .ThenBy(e => e.Id)
.ToArrayAsync(token); .ToArrayAsync(token);

View File

@ -11,7 +11,7 @@ namespace AsbCloudWebApi.IntegrationTests.Data
Hours = 1 Hours = 1
}; };
public static string RemoteUid = "555-555-555"; public const string RemoteUid = "555-555-555";
public static Deposit[] Deposits => new Deposit[] public static Deposit[] Deposits => new Deposit[]
{ {

View File

@ -158,7 +158,7 @@ public abstract class ProcessMapPlanBaseController<TDto> : ControllerBase
[HttpGet("history")] [HttpGet("history")]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<ActionResult<IEnumerable<ChangeLogDto<TDto>>>> Get([FromRoute] int idWell, DateTimeOffset? moment, CancellationToken token) public async Task<ActionResult<IEnumerable<ChangeLogDto<TDto>>>> GetHistory([FromRoute] int idWell, DateTimeOffset? moment, CancellationToken token)
{ {
await AssertUserHasAccessToWell(idWell, token); await AssertUserHasAccessToWell(idWell, token);
@ -178,18 +178,17 @@ public abstract class ProcessMapPlanBaseController<TDto> : ControllerBase
/// <param name="updateFrom"></param> /// <param name="updateFrom"></param>
/// <param name="token"></param> /// <param name="token"></param>
/// <returns></returns> /// <returns></returns>
[AllowAnonymous]
[HttpGet("/api/telemetry/{uid}/[controller]")] [HttpGet("/api/telemetry/{uid}/[controller]")]
[ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)] [ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
public async Task<ActionResult<IEnumerable<ChangeLogDto<TDto>>>> Get(string uid, DateTimeOffset? updateFrom, CancellationToken token) public async Task<ActionResult<IEnumerable<ChangeLogDto<TDto>>>> GetByUid(string uid, DateTimeOffset? updateFrom, CancellationToken token)
{ {
var idWell = telemetryService.GetIdWellByTelemetryUid(uid) ?? -1; var idWell = telemetryService.GetIdWellByTelemetryUid(uid) ?? -1;
if (idWell < 0) if (idWell < 0)
return this.ValidationBadRequest(nameof(uid), "Скважина по uid не найдена"); return this.ValidationBadRequest(nameof(uid), "Скважина по uid не найдена");
await AssertUserHasAccessToWell(idWell, token);
var serviceRequest = new ProcessMapPlanBaseRequestWithWell(new ProcessMapPlanBaseRequest() var serviceRequest = new ProcessMapPlanBaseRequestWithWell(new ProcessMapPlanBaseRequest()
{ {
UpdateFrom = updateFrom, UpdateFrom = updateFrom,