LookupController.cs 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using MTWorkHR.Application.Filters;
  5. using MTWorkHR.Application.Identity;
  6. using MTWorkHR.Application.Models;
  7. using MTWorkHR.Application.Services.Interfaces;
  8. using MTWorkHR.Identity.Services;
  9. namespace MTWorkHR.API.Controllers
  10. {
  11. [Route("api/[controller]")]
  12. [ApiController]
  13. // [AppAuthorize]
  14. public class LookupController : ControllerBase
  15. {
  16. private readonly ILookupService _LookupService;
  17. public LookupController(ILookupService UserLookupService)
  18. {
  19. this._LookupService = UserLookupService;
  20. }
  21. [HttpGet("GetAllLeaveType")]
  22. [ProducesResponseType(StatusCodes.Status200OK)]
  23. public async Task<ActionResult<List<LeaveTypeDto>>> GetAllLeaveType()
  24. {
  25. return await _LookupService.GetAllLeaveType();
  26. }
  27. [HttpGet("GetAllOrderType")]
  28. [ProducesResponseType(StatusCodes.Status200OK)]
  29. public async Task<ActionResult<List<OrderTypeDto>>> GetAllOrderType()
  30. {
  31. return await _LookupService.GetAllOrderType();
  32. }
  33. [HttpGet("GetAllCountries")]
  34. [ProducesResponseType(StatusCodes.Status200OK)]
  35. public async Task<ActionResult<List<CountryDto>>> GetAllCountries()
  36. {
  37. return await _LookupService.GetAllCountries();
  38. }
  39. [HttpGet("GetCityByCountry")]
  40. [ProducesResponseType(StatusCodes.Status200OK)]
  41. public async Task<ActionResult<List<CityDto>>> GetCityByCountry(long CountryId)
  42. {
  43. return await _LookupService.GetCityByCountry(CountryId);
  44. }
  45. [HttpGet("GetAllIndustries")]
  46. [ProducesResponseType(StatusCodes.Status200OK)]
  47. public async Task<ActionResult<List<IndustryDto>>> GetAllIndustries()
  48. {
  49. return await _LookupService.GetAllIndustries();
  50. }
  51. [HttpGet("GetAllJobTitles")]
  52. [ProducesResponseType(StatusCodes.Status200OK)]
  53. public async Task<ActionResult<List<JobTitleDto>>> GetAllJobTitles()
  54. {
  55. return await _LookupService.GetAllJobTitles();
  56. }
  57. [HttpGet("GetAllUniversities")]
  58. [ProducesResponseType(StatusCodes.Status200OK)]
  59. public async Task<ActionResult<List<UniversityDto>>> GetAllUniversities()
  60. {
  61. return await _LookupService.GetAllUniversities();
  62. }
  63. [HttpGet("GetAllQualifications")]
  64. [ProducesResponseType(StatusCodes.Status200OK)]
  65. public async Task<ActionResult<List<QualificationDto>>> GetAllQualifications()
  66. {
  67. return await _LookupService.GetAllQualifications();
  68. }
  69. //[HttpGet("CreateCountries")]
  70. //[ProducesResponseType(StatusCodes.Status200OK)]
  71. //public async Task<ActionResult<List<CountryDto>>> CreateCountries()
  72. //{
  73. // return await _LookupService.CreateCountries();
  74. //}
  75. }
  76. }