เครื่องราชเช็คตามรายการ
This commit is contained in:
parent
2efc1910f6
commit
a951378b1f
21 changed files with 57711 additions and 61 deletions
|
|
@ -601,7 +601,28 @@ namespace BMA.EHR.Application.Repositories
|
|||
}
|
||||
}
|
||||
|
||||
public async Task<List<GetActiveRootDto>> GetActiveRootLatestAsync(string? accessToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/active/root/all";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
|
||||
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetActiveRootResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public async Task PostProfileInsigniaAsync(PostProfileInsigniaDto body, string? accessToken)
|
||||
{
|
||||
|
|
@ -622,6 +643,28 @@ namespace BMA.EHR.Application.Repositories
|
|||
|
||||
}
|
||||
|
||||
public async Task<GetIsOfficerDto> GetIsOfficerRootAsync(string? accessToken, string sys)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/workflow/keycloak/isofficer-root/{sys}";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
var apiResult = await GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetIsOfficerResultDto>(apiResult);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
return new GetIsOfficerDto { isOfficer = false, isStaff = false, isDirector = false };
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue