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. public class LookupController : ControllerBase
  14. {
  15. private readonly ILookupService _LookupService;
  16. public LookupController(ILookupService UserLookupService)
  17. {
  18. this._LookupService = UserLookupService;
  19. }
  20. [HttpGet("GetAllLeaveType")]
  21. [ProducesResponseType(StatusCodes.Status200OK)]
  22. public async Task<ActionResult<List<LeaveTypeDto>>> GetAllLeaveType()
  23. {
  24. return await _LookupService.GetAllLeaveType();
  25. }
  26. [HttpGet("GetAllOrderType")]
  27. [ProducesResponseType(StatusCodes.Status200OK)]
  28. public async Task<ActionResult<List<OrderTypeDto>>> GetAllOrderType()
  29. {
  30. return await _LookupService.GetAllOrderType();
  31. }
  32. [HttpGet("GetAllCountries")]
  33. [ProducesResponseType(StatusCodes.Status200OK)]
  34. public async Task<ActionResult<List<CountryDto>>> GetAllCountries()
  35. {
  36. return await _LookupService.GetAllCountries();
  37. }
  38. [HttpGet("GetCityByCountry")]
  39. [ProducesResponseType(StatusCodes.Status200OK)]
  40. public async Task<ActionResult<List<CityDto>>> GetCityByCountry(long CountryId)
  41. {
  42. return await _LookupService.GetCityByCountry(CountryId);
  43. }
  44. [HttpGet("GetAllIndustries")]
  45. [ProducesResponseType(StatusCodes.Status200OK)]
  46. public async Task<ActionResult<List<IndustryDto>>> GetAllIndustries()
  47. {
  48. return await _LookupService.GetAllIndustries();
  49. }
  50. [HttpGet("GetAllJobTitles")]
  51. [ProducesResponseType(StatusCodes.Status200OK)]
  52. public async Task<ActionResult<List<JobTitleDto>>> GetAllJobTitles()
  53. {
  54. return await _LookupService.GetAllJobTitles();
  55. }
  56. [HttpGet("GetAllUniversities")]
  57. [ProducesResponseType(StatusCodes.Status200OK)]
  58. public async Task<ActionResult<List<UniversityDto>>> GetAllUniversities()
  59. {
  60. return await _LookupService.GetAllUniversities();
  61. }
  62. [HttpGet("GetAllQualifications")]
  63. [ProducesResponseType(StatusCodes.Status200OK)]
  64. public async Task<ActionResult<List<QualificationDto>>> GetAllQualifications()
  65. {
  66. return await _LookupService.GetAllQualifications();
  67. }
  68. [HttpGet("GetAllUserTaskStatus")]
  69. [ProducesResponseType(StatusCodes.Status200OK)]
  70. public async Task<ActionResult<List<UserTaskStatusDto>>> GetAllUserTaskStatus()
  71. {
  72. return await _LookupService.GetAllUserTaskStatus();
  73. }
  74. //[HttpGet("CreateCountries")]
  75. //[ProducesResponseType(StatusCodes.Status200OK)]
  76. //public async Task<ActionResult<List<CountryDto>>> CreateCountries()
  77. //{
  78. // return await _LookupService.CreateCountries();
  79. //}
  80. }
  81. }