เพิ่มapi list ตำแหน่งที่เลือกไปแล้ว

This commit is contained in:
Kittapath 2023-07-13 15:56:53 +07:00
parent 94b1e3b848
commit c301296605

View file

@ -16,10 +16,10 @@ using System.Security.Cryptography;
namespace BMA.EHR.Placement.Service.Controllers
{
[Route("api/v{version:apiVersion}/placement")]
[ApiVersion("1.0")]
[ApiController]
[Produces("application/json")]
[Authorize]
[ApiVersion("1.0")]
[ApiController]
[Produces("application/json")]
[Authorize]
[SwaggerTag("ระบบบรรจุ")]
public class PlacementController : BaseController
{
@ -316,6 +316,7 @@ namespace BMA.EHR.Placement.Service.Controllers
ExamRound = x.ExamRound,
Pass = x.Pass,
IsProperty = x.IsProperty == null ? null : Newtonsoft.Json.JsonConvert.DeserializeObject<List<PersonPropertyRequest>>(x.IsProperty),
BmaOfficer = _documentService.CheckBmaOfficer(x.CitizenId),
}).FirstOrDefaultAsync(x => x.PersonalId == personalId);
return Success(data);
@ -869,5 +870,16 @@ namespace BMA.EHR.Placement.Service.Controllers
return Success();
}
[HttpGet("position/use")]
public async Task<ActionResult<ResponseObject>> GetPositionUse()
{
var position = await _context.PlacementProfiles
.Where(x => x.PositionNumber != null)
.Select(x => x.PositionNumber.Id)
.ToListAsync();
return Success(position);
}
}
}