apiคนพิการ
This commit is contained in:
parent
be27aa4d33
commit
1d4043a50e
37 changed files with 9794 additions and 298 deletions
|
|
@ -42,6 +42,17 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
return Success(GlobalMessages.Success, result);
|
||||
}
|
||||
|
||||
protected virtual ActionResult<ResponseObject> Error(string message, string result, int statusCode = StatusCodes.Status500InternalServerError)
|
||||
{
|
||||
return StatusCode((int)statusCode, new ResponseObject
|
||||
{
|
||||
Status = statusCode,
|
||||
Message = message,
|
||||
Result = result
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
protected virtual ActionResult<ResponseObject> Error(string message, int statusCode = StatusCodes.Status500InternalServerError)
|
||||
{
|
||||
return StatusCode((int)statusCode, new ResponseObject
|
||||
|
|
@ -51,6 +62,19 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
});
|
||||
}
|
||||
|
||||
protected virtual ActionResult<ResponseObject> Error(Exception exception, string message, int statusCode = StatusCodes.Status500InternalServerError)
|
||||
{
|
||||
var msg = exception.Message;
|
||||
var inner = exception.InnerException;
|
||||
while (inner != null)
|
||||
{
|
||||
msg += $" {inner.Message}\r\n";
|
||||
inner = inner.InnerException;
|
||||
}
|
||||
|
||||
return Error(message, msg, statusCode);
|
||||
}
|
||||
|
||||
protected virtual ActionResult<ResponseObject> Error(Exception exception, int statusCode = StatusCodes.Status500InternalServerError)
|
||||
{
|
||||
var msg = exception.Message;
|
||||
|
|
|
|||
1819
Controllers/DisableController.cs
Normal file
1819
Controllers/DisableController.cs
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -670,6 +670,34 @@ namespace BMA.EHR.Recurit.Exam.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// โหลดผู้สมัครสอบ(รายละเอียด)
|
||||
/// </summary>
|
||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการอ่านโหลดผู้สมัครสอบ(รายละเอียด)สำเร็จ</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("download/detail/{examId:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> DownloadCandidateAllAsync(string examId)
|
||||
{
|
||||
try
|
||||
{
|
||||
var stream = await _periodExamService.DownloadCandidateAllAsync(examId);
|
||||
|
||||
string excelName = $"Candidate_{DateTime.Now.ToString("yyyyMMddHHmmssfff")}.xlsx";
|
||||
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", excelName);
|
||||
// return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ข้อมูลตำแหน่งสมัครสอบ
|
||||
/// <param name="examId">รหัสรอบสมัคร</param>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue