Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

ApplicantsController.cs 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. using Diligent.WebAPI.Contracts.DTOs.Applicant;
  2. namespace Diligent.WebAPI.Host.Controllers.V1
  3. {
  4. [ApiVersion("1.0")]
  5. [Route("v{version:apiVersion}/applicants")]
  6. [ApiController]
  7. public class ApplicantsController : ControllerBase
  8. {
  9. private readonly IApplicantService _applicantService;
  10. public ApplicantsController(IApplicantService applicantService)
  11. {
  12. _applicantService = applicantService;
  13. }
  14. [HttpGet]
  15. public async Task<IActionResult> GetFilteredApplicants([FromQuery] ApplicantFilterDto applicantFilterDto) =>
  16. Ok(await _applicantService.GetFilteredApplicants(applicantFilterDto));
  17. [Authorize]
  18. [HttpGet("{id}")]
  19. public async Task<IActionResult> GetById(int id) =>
  20. Ok(await _applicantService.GetById(id));
  21. [Authorize]
  22. [HttpGet("adsApplicants")]
  23. public async Task<IActionResult> GetAllAdsApplicants([FromQuery]ApplicantFilterDto applicantFilterDto) =>
  24. Ok(await _applicantService.GetAllAdsApplicants(applicantFilterDto));
  25. [Authorize]
  26. [HttpDelete]
  27. public async Task<IActionResult> DeleteApplicant(int id)
  28. {
  29. await _applicantService.DeleteApplicant(id);
  30. return Ok();
  31. }
  32. [HttpGet("processes/{id}")]
  33. public async Task<IActionResult> GetProcesses(int id)
  34. {
  35. return Ok(await _applicantService.GetApplicantWithSelectionProcessesById(id));
  36. }
  37. [HttpGet("options")]
  38. public async Task<IActionResult> GetOptions()
  39. {
  40. return Ok(await _applicantService.GetOptions());
  41. }
  42. [HttpPost("selection-init")]
  43. public async Task<IActionResult> InitSelection(ApplicantProcessRequestDTO model)
  44. {
  45. await _applicantService.InitializeProcess(model);
  46. return Ok();
  47. }
  48. [HttpPost("apply-for-ad")]
  49. public async Task<IActionResult> ApplyForAd([FromForm]ApplyForAdRequestDto request)
  50. {
  51. await _applicantService.ApplyForAd(request);
  52. return Ok();
  53. }
  54. [HttpGet("get-CV")]
  55. public async Task<IActionResult> GetCV(string fileName)
  56. {
  57. var res = await _applicantService.GetCV(fileName);
  58. return Ok(res);
  59. }
  60. }
  61. }