DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSpinService.cs
2024-08-19 10:01:07 +05:00

33 lines
1.0 KiB
C#

using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using Mapster;
namespace AsbCloudInfrastructure.Services.SAUB;
public class TelemetryDataSpinService : TelemetryDataBaseService<TelemetryDataSpinDto, TelemetryDataSpin>
{
public TelemetryDataSpinService(
IAsbCloudDbContext db,
ITelemetryService telemetryService,
ITelemetryDataCache<TelemetryDataSpinDto> telemetryDataCache)
: base(db, telemetryService, telemetryDataCache)
{ }
protected override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset)
{
var entity = src.Adapt<TelemetryDataSpin>();
entity.DateTime = src.DateTime.ToUtcDateTimeOffset(timezoneOffset);
return entity;
}
protected override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset)
{
var dto = src.Adapt<TelemetryDataSpinDto>();
dto.DateTime = src.DateTime.ToRemoteDateTime(timezoneOffset);
return dto;
}
}