2021-09-17 16:24:01 +05:00
|
|
|
|
using AsbCloudApp.Data;
|
|
|
|
|
using AsbCloudApp.Services;
|
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
using AsbCloudInfrastructure.Services.Cache;
|
|
|
|
|
using Mapster;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services
|
|
|
|
|
{
|
2021-11-22 11:30:08 +05:00
|
|
|
|
public class TelemetryDataSpinService : TelemetryDataBaseService<TelemetryDataSpinDto, TelemetryDataSpin>
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
|
|
|
|
public TelemetryDataSpinService(
|
|
|
|
|
IAsbCloudDbContext db,
|
|
|
|
|
ITelemetryService telemetryService,
|
|
|
|
|
CacheDb cacheDb)
|
|
|
|
|
: base(db, telemetryService, cacheDb)
|
|
|
|
|
{ }
|
|
|
|
|
|
2022-01-05 17:50:45 +05:00
|
|
|
|
public override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset)
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
|
|
|
|
var entity = src.Adapt<TelemetryDataSpin>();
|
2022-01-05 17:50:45 +05:00
|
|
|
|
entity.Date = src.Date.ToUtcDateTimeOffset(timezoneOffset);
|
2021-09-17 16:24:01 +05:00
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-05 17:50:45 +05:00
|
|
|
|
public override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset)
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
|
|
|
|
var dto = src.Adapt<TelemetryDataSpinDto>();
|
2022-01-05 17:50:45 +05:00
|
|
|
|
dto.Date = src.Date.ToRemoteDateTime(timezoneOffset);
|
2021-09-17 16:24:01 +05:00
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|