You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

SelectionProcessesController.cs 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using Diligent.WebAPI.Contracts.DTOs.SelectionProcess;
  2. namespace Diligent.WebAPI.Host.Controllers.V1
  3. {
  4. [ApiVersion("1.0")]
  5. [Route("v{version:apiVersion}/selectionprocesses")]
  6. [ApiController]
  7. public class SelectionProcessesController : ControllerBase
  8. {
  9. private readonly ISelectionProcessService _selectionProcessesService;
  10. public SelectionProcessesController(ISelectionProcessService selectionProcessesService)
  11. {
  12. _selectionProcessesService = selectionProcessesService;
  13. }
  14. //[Authorize]
  15. //[HttpGet]
  16. //public async Task<IActionResult> GetAll() =>
  17. // Ok(await _selectionProcessesService.GetAllAsync());
  18. [Authorize]
  19. [HttpPost]
  20. public async Task<IActionResult> FinishSelectionProcess([FromBody] SelectionProcessCreateDto model) =>
  21. Ok(await _selectionProcessesService.FinishSelectionProcess(model));
  22. [Authorize]
  23. [HttpPost("status-update")]
  24. public async Task<IActionResult> UpdateStatus([FromBody] StatusChangeDTO model)
  25. {
  26. await _selectionProcessesService.StatusUpdate(model);
  27. return Ok("Status updated.");
  28. }
  29. [Authorize]
  30. [HttpPost("interviewer-update")]
  31. public async Task<IActionResult> UpdateInterviewer([FromBody] InterviewerUpdateDTO model)
  32. {
  33. await _selectionProcessesService.InterviewerUpdate(model);
  34. return Ok("Interviewer changed.");
  35. }
  36. //[HttpPost]
  37. //public async Task<IActionResult> Create([FromBody] SelectionProcessCreateDto request)
  38. //{
  39. // await _selectionProcessesService.CreateAsync(request);
  40. // return StatusCode((int)HttpStatusCode.Created);
  41. //}
  42. //[Authorize]
  43. //[HttpPut("{id}")]
  44. //public async Task<IActionResult> Update([FromBody] SelectionProcessCreateDto request, [FromRoute] int id)
  45. //{
  46. // await _selectionProcessesService.UpdateAsync(id, request);
  47. // return Ok();
  48. //}
  49. }
  50. }