LookupController.cs 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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("GetAllUserTaskStatus")]
  70. [ProducesResponseType(StatusCodes.Status200OK)]
  71. public async Task<ActionResult<List<UserTaskStatusDto>>> GetAllUserTaskStatus()
  72. {
  73. return await _LookupService.GetAllUserTaskStatus();
  74. }
  75. //[HttpGet("CreateCountries")]
  76. //[ProducesResponseType(StatusCodes.Status200OK)]
  77. //public async Task<ActionResult<List<CountryDto>>> CreateCountries()
  78. //{
  79. // return await _LookupService.CreateCountries();
  80. //}
  81. }
  82. }