Change Code
This commit is contained in:
parent
9d2a0e913c
commit
f2dcf9bb49
19 changed files with 417 additions and 373 deletions
|
|
@ -191,7 +191,7 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
|
||||
return Success();
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
|
|
@ -246,12 +246,12 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet]
|
||||
[HttpGet("period")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetsAsync()
|
||||
public async Task<ActionResult<ResponseObject>> GetPeriodsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -277,12 +277,12 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("{id:length(36)}")]
|
||||
[HttpGet("period/{id:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> GetByIdAsync(Guid id)
|
||||
public async Task<ActionResult<ResponseObject>> GetPeriodByIdAsync(Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -317,7 +317,7 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
/// </summary>
|
||||
/// <param name="req">Request parameters</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการอ่านข้อมูลจาก Relational Database สำเร็จ</response>
|
||||
/// <response code="200">เมื่อทำการเพิ่มข้อมูลสำเร็จ</response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
|
|
@ -350,6 +350,53 @@ namespace BMA.EHR.Recruit.Service.Controllers
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ลบข้อมูลรอบการจัดสอบแข่งขัน
|
||||
/// </summary>
|
||||
/// <param name="id">รหัสรอบการสอบแข่งขัน</param>
|
||||
/// <returns></returns>
|
||||
/// <response code="200">เมื่อทำการลบข้อมูลสำเร็จ</response>
|
||||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpDelete("period/{id:length(36)}")]
|
||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||
[ProducesResponseType(StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<ResponseObject>> DeletePeriodAsync(Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var data = await _context.RecruitImports.AsQueryable()
|
||||
.Include(x => x.ImportFile)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Addresses)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Occupations)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Certificates)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Educations)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Payments)
|
||||
.Include(x => x.Recruits)
|
||||
.ThenInclude(x => x.Documents)
|
||||
.ThenInclude(x => x.DocumentFile)
|
||||
.FirstOrDefaultAsync(x => x.Id == id);
|
||||
|
||||
_context.RecruitImports.Remove(data);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return Success();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return Error(ex);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue