This commit is contained in:
parent
f6594f9773
commit
0c9ec3dd43
5 changed files with 99 additions and 70 deletions
|
|
@ -1188,6 +1188,29 @@ namespace BMA.EHR.Application.Repositories
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
public GetOrgProfileByProfileIdDto GetOrgProfileByProfileId(Guid id, string? accessToken)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apiPath = $"{_configuration["API"]}/org/profile/org-user/{id}";
|
||||
var apiKey = _configuration["API_KEY"];
|
||||
|
||||
var apiResult = GetExternalAPIAsync(apiPath, accessToken ?? "", apiKey);
|
||||
if (apiResult.Result != null)
|
||||
{
|
||||
var raw = JsonConvert.DeserializeObject<GetOrgProfileByProfileIdResultDto>(apiResult.Result);
|
||||
if (raw != null)
|
||||
return raw.Result;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Application.Responses.Profiles
|
||||
{
|
||||
public class GetOrgProfileByProfileIdDto
|
||||
{
|
||||
public string? Root { get; set; }
|
||||
public string? Child1 { get; set; }
|
||||
public string? Child2 { get; set; }
|
||||
public string? Child3 { get; set; }
|
||||
public string? Child4 { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
namespace BMA.EHR.Application.Responses.Profiles
|
||||
{
|
||||
public class GetOrgProfileByProfileIdResultDto
|
||||
{
|
||||
public string Message { get; set; } = string.Empty;
|
||||
|
||||
public int Status { get; set; } = -1;
|
||||
|
||||
public GetOrgProfileByProfileIdDto? Result { get; set; }
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue