set path position

This commit is contained in:
Kittapath 2023-04-09 23:15:08 +07:00
parent 5abeada4a6
commit 899826e882
7 changed files with 295 additions and 266 deletions

View file

@ -8,10 +8,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Response
public string? Id { get; set; }
public string? Category { get; set; }
public string? Category_id { get; set; }
public DateTime? Start { get; set; }
public DateTime? End { get; set; }
public DateTime? Exam_date { get; set; }
public DateTime? Announcement_date { get; set; }
public string? Start { get; set; }
public string? End { get; set; }
public string? Exam_date { get; set; }
public string? Announcement_date { get; set; }
public string? Announcement_endDate { get; set; }
public string? Title { get; set; }
public string? Detail { get; set; }
public string? Image { get; set; }

View file

@ -34,6 +34,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
_minioService = minioService;
}
public static IConfigurationRoot Configuration
{
get
{
return new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json")
.Build();
}
}
#endregion
#region " Properties "
@ -325,10 +336,11 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Id = x.Id.ToString(),
Category = "doctor",
Category_id = "doctor",
Start = x.ExamDate,
End = x.ExamDate,
Exam_date = x.ExamDate,
Announcement_date = x.AnnouncementStartDate,
Start = x.ExamDate.ToShortDateString(),
End = x.ExamDate.ToShortDateString(),
Exam_date = x.ExamDate.ToShortDateString(),
Announcement_date = x.AnnouncementStartDate.ToShortDateString(),
Announcement_endDate = x.AnnouncementEndDate.ToShortDateString(),
Title = x.Name,
Image = x.PeriodExamImages.OrderBy(o => o.CreatedAt).FirstOrDefault() == null ?
"" :
@ -356,12 +368,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
var periodExam = await _context.PeriodExams.AsQueryable()
.Where(x => x.Id == Guid.Parse(examId))
.Include(x => x.PeriodExamImages)
.Include(x => x.PeriodExamDocuments)
.Include(x => x.PositionExam)
.Select(x => new CMSExamResponseItem
{
Id = x.Id.ToString(),
Category = "doctor",
Category_id = "doctor",
Start = x.ExamDate,
Start = x.AnnouncementStartDate.ToShortDateString(),
End = x.AnnouncementEndDate.ToShortDateString(),
Title = x.Name,
Detail = x.Detail,
Images = x.PeriodExamImages.Select(s => new HomePageLinkResponseItem
@ -377,7 +392,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
Positions = x.PositionExam.Select(s => new HomePageLinkResponseItem
{
Title = s.Id.ToString(),
Url = $"{x.Id}/{s.Id}",
Url = $"{Configuration.GetValue<string>("Domain")}/exam/{x.Id}/{s.Id}",
}).ToList(),
})
.FirstOrDefaultAsync();
@ -385,6 +400,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Services
if (periodExam == null)
throw new Exception(GlobalMessages.ExamNotFound);
if (periodExam.Positions.Count() == 0)
{
periodExam.Positions.Add(new HomePageLinkResponseItem
{
Title = "x.Name",
Url = $"{Configuration.GetValue<string>("Domain")}/exam/{periodExam.Id}/00000000-0000-0000-0000-000000000000"
});
}
var i = 0;
foreach (var item in periodExam.Images)
{

View file

@ -30,5 +30,6 @@
"AccessKey": "frappet",
"SecretKey": "P@ssw0rd",
"BucketName": "bma-recruit"
}
},
"Domain": "http://localhost:5173"
}

View file

@ -30,5 +30,6 @@
"AccessKey": "frappet",
"SecretKey": "P@ssw0rd",
"BucketName": "bma-recruit"
}
},
"Domain": "http://localhost:5173"
}

View file

@ -30,5 +30,6 @@
"AccessKey": "frappet",
"SecretKey": "P@ssw0rd",
"BucketName": "bma-recruit"
}
},
"Domain": "http://localhost:5173"
}

View file

@ -30,5 +30,6 @@
"AccessKey": "frappet",
"SecretKey": "P@ssw0rd",
"BucketName": "bma-recruit"
}
},
"Domain": "http://localhost:5173"
}

File diff suppressed because it is too large Load diff