diff --git a/AsbCloudApp/Data/FluidDataDto.cs b/AsbCloudApp/Data/FluidDataDto.cs index abf36da4..e296fcf5 100644 --- a/AsbCloudApp/Data/FluidDataDto.cs +++ b/AsbCloudApp/Data/FluidDataDto.cs @@ -2,32 +2,34 @@ { public class FluidDataDto { - public string Temperature { get; set; } - public string Density { get; set; } - public string ConditionalViscosity { get; set; } - public string R300 { get; set; } - public string R600 { get; set; } - public string R3r6 { get; set; } - public string DnsDpa { get; set; } - public string PlasticViscocity { get; set; } - public string SnsDpa { get; set; } - public string R3r649С { get; set; } - public string Dns49Cdpa { get; set; } - public string PlasticViscocity49c { get; set; } - public string Sns49Cdpa { get; set; } - public string Mbt { get; set; } - public string Sand { get; set; } - public string Filtering { get; set; } - public string Crust { get; set; } - public string Ktk { get; set; } - public string Ph { get; set; } - public string Hardness { get; set; } - public string Chlorides { get; set; } - public string Pf { get; set; } - public string Mf { get; set; } - public string Pm { get; set; } - public string FluidSolidPhase { get; set; } - public string Grease { get; set; } - public string CalciumCarbonate { get; set; } + public int Key { get; set; } + public string Name { get; set; } + public double Temperature { get; set; } + public double Density { get; set; } + public double ConditionalViscosity { get; set; } + public double R300 { get; set; } + public double R600 { get; set; } + public double R3r6 { get; set; } + public double DnsDpa { get; set; } + public double PlasticViscocity { get; set; } + public double SnsDpa { get; set; } + public double R3r649С { get; set; } + public double Dns49Cdpa { get; set; } + public double PlasticViscocity49c { get; set; } + public double Sns49Cdpa { get; set; } + public double Mbt { get; set; } + public double Sand { get; set; } + public double Filtering { get; set; } + public double Crust { get; set; } + public double Ktk { get; set; } + public double Ph { get; set; } + public double Hardness { get; set; } + public double Chlorides { get; set; } + public double Pf { get; set; } + public double Mf { get; set; } + public double Pm { get; set; } + public double FluidSolidPhase { get; set; } + public double Grease { get; set; } + public double CalciumCarbonate { get; set; } } } diff --git a/AsbCloudApp/Data/MudDiagramDataDto.cs b/AsbCloudApp/Data/MudDiagramDataDto.cs index bd801445..ef3a81c4 100644 --- a/AsbCloudApp/Data/MudDiagramDataDto.cs +++ b/AsbCloudApp/Data/MudDiagramDataDto.cs @@ -2,6 +2,7 @@ { public class MudDiagramDataDto { + public int Key { get; set; } public double ProbeNumber { get; set; } public double ProbeExtractionDepth { get; set; } public double Sandstone { get; set; } @@ -13,7 +14,7 @@ public double Clay { get; set; } public double Camstone { get; set; } public double Cement { get; set; } - public string Summary { get; set; } + public double Summary { get; set; } public double DrillingMud { get; set; } public double Sludge { get; set; } public double MaxSum { get; set; } @@ -23,6 +24,6 @@ public double Butane { get; set; } public double Pentane { get; set; } public double MechanicalSpeed { get; set; } - public string PreliminaryConclusion { get; set; } + public double PreliminaryConclusion { get; set; } } } diff --git a/AsbCloudApp/Data/NnbDataDto.cs b/AsbCloudApp/Data/NnbDataDto.cs index 8812e6a0..0d7b02e5 100644 --- a/AsbCloudApp/Data/NnbDataDto.cs +++ b/AsbCloudApp/Data/NnbDataDto.cs @@ -2,6 +2,7 @@ { public class NnbDataDto { + public int Key { get; set; } public double Depth { get; set; } public double ZenithAngle { get; set; } public double TrueAzimuth { get; set; } diff --git a/AsbCloudDb/Model/FluidData.cs b/AsbCloudDb/Model/FluidData.cs index 3a2e5a9c..65aa41be 100644 --- a/AsbCloudDb/Model/FluidData.cs +++ b/AsbCloudDb/Model/FluidData.cs @@ -1,10 +1,9 @@ -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace AsbCloudDb.Model +namespace AsbCloudDb.Model { public class FluidData { + public int Key { get; set; } + public string Name { get; set; } public double Temperature { get; set; } public double Density { get; set; } public double ConditionalViscosity { get; set; } diff --git a/AsbCloudDb/Model/MudDiagramData.cs b/AsbCloudDb/Model/MudDiagramData.cs index 82dd39ad..666d4b3b 100644 --- a/AsbCloudDb/Model/MudDiagramData.cs +++ b/AsbCloudDb/Model/MudDiagramData.cs @@ -2,6 +2,7 @@ { public class MudDiagramData { + public int Key { get; set; } public double ProbeNumber { get; set; } public double ProbeExtractionDepth { get; set; } public double Sandstone { get; set; } diff --git a/AsbCloudDb/Model/NnbData.cs b/AsbCloudDb/Model/NnbData.cs index 010ce917..7fdf09cb 100644 --- a/AsbCloudDb/Model/NnbData.cs +++ b/AsbCloudDb/Model/NnbData.cs @@ -2,6 +2,7 @@ { public class NnbData { + public int Key { get; set; } public double Depth { get; set; } public double ZenithAngle { get; set; } public double TrueAzimuth { get; set; } diff --git a/AsbCloudInfrastructure/Services/LastDataService.cs b/AsbCloudInfrastructure/Services/LastDataService.cs index f9edceec..8b1a6799 100644 --- a/AsbCloudInfrastructure/Services/LastDataService.cs +++ b/AsbCloudInfrastructure/Services/LastDataService.cs @@ -3,10 +3,11 @@ using System.Linq; using AsbCloudDb.Model; using AsbCloudApp.Services; using Mapster; +using System.Text.Json; namespace AsbCloudInfrastructure.Services { - public class LastDataService : ILastDataService + public class LastDataService : ILastDataService where Tdto : new() { private readonly IAsbCloudDbContext db; @@ -21,9 +22,9 @@ namespace AsbCloudInfrastructure.Services e.IdWell == idWell && e.IdCategory == idCategory); if (entity is null) - return default; + return new Tdto(); - var dto = entity.Adapt(); + var dto = JsonSerializer.Deserialize(entity.Data.ToString()); return dto; } diff --git a/AsbCloudWebApi/Controllers/LastDataController.cs b/AsbCloudWebApi/Controllers/LastDataController.cs index 449c9166..27f8894d 100644 --- a/AsbCloudWebApi/Controllers/LastDataController.cs +++ b/AsbCloudWebApi/Controllers/LastDataController.cs @@ -25,8 +25,8 @@ namespace AsbCloudWebApi.Controllers if (idCompany is null || !wellService.IsCompanyInvolvedInWell((int)idCompany, idWell)) return Forbid(); - lastDataService.Get(idWell, idCategory); - return Ok(); + var result = lastDataService.Get(idWell, idCategory); + return Ok(result); } [HttpPost]