forked from ddrilling/AsbCloudServer
Merge branch 'dev' of https://bitbucket.org/autodrilling/asbcloudserver into dev
This commit is contained in:
commit
f7fedb16e8
@ -9,5 +9,8 @@ namespace AsbCloudApp.Services
|
|||||||
{
|
{
|
||||||
Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell, double startDepth,
|
Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell, double startDepth,
|
||||||
double endDepth, CancellationToken token = default);
|
double endDepth, CancellationToken token = default);
|
||||||
|
|
||||||
|
Task<IEnumerable<DrillParamsDto>> GetAllAsync(int idWell,
|
||||||
|
CancellationToken token = default);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,12 @@
|
|||||||
using System.Linq;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AsbCloudApp.Data;
|
using AsbCloudApp.Data;
|
||||||
using AsbCloudApp.Services;
|
using AsbCloudApp.Services;
|
||||||
using AsbCloudDb.Model;
|
using AsbCloudDb.Model;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
using Mapster;
|
||||||
|
|
||||||
namespace AsbCloudInfrastructure.Services
|
namespace AsbCloudInfrastructure.Services
|
||||||
{
|
{
|
||||||
@ -19,6 +21,7 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
this.db = context;
|
this.db = context;
|
||||||
this.telemetryService = telemetryService;
|
this.telemetryService = telemetryService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell,
|
public async Task<DrillParamsDto> GetDefaultDrillParamsAsync(int idWell,
|
||||||
double startDepth, double endDepth, CancellationToken token = default)
|
double startDepth, double endDepth, CancellationToken token = default)
|
||||||
{
|
{
|
||||||
@ -111,6 +114,20 @@ namespace AsbCloudInfrastructure.Services
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IEnumerable<DrillParamsDto>> GetAllAsync(int idWell,
|
||||||
|
CancellationToken token = default)
|
||||||
|
{
|
||||||
|
var entities = await (from p in db.DrillParams
|
||||||
|
where p.IdWell == idWell
|
||||||
|
orderby p.Id
|
||||||
|
select p)
|
||||||
|
.ToListAsync(token)
|
||||||
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
|
var dto = entities.Select(entity => entity.Adapt<DrillParamsDto>());
|
||||||
|
return dto;
|
||||||
|
}
|
||||||
|
|
||||||
private IQueryable<IGrouping<int, TelemetryDataSaub>> GetTelemetryGroupQuery(int idTelemetry,
|
private IQueryable<IGrouping<int, TelemetryDataSaub>> GetTelemetryGroupQuery(int idTelemetry,
|
||||||
double startDepth, double endDepth)
|
double startDepth, double endDepth)
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ namespace AsbCloudWebApi.Controllers
|
|||||||
idWell, token).ConfigureAwait(false))
|
idWell, token).ConfigureAwait(false))
|
||||||
return Forbid();
|
return Forbid();
|
||||||
|
|
||||||
var dto = await drillParamsService.GetAsync(idWell, token);
|
var dto = await drillParamsService.GetAllAsync(idWell, token);
|
||||||
|
|
||||||
return Ok(dto);
|
return Ok(dto);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user