// using BMA.EHR.Core; using BMA.EHR.Recurit.Exam.Service.Core; using BMA.EHR.Recurit.Exam.Service.Request; using BMA.EHR.Recurit.Exam.Service.Response; using BMA.EHR.Recurit.Exam.Service.Services; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json.Linq; using Newtonsoft.Json; using Swashbuckle.AspNetCore.Annotations; namespace BMA.EHR.Recurit.Exam.Service.Controllers { [Route("api/v{version:apiVersion}/candidate")] [ApiVersion("1.0")] [ApiController] [Produces("application/json")] [Authorize] [SwaggerTag("จัดการข้อมูลสมัครสอบ เพื่อนำไปใช้งานในระบบ")] public class CandidateController : BaseController { #region " Fields " private readonly CandidateService _candidateService; private readonly MinIOService _minioService; private readonly PermissionRepository _permission; #endregion #region " Constructor and Destructor " public CandidateController(CandidateService candidateService, MinIOService minioService, PermissionRepository permission) { _candidateService = candidateService; _minioService = minioService; _permission = permission; } #endregion #region " Methods " /// /// ข้อมูล สถานะ ผู้สมัครสอบ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล สถานะ ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("status/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetStatusCandidateService(string examId, string positionId) { try { var item = await _candidateService.GetStatusCandidateService(examId, positionId); return Success(item); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูลผู้สมัครสอบ /// /// Id ผู้สมัคร /// /// เมื่อทำการดึง ข้อมูลผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsync(string candidateId) { try { var items = await _candidateService.GetsAsync(candidateId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล ข้อมูลส่วนตัว ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("information/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncInformation(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncInformation(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล ข้อมูลที่อยู่ ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล ข้อมูลที่อยู่ ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("address/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncAddress(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncAddress(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล ข้อมูลครอบครัว ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล ข้อมูลครอบครัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("family/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncFamily(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncFamily(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล อาชีพ ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล อาชีพ ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("occupation/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncOccupation(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncOccupation(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล บุคคลที่สามารถติดต่อได้ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล บุคคลที่สามารถติดต่อได้ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("contact/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncContact(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncContact(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("career/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncCareer(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncCareer(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ข้อมูล ประวัติการศีกษา ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการดึง ข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("education/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncEducation(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncEducation(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ตรวจสอบว่าผู้ใช้งานสมัครสอบหรือยัง /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการตรวจสอบว่าผู้ใช้งานสมัครสอบหรือยัง สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("check/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncRegisterExam(Guid examId, Guid positionId) { try { var items = await _candidateService.GetsAsyncRegisterExam(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลส่วนตัว /// /// เมื่อทำการอัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsync(string examId, string positionId, CandidateResponseItem candidateInformation) { try { await _candidateService.UpdateAsync(examId, positionId, candidateInformation); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร /// /// รหัสผู้สมัคร /// ข้อมูลส่วนตัว /// /// เมื่อทำการอัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAdminAsync(string candidateId, CandidateResponseItem candidateInformation) { try { await _candidateService.UpdateAdminAsync(candidateId, candidateInformation); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลส่วนตัว /// /// เมื่อทำการอัพเดทข้อมูล ข้อมูลส่วนตัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("information/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncInformation(string examId, string positionId, CandidateInformationResponseItem candidateInformation) { try { await _candidateService.UpdateAsyncInformation(examId, positionId, candidateInformation); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ข้อมูลที่อยู่ ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลที่อยู่ /// /// เมื่อทำการอัพเดทข้อมูล ข้อมูลที่อยู่ ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("address/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncAddress(string examId, string positionId, CandidateAddressResponseItem candidateAddress) { try { await _candidateService.UpdateAsyncAddress(examId, positionId, candidateAddress); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ข้อมูลครอบครัว ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลครอบครัว /// /// เมื่อทำการอัพเดทข้อมูล ข้อมูลครอบครัว ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("family/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncFamily(string examId, string positionId, CandidateFamilyResponseItem candidateFamily) { try { await _candidateService.UpdateAsyncFamily(examId, positionId, candidateFamily); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล อาชีพ ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// อาชีพ /// /// เมื่อทำการอัพเดทข้อมูล อาชีพ ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("occupation/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncOccupation(string examId, string positionId, CandidateOccupationResponseItem candidateOccupation) { try { await _candidateService.UpdateAsyncOccupation(examId, positionId, candidateOccupation); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล บุคคลที่สามารถติดต่อได้ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// อาชีพ /// /// เมื่อทำการอัพเดทข้อมูล บุคคลที่สามารถติดต่อได้ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("contact/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncContact(string examId, string positionId, CandidateContactResponseItem candidateContact) { try { await _candidateService.UpdateAsyncContact(examId, positionId, candidateContact); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// สร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลประวัติการทำงาน/ฝึกงาน /// /// เมื่อทำการสร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("career/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CreateAsyncCareer(string examId, string positionId, CandidateCareerResponseItem candidateCareer) { try { await _candidateService.CreateAsyncCareer(examId, positionId, candidateCareer); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร /// /// รหัสประวัติการทำงาน/ฝึกงาน /// ข้อมูลประวัติการทำงาน/ฝึกงาน /// /// เมื่อทำการอัพเดทข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("career/{careerId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncCareer(string careerId, CandidateCareerResponseItem candidateCareer) { try { await _candidateService.UpdateAsyncCareer(careerId, candidateCareer); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ลบข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร /// /// รหัสประวัติการทำงาน/ฝึกงาน /// ข้อมูลประวัติการทำงาน/ฝึกงาน /// /// เมื่อทำการลบข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpDelete("career/{careerId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncCareer(string careerId) { try { await _candidateService.DeleteAsyncCareer(careerId); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// ข้อมูลประวัติการศีกษา /// /// เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("education/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CreateAsyncEducation(string examId, string positionId, CandidateEducationResponseItem candidateEducation) { try { await _candidateService.CreateAsyncEducation(examId, positionId, candidateEducation); return Success(); } catch (Exception ex) { return Error(ex); } } // /// // /// อัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร // /// // /// รหัสประวัติการศีกษา // /// ข้อมูลประวัติการศีกษา // /// // /// เมื่อทำการอัพเดทข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ // /// ไม่ได้ Login เข้าระบบ // /// เมื่อเกิดข้อผิดพลาดในการทำงาน // [HttpPut("education/{educationId:length(36)}")] // [ProducesResponseType(StatusCodes.Status200OK)] // [ProducesResponseType(StatusCodes.Status401Unauthorized)] // [ProducesResponseType(StatusCodes.Status500InternalServerError)] // public async Task> UpdateAsyncEducation(string educationId, CandidateEducationResponseItem candidateEducation) // { // try // { // await _candidateService.UpdateAsyncEducation(educationId, candidateEducation); // return Success(); // } // catch (Exception ex) // { // return Error(ex); // } // } /// /// ลบข้อมูล ประวัติการศีกษา ผู้สมัคร /// /// รหัสประวัติการศีกษา /// ข้อมูลประวัติการศีกษา /// /// เมื่อทำการลบข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpDelete("education/{educationId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> DeleteAsyncEducation(string educationId) { try { await _candidateService.DeleteAsyncEducation(educationId); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// สร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร /// /// รหัสผู้สมัคร /// ข้อมูลประวัติการทำงาน/ฝึกงาน /// /// เมื่อทำการสร้างข้อมูล ประวัติการทำงาน/ฝึกงาน ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("career/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CreateAsyncAdminCareer(string candidateId, CandidateCareerResponseItem candidateCareer) { try { await _candidateService.CreateAsyncAdminCareer(candidateId, candidateCareer); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// สร้างข้อมูล ประวัติการศีกษา ผู้สมัคร /// /// รหัสผู้สมัคร /// ข้อมูลประวัติการศีกษา /// /// เมื่อทำการสร้างข้อมูล ประวัติการศีกษา ผู้สมัคร สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("education/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CreateAsyncAdminEducation(string candidateId, CandidateEducationResponseItem candidateEducation) { try { await _candidateService.CreateAsyncAdminEducation(candidateId, candidateEducation); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ผู้สมัครทำการสมัครสอบ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการผู้สมัครทำการสมัครสอบ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("register/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> RegisterCandidateService(string examId, string positionId) { try { await _candidateService.UserCheckCandidateService(examId, positionId, "checkRegister"); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่ตรวจคุณสมบัติผู้สมัคร /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("check-register/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckRegisterCandidateService(string candidateId, RequestApprove item) { try { await _candidateService.AdminCheckCandidateService(candidateId, item.Status ? "payment" : "rejectRegister", item); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครหลายคน /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("check-registers")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckRegistersCandidateService(RequestApproves item) { try { var action = "CREATE"; var system = "SYS_EXAM_SELECT_LISTNAME"; var getPermission = await _permission.GetPermissionAPIAsync(action, system); var jsonData = JsonConvert.DeserializeObject(getPermission); if (jsonData["status"]?.ToString() != "200") { return Error(jsonData["message"]?.ToString(), StatusCodes.Status403Forbidden); } var attrPrivilege = jsonData["result"]?.ToString(); var _item = new RequestApprove(); if (item.CandidateId != null) { await _candidateService.AdminCheckCandidatesService(item.CandidateId); } return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าอัพเดตสถานะ เปิดให้ดาวน์โหลดใบสมัคร แสดงสถานที่สอบ และเลขประจำตัวสอบ /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("check-showExamInfo")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckShowExamInfoService(RequestApproveShowExamInfo item) { try { if (!string.IsNullOrEmpty(item.ExamId)) { await _candidateService.AdminCheckShowExamInfoService(item.ExamId, item.Status ?? true); } return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ผู้สมัครทำการสมัครสอบ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการผู้สมัครทำการสมัครสอบ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("register-confirm/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> RegisterCheckSeatService(string examId, string positionId) { try { await _candidateService.UserConfirmCheckSeatService(examId, positionId); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่ย้อนสถานะเป็นตรวจสอบข้อมูล /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("reject/check-register/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> AdminRejectToCheckCandidateService(Guid candidateId, RequestReject item) { try { await _candidateService.AdminRejectToCheckCandidateService(candidateId, item.Reason); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครไม่ผ่านและให้สมัครใหม่ /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจคุณสมบัติผู้สมัครไม่ผ่านและให้สมัครใหม่สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("reject-register/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> RejectRegisterCandidateService(string candidateId, RequestApprove item) { try { await _candidateService.AdminCheckCandidateService(candidateId, "rejectDelete", item); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่ตรวจการชำระเงิน /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่ตรวจการชำระเงินสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("check-payment/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckPaymentCandidateService(string candidateId, RequestApprove item) { try { await _candidateService.AdminCheckCandidateService(candidateId, item.Status ? "checkSeat" : "rejectPayment", item); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่บันทึกสถานที่สอบ /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่บันทึกสถานที่สอบสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("pass-seat/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckCheckSeatCandidateService(string candidateId) { try { await _candidateService.AdminPassCandidateService(candidateId, "checkPoint"); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// เจ้าหน้าที่บันทึกคะแนนสอบ /// /// รหัสใบสมัคร /// /// เมื่อเจ้าหน้าที่บันทึกคะแนนสอบสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("pass-point/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckPointCandidateService(string candidateId) { try { await _candidateService.AdminPassCandidateService(candidateId, "done"); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// get id รูปถ่าย /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อ get id รูปถ่ายสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("profile-image/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncProfileImage(string examId, string positionId) { try { var path = await _candidateService.GetsAsyncProfileImage(examId, positionId); return Success(GlobalMessages.Success, path); } catch (Exception ex) { return Error(ex); } } /// /// get id รูปถ่าย /// /// รหัสผู้สมัคร /// /// เมื่อ get id รูปถ่ายสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("profile-image/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncAdminProfileImage(string candidateId) { try { var path = await _candidateService.GetsAsyncAdminProfileImage(candidateId); return Success(GlobalMessages.Success, path); } catch (Exception ex) { return Error(ex); } } /// /// อัปโหลดรูปถ่ายผู้สมัคร /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่ออัปโหลดรูปถ่ายผู้สมัครสำเร็จ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("profile-image/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AllowAnonymous] public async Task> UpdateProfileImageCandidateService(string examId, string positionId) { try { if (Request.Form.Files == null || Request.Form.Files.Count == 0) { return Error(GlobalMessages.NoFileToUpload); } var file = Request.Form.Files[0]; await _candidateService.UpdateAsyncProfileImage(examId, positionId, file); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// อัปโหลดรูปถ่ายผู้สมัคร /// /// รหัสผู้สมัคร /// /// เมื่ออัปโหลดรูปถ่ายผู้สมัครสำเร็จ /// ค่าตัวแปรที่ส่งมาไม่ถูกต้อง /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("profile-image/{candidateId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status400BadRequest)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] [AllowAnonymous] public async Task> UpdateAsyncAdminProfileImage(string candidateId) { try { if (Request.Form.Files == null || Request.Form.Files.Count == 0) { return Error(GlobalMessages.NoFileToUpload); } var file = Request.Form.Files[0]; await _candidateService.UpdateAsyncAdminProfileImage(candidateId, file); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// get id หลักฐานชำระ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อ get id หลักฐานชำระสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("payment-image/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncPaymentImg(string examId, string positionId) { try { var path = await _candidateService.GetsAsyncPaymentImg(examId, positionId); return Success(GlobalMessages.Success, path); } catch (Exception ex) { return Error(ex); } } /// /// get id หลักฐานชำระ /// /// รหัสผู้สมัครสอบ /// /// เมื่อ get id หลักฐานชำระสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("payment-image/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncPaymentImgCandidate(string candidateId) { try { var path = await _candidateService.GetsAsyncPaymentImgCandidate(candidateId); return Success(GlobalMessages.Success, path); } catch (Exception ex) { return Error(ex); } } /// /// อัปเอกสารหลักฐานการชำระเงิน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่ออัปเอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("payment-image/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UploadPaymentCandidateService(string examId, string positionId) { try { if (Request.Form.Files == null || Request.Form.Files.Count == 0) { return Error(GlobalMessages.NoFileToUpload); } var file = Request.Form.Files[0]; await _candidateService.UpdateAsyncPaymentImage(examId, positionId, file); // await _candidateService.UserCheckCandidateService(examId, positionId, "checkPayment"); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ตรวจสอบหลักฐานการชำระเงิน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อตรวจสอบหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPost("payment-image/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> ConfirmPaymentCandidateService(string examId, string positionId) { try { // if (Request.Form.Files == null || Request.Form.Files.Count == 0) // { // return Error(GlobalMessages.NoFileToUpload); // } // var file = Request.Form.Files[0]; // await _candidateService.UpdateAsyncPaymentImage(examId, positionId, file); await _candidateService.UserCheckCandidateService(examId, positionId, "checkPayment"); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// list เอกสารหลักฐาน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อ list เอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("upload/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetFileCandidateService(string examId, string positionId) { try { var doc = await _candidateService.GetsAsyncFileUpload(examId, positionId); return Success(doc); } catch (Exception ex) { return Error(ex); } } /// /// อัปโหลดเอกสารหลักฐาน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่ออัปโหลดเอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("upload/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CreateFileCandidateService(string examId, string positionId) { try { if (Request.Form.Files == null || Request.Form.Files.Count == 0) { return Error(GlobalMessages.NoFileToUpload); } var file = Request.Form.Files[0]; await _candidateService.UpdateAsyncDocument(examId, positionId, file); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ลบเอกสารหลักฐาน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// รหัสไฟล์เอกสาร /// /// เมื่อลบเอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpDelete("upload/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> DeleteFileCandidateService(string examId, string positionId, string documentId) { try { await _candidateService.DeleteAsyncDocument(examId, positionId, documentId); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// list เอกสารหลักฐาน /// /// รหัสผู้สมัคร /// /// เมื่อ list เอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("upload/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncAdminFileUpload(string candidateId) { try { var doc = await _candidateService.GetsAsyncAdminFileUpload(candidateId); return Success(doc); } catch (Exception ex) { return Error(ex); } } /// /// อัปโหลดเอกสารหลักฐาน /// /// รหัสผู้สมัคร /// /// เมื่ออัปโหลดเอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("upload/{candidateId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateAsyncAdminDocument(string candidateId) { try { if (Request.Form.Files == null || Request.Form.Files.Count == 0) { return Error(GlobalMessages.NoFileToUpload); } var file = Request.Form.Files[0]; await _candidateService.UpdateAsyncAdminDocument(candidateId, file); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// ลบเอกสารหลักฐาน /// /// รหัสผู้สมัคร /// รหัสไฟล์เอกสาร /// /// เมื่อลบเอกสารหลักฐานสำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpDelete("upload/{candidateId:length(36)}"), DisableRequestSizeLimit] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> DeleteAsyncAdminDocument(string candidateId, string documentId) { try { await _candidateService.DeleteAsyncAdminDocument(candidateId, documentId); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// โหลดไฟล์ /// /// Id ไฟล์ที่ต้องการโหลด /// /// เมื่อโหลดไฟล์สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("download/{id:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> DownloadFile(Guid id) { try { var file_data = await _minioService.DownloadFileAsync(id); Response.Headers["Content-Disposition"] = $"inline; filename={file_data.FileName}"; var ret = new FileContentResult(file_data.FileContent, file_data.FileType) { FileDownloadName = file_data.FileName }; return ret; } catch (Exception ex) { return Error(ex); } } /// /// ใบสมัครสอบ /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการใบสมัครสอบ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("card/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncCardCandidate(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncCardCandidate(examId, positionId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// ใบสมัครสอบ /// /// รหัสผู้สมัคร /// /// เมื่อทำการใบสมัครสอบ สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("card/{candidateId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncAdminCardCandidate(string candidateId) { try { var items = await _candidateService.GetsAsyncAdminCardCandidate(candidateId); return Success(items); } catch (Exception ex) { return Error(ex); } } /// /// โหลดใบชำระเงิน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการโหลดใบชำระเงิน สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpGet("bill/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> GetsAsyncBillCandidate(string examId, string positionId) { try { var items = await _candidateService.GetsAsyncBillCandidate(examId, positionId); return Success(GlobalMessages.Success, items); } catch (Exception ex) { return Error(ex); } } /// /// โหลดใบชำระเงิน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อทำการโหลดใบชำระเงิน สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("review/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> UpdateReviewAsyncCandidate(string examId, string positionId, RequestReview item) { try { await _candidateService.UpdateReviewAsyncCandidate(examId, positionId, item); return Success(); } catch (Exception ex) { return Error(ex); } } /// /// กรอกเลขประจำตัวประชาชน /// /// รหัสรอบสมัคร /// Id ตำแหน่งสมัครสอบ /// /// เมื่อกรอกเลขประจำตัวประชาชน สำเร็จ /// ไม่ได้ Login เข้าระบบ /// เมื่อเกิดข้อผิดพลาดในการทำงาน [HttpPut("check/citizen/{examId:length(36)}/{positionId:length(36)}")] [ProducesResponseType(StatusCodes.Status200OK)] [ProducesResponseType(StatusCodes.Status401Unauthorized)] [ProducesResponseType(StatusCodes.Status500InternalServerError)] public async Task> CheckCitizen(string examId, string positionId, RequestCitizen item) { try { await _candidateService.CheckCitizen(examId, positionId, item.CitizenId); return Success(); } catch (Exception ex) { return Error(ex); } } #endregion } }