2022-04-08 13:10:06 +05:00
|
|
|
|
using AsbCloudApp.Data.SAUB;
|
2023-10-24 09:23:07 +05:00
|
|
|
|
using AsbCloudApp.Repositories;
|
2021-09-17 16:24:01 +05:00
|
|
|
|
using AsbCloudApp.Services;
|
|
|
|
|
using AsbCloudDb.Model;
|
|
|
|
|
using Mapster;
|
|
|
|
|
|
2022-04-11 18:00:34 +05:00
|
|
|
|
namespace AsbCloudInfrastructure.Services.SAUB
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
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,
|
2023-10-24 09:23:07 +05:00
|
|
|
|
ITelemetryDataCache<TelemetryDataSpinDto> telemetryDataCache)
|
2022-11-18 12:58:53 +05:00
|
|
|
|
: base(db, telemetryService, telemetryDataCache)
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{ }
|
|
|
|
|
|
2024-02-20 14:37:58 +05:00
|
|
|
|
protected override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset)
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
|
|
|
|
var entity = src.Adapt<TelemetryDataSpin>();
|
2022-04-08 13:10:06 +05:00
|
|
|
|
entity.DateTime = src.DateTime.ToUtcDateTimeOffset(timezoneOffset);
|
2021-09-17 16:24:01 +05:00
|
|
|
|
return entity;
|
|
|
|
|
}
|
|
|
|
|
|
2024-02-20 14:37:58 +05:00
|
|
|
|
protected override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset)
|
2021-09-17 16:24:01 +05:00
|
|
|
|
{
|
|
|
|
|
var dto = src.Adapt<TelemetryDataSpinDto>();
|
2022-04-08 13:10:06 +05:00
|
|
|
|
dto.DateTime = src.DateTime.ToRemoteDateTime(timezoneOffset);
|
2021-09-17 16:24:01 +05:00
|
|
|
|
return dto;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-04-18 16:22:53 +05:00
|
|
|
|
|
2021-09-17 16:24:01 +05:00
|
|
|
|
}
|