forked from ddrilling/AsbCloudServer
nit fixes
This commit is contained in:
parent
41663eabcb
commit
8eaad67496
@ -4,10 +4,8 @@ using System.Collections.Generic;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
|
||||||
namespace AsbCloudApp.Repositories
|
namespace AsbCloudApp.Repositories
|
||||||
{
|
{
|
||||||
#nullable enable
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// данные ГТИ
|
/// данные ГТИ
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -44,5 +42,4 @@ namespace AsbCloudApp.Repositories
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<IEnumerable<WitsItemRecordDto>> GetLastDataByRecordIdAsync(int idWell, int idRecord, CancellationToken token = default);
|
Task<IEnumerable<WitsItemRecordDto>> GetLastDataByRecordIdAsync(int idWell, int idRecord, CancellationToken token = default);
|
||||||
}
|
}
|
||||||
#nullable disable
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,6 @@ using System.Threading.Tasks;
|
|||||||
|
|
||||||
namespace AsbCloudInfrastructure.Repository
|
namespace AsbCloudInfrastructure.Repository
|
||||||
{
|
{
|
||||||
|
|
||||||
public class GtrWitsRepository : IGtrRepository
|
public class GtrWitsRepository : IGtrRepository
|
||||||
{
|
{
|
||||||
private readonly IAsbCloudDbContext db;
|
private readonly IAsbCloudDbContext db;
|
||||||
@ -64,7 +63,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
Items = g.Select(r => new
|
Items = g.Select(r => new
|
||||||
{
|
{
|
||||||
Key = r.IdItem,
|
Key = r.IdItem,
|
||||||
Value = r.Value
|
r.Value
|
||||||
}).ToDictionary(x => x.Key, x => x.Value)
|
}).ToDictionary(x => x.Key, x => x.Value)
|
||||||
});
|
});
|
||||||
return dtos;
|
return dtos;
|
||||||
@ -89,7 +88,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
var recordAllFloat = await GetGroupedItemsOrDefaultAsync<WitsItemFloat, float>(witsRequest, token);
|
var recordAllFloat = await GetGroupedItemsOrDefaultAsync<WitsItemFloat, float>(witsRequest, token);
|
||||||
var recordAllString = await GetGroupedItemsOrDefaultAsync<WitsItemString, string>(witsRequest, token);
|
var recordAllString = await GetGroupedItemsOrDefaultAsync<WitsItemString, string>(witsRequest, token);
|
||||||
|
|
||||||
var dtos = (recordAllFloat.Union(recordAllInt)).Union(recordAllString).ToArray();
|
var dtos = recordAllFloat.Union(recordAllInt).Union(recordAllString);
|
||||||
return dtos;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,7 +115,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
.ToArrayAsync(token)
|
.ToArrayAsync(token)
|
||||||
.ConfigureAwait(false);
|
.ConfigureAwait(false);
|
||||||
|
|
||||||
var entities = groupedEntities
|
var dtos = groupedEntities
|
||||||
.Select(e => new WitsItemRecordDto()
|
.Select(e => new WitsItemRecordDto()
|
||||||
{
|
{
|
||||||
IdRecord = e.IdRecord,
|
IdRecord = e.IdRecord,
|
||||||
@ -125,7 +124,7 @@ namespace AsbCloudInfrastructure.Repository
|
|||||||
Value = new JsonValue(e.Data!.Value)
|
Value = new JsonValue(e.Data!.Value)
|
||||||
});
|
});
|
||||||
|
|
||||||
return entities;
|
return dtos;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async Task<IEnumerable<WitsItemRecordDto>> GetItemsOrDefaultAsync<TEntity, TValue>(
|
private async Task<IEnumerable<WitsItemRecordDto>> GetItemsOrDefaultAsync<TEntity, TValue>(
|
||||||
|
Loading…
Reference in New Issue
Block a user