no message
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
Bright 2025-01-29 13:25:38 +07:00
parent 01f16eaef4
commit e7ba802279
2 changed files with 16 additions and 3 deletions

View file

@ -4,6 +4,10 @@ using BMA.EHR.Domain.Models.Retirement;
using Microsoft.AspNetCore.Http;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Newtonsoft.Json;
using System.Net.Http.Headers;
using System.Security.Claims;
using System.Text;
namespace BMA.EHR.Application.Repositories
{
@ -24,6 +28,13 @@ namespace BMA.EHR.Application.Repositories
_configuration = configuration;
}
#region " Properties "
private string? UserId => _httpContextAccessor?.HttpContext?.User?.FindFirst(ClaimTypes.NameIdentifier)?.Value;
private string? FullName => _httpContextAccessor?.HttpContext?.User?.FindFirst("name")?.Value;
private string? token => _httpContextAccessor?.HttpContext?.Request.Headers["Authorization"];
#endregion
//ปลดออก
public async Task NotifyDischarge()
{
@ -111,8 +122,8 @@ namespace BMA.EHR.Application.Repositories
.ToList();
//ข้าราชการ
var apiUrl = $"{_configuration["API"]}/org/unauthorize/retirement";
//var apiUrl = $"http://localhost:13001/api/v1/org/unauthorize/retirement";
//var apiUrl = $"{_configuration["API"]}/org/unauthorize/retirement";
var apiUrl = $"http://localhost:13001/api/v1/org/unauthorize/retirement";
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token.Replace("Bearer ", ""));