api ปฏิเสธจ่ายเงิน get ไฟล์สมัครสอบ

This commit is contained in:
Kittapath 2023-04-09 04:22:04 +07:00
parent 9486ad160d
commit 5abeada4a6
32 changed files with 7513 additions and 394 deletions

View file

@ -53,9 +53,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
try
{
var items = await _candidateService.GetStatusCandidateService(examId, positionId);
var item = await _candidateService.GetStatusCandidateService(examId, positionId);
return Success(GlobalMessages.Success, items);
return Success(item);
}
catch (Exception ex)
{
@ -756,19 +756,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
try
{
var doc = await _candidateService.GetsAsyncProfileImage(examId, positionId);
var path = await _candidateService.GetsAsyncProfileImage(examId, positionId);
if (doc == "")
return Success();
var file_data = await _minioService.DownloadFileAsync(Guid.Parse(doc));
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;
return Success(GlobalMessages.Success, path);
}
catch (Exception ex)
{
@ -829,19 +819,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
try
{
var doc = await _candidateService.GetsAsyncPaymentImg(examId, positionId);
var path = await _candidateService.GetsAsyncPaymentImg(examId, positionId);
if (doc == "")
return Success();
var file_data = await _minioService.DownloadFileAsync(Guid.Parse(doc));
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;
return Success(GlobalMessages.Success, path);
}
catch (Exception ex)
{
@ -865,19 +845,9 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
{
try
{
var doc = await _candidateService.GetsAsyncPaymentImgCandidate(candidateId);
var path = await _candidateService.GetsAsyncPaymentImgCandidate(candidateId);
if (doc == "")
return Success();
var file_data = await _minioService.DownloadFileAsync(Guid.Parse(doc));
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;
return Success(GlobalMessages.Success, path);
}
catch (Exception ex)
{
@ -987,15 +957,15 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
/// <response code="200">เมื่อลบเอกสารหลักฐานสำเร็จ</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpDelete("upload/{documentId:length(36)}"), DisableRequestSizeLimit]
[HttpDelete("upload/{examId:length(36)}/{positionId:length(36)}"), DisableRequestSizeLimit]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
public async Task<ActionResult<ResponseObject>> DeleteFileCandidateService(string documentId)
public async Task<ActionResult<ResponseObject>> DeleteFileCandidateService(string examId, string positionId, string documentId)
{
try
{
await _candidateService.DeleteAsyncDocument(documentId);
await _candidateService.DeleteAsyncDocument(examId, positionId, documentId);
return Success();
}
catch (Exception ex)
@ -1061,7 +1031,6 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
return Error(ex);
}
}
#endregion
}
}