forked from ddrilling/AsbCloudServer
Смена типа дат для FileInfoDto
This commit is contained in:
parent
2ae1cd2e3d
commit
25138ec3ff
@ -43,7 +43,7 @@ namespace AsbCloudApp.Data
|
||||
/// дата загрузки
|
||||
/// </summary>
|
||||
[Required]
|
||||
public DateTime UploadDate { get; set; }
|
||||
public DateTimeOffset UploadDate { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// размер в байтах
|
||||
|
@ -278,7 +278,7 @@ namespace AsbCloudInfrastructure.Repository
|
||||
private static FileInfoDto Convert(FileInfo entity, double timezoneOffset)
|
||||
{
|
||||
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 =>
|
||||
{
|
||||
var mark = m.Adapt<FileMarkDto>();
|
||||
|
@ -480,7 +480,7 @@ namespace AsbCloudInfrastructure.Services.DrillingProgram
|
||||
IdWell = fileEntity.IdWell,
|
||||
Name = fileEntity.Name,
|
||||
Size = fileEntity.Size,
|
||||
UploadDate = fileEntity.UploadDate.ToRemoteDateTime(timezoneOffset),
|
||||
UploadDate = fileEntity.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)),
|
||||
};
|
||||
|
||||
var marks = fileEntity.FileMarks?.Where(m => !m.IsDeleted);
|
||||
|
@ -106,7 +106,7 @@ public class ReportService : IReportService
|
||||
IdWell = p.File.IdWell,
|
||||
Name = p.File.Name,
|
||||
Size = p.File.Size,
|
||||
UploadDate = p.File.UploadDate.ToRemoteDateTime(timezoneOffset),
|
||||
UploadDate = p.File.UploadDate.ToOffset(TimeSpan.FromHours(timezoneOffset)),
|
||||
},
|
||||
IdWell = p.IdWell,
|
||||
Date = p.File.UploadDate.ToRemoteDateTime(timezoneOffset),
|
||||
|
@ -39,7 +39,7 @@ public class FileServiceTest
|
||||
IdCategory = idCategory,
|
||||
Name = fileName,
|
||||
Size = 0,
|
||||
UploadDate = DateTime.Now
|
||||
UploadDate = DateTimeOffset.Now
|
||||
};
|
||||
|
||||
private static FileMarkDto fileMark = new()
|
||||
|
Loading…
Reference in New Issue
Block a user