เพิ่ม Call API GetProfileByCheckInAsync ใช้แทนของเดิม

This commit is contained in:
Suphonchai Phoonsawat 2026-05-15 16:04:39 +07:00
parent 583569682d
commit e5f6a44f5f
2 changed files with 26 additions and 3 deletions

View file

@ -233,6 +233,29 @@ namespace BMA.EHR.Application.Repositories
throw;
}
}
public async Task<GetProfileByKeycloakIdDto?> GetProfileByCheckInAsync(Guid keycloakId, string? accessToken)
{
try
{
var apiPath = $"{_configuration["API"]}/org/dotnet/check-keycloak/{keycloakId}";
var apiKey = _configuration["API_KEY"];
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
if (apiResult != null)
{
var raw = JsonConvert.DeserializeObject<GetProfileByKeycloakIdResultDto>(apiResult);
if (raw != null)
return raw.Result;
}
return null;
}
catch
{
throw;
}
}
public async Task<GetProfileLeaveByKeycloakDto?> GetProfileLeaveByKeycloakIdAsync(Guid keycloakId, string? accessToken)