แสดงรูปหลักฐานชำระ
This commit is contained in:
parent
43898213b2
commit
ab86c20b84
6 changed files with 75 additions and 8 deletions
|
|
@ -849,6 +849,42 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// get id หลักฐานชำระ
|
||||
/// </summary>
|
||||
/// <param name="candidateId">รหัสผู้สมัครสอบ</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อ get id หลักฐานชำระสำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("payment-image/{candidateId:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetsAsyncPaymentImgCandidate(string candidateId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var doc = 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;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// อัปเอกสารหลักฐานการชำระเงิน
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -475,6 +475,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
{
|
||||
return Error("นามสกุลไฟล์ต้องเป็น .xlsx!");
|
||||
}
|
||||
// return Success(file);
|
||||
await _periodExamService.UploadSeatCandidateAsync(examId, file);
|
||||
|
||||
return Success();
|
||||
|
|
@ -510,6 +511,7 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
{
|
||||
return Error("นามสกุลไฟล์ต้องเป็น .xlsx!");
|
||||
}
|
||||
// return Success(file);
|
||||
await _periodExamService.UploadPointCandidateAsync(examId, file);
|
||||
|
||||
return Success();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue