ปรับ api ให้รับ keycloak id จาก token
This commit is contained in:
parent
7098a8620d
commit
8716952c02
1 changed files with 5 additions and 5 deletions
|
|
@ -553,13 +553,13 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("check-status/{id:guid}")]
|
[HttpGet("check-status")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||||
[AllowAnonymous]
|
public async Task<ActionResult<ResponseObject>> CheckInCheckStatus()
|
||||||
public async Task<ActionResult<ResponseObject>> CheckInCheckStatus(Guid id)
|
|
||||||
{
|
{
|
||||||
|
var userId = UserId == null ? Guid.Empty : Guid.Parse(UserId);
|
||||||
var currentDate = DateTime.Now;
|
var currentDate = DateTime.Now;
|
||||||
var channel = _objectPool.Get();
|
var channel = _objectPool.Get();
|
||||||
try
|
try
|
||||||
|
|
@ -612,9 +612,9 @@ namespace BMA.EHR.Leave.Service.Controllers
|
||||||
}
|
}
|
||||||
|
|
||||||
// Step 3: ค้นหา taskIds ที่อยู่ใน messages ทั้งหมด
|
// Step 3: ค้นหา taskIds ที่อยู่ใน messages ทั้งหมด
|
||||||
var foundTasks = allMessages.FirstOrDefault(x => x.Contains(id.ToString("D")));
|
var foundTasks = allMessages.FirstOrDefault(x => x.Contains(userId.ToString("D")));
|
||||||
|
|
||||||
return Success(new { taskId = id, InQueue = foundTasks != null });
|
return Success(new { keycloakId = userId, InQueue = foundTasks != null });
|
||||||
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue