DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/SAUB/TelemetryDataSpinService.cs

35 lines
1.1 KiB
C#
Raw Normal View History

using AsbCloudApp.Data.SAUB;
using AsbCloudApp.Repositories;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using Mapster;
2022-04-11 18:00:34 +05:00
namespace AsbCloudInfrastructure.Services.SAUB
{
2021-11-22 11:30:08 +05:00
public class TelemetryDataSpinService : TelemetryDataBaseService<TelemetryDataSpinDto, TelemetryDataSpin>
{
public TelemetryDataSpinService(
IAsbCloudDbContext db,
ITelemetryService telemetryService,
ITelemetryDataCache<TelemetryDataSpinDto> telemetryDataCache)
: base(db, telemetryService, telemetryDataCache)
{ }
2024-02-20 14:37:58 +05:00
protected override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset)
{
var entity = src.Adapt<TelemetryDataSpin>();
2022-04-08 13:10:06 +05:00
entity.DateTime = src.DateTime.ToUtcDateTimeOffset(timezoneOffset);
return entity;
}
2024-02-20 14:37:58 +05:00
protected override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset)
{
var dto = src.Adapt<TelemetryDataSpinDto>();
2022-04-08 13:10:06 +05:00
dto.DateTime = src.DateTime.ToRemoteDateTime(timezoneOffset);
return dto;
}
}
}