Смена типа дат для FileInfoDto

This commit is contained in:
Olga Nemt 2024-03-21 10:52:23 +05:00
parent 2ae1cd2e3d
commit 25138ec3ff
5 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ namespace AsbCloudApp.Data
/// дата загрузки /// дата загрузки
/// </summary> /// </summary>
[Required] [Required]
public DateTime UploadDate { get; set; } public DateTimeOffset UploadDate { get; set; }
/// <summary> /// <summary>
/// размер в байтах /// размер в байтах

View File

@ -278,7 +278,7 @@ namespace AsbCloudInfrastructure.Repository
private static FileInfoDto Convert(FileInfo entity, double timezoneOffset) private static FileInfoDto Convert(FileInfo entity, double timezoneOffset)
{ {
var dto = entity.Adapt<FileInfoDto>(); var dto = entity.Adapt<FileInfoDto>();
dto.UploadDate = entity.UploadDate.ToRemoteDateTime(timezoneOffset); dto.UploadDate = entity.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset));
dto.FileMarks = entity.FileMarks.Select(m => dto.FileMarks = entity.FileMarks.Select(m =>
{ {
var mark = m.Adapt<FileMarkDto>(); var mark = m.Adapt<FileMarkDto>();

View File

@ -480,7 +480,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
IdWell = fileEntity.IdWell, IdWell = fileEntity.IdWell,
Name = fileEntity.Name, Name = fileEntity.Name,
Size = fileEntity.Size, Size = fileEntity.Size,
UploadDate = fileEntity.UploadDate.ToRemoteDateTime(timezoneOffset), UploadDate = fileEntity.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)),
}; };
var marks = fileEntity.FileMarks?.Where(m => !m.IsDeleted); var marks = fileEntity.FileMarks?.Where(m => !m.IsDeleted);

View File

@ -106,7 +106,7 @@ public class ReportService : IReportService
IdWell = p.File.IdWell, IdWell = p.File.IdWell,
Name = p.File.Name, Name = p.File.Name,
Size = p.File.Size, Size = p.File.Size,
UploadDate = p.File.UploadDate.ToRemoteDateTime(timezoneOffset), UploadDate = p.File.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)),
}, },
IdWell = p.IdWell, IdWell = p.IdWell,
Date = p.File.UploadDate.ToRemoteDateTime(timezoneOffset), Date = p.File.UploadDate.ToRemoteDateTime(timezoneOffset),

View File

@ -39,7 +39,7 @@ public class FileServiceTest
IdCategory = idCategory, IdCategory = idCategory,
Name = fileName, Name = fileName,
Size = 0, Size = 0,
UploadDate = DateTime.Now UploadDate = DateTimeOffset.Now
}; };
private static FileMarkDto fileMark = new() private static FileMarkDto fileMark = new()