using AsbCloudApp.Data.SAUB; using AsbCloudApp.Services; using AsbCloudDb.Model; using AsbCloudInfrastructure.Services.Cache; using Mapster; using System.Threading; using System.Threading.Tasks; namespace AsbCloudInfrastructure.Services.SAUB { public class TelemetryDataSpinService : TelemetryDataBaseService { public TelemetryDataSpinService( IAsbCloudDbContext db, ITelemetryService telemetryService, CacheDb cacheDb) : base(db, telemetryService, cacheDb) { } public override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset) { var entity = src.Adapt(); entity.DateTime = src.DateTime.ToUtcDateTimeOffset(timezoneOffset); return entity; } public override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset) { var dto = src.Adapt(); dto.DateTime = src.DateTime.ToRemoteDateTime(timezoneOffset); return dto; } } }