LookupController.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using Microsoft.AspNetCore.Authorization;
  2. using Microsoft.AspNetCore.Http;
  3. using Microsoft.AspNetCore.Mvc;
  4. using MTWorkHR.Application.Identity;
  5. using MTWorkHR.Application.Models;
  6. using MTWorkHR.Application.Services.Interfaces;
  7. using MTWorkHR.Identity.Services;
  8. namespace MTWorkHR.API.Controllers
  9. {
  10. [Route("api/[controller]")]
  11. [ApiController]
  12. public class LookupController : ControllerBase
  13. {
  14. private readonly ILookupService _LookupService;
  15. public LookupController(ILookupService UserLookupService)
  16. {
  17. this._LookupService = UserLookupService;
  18. }
  19. [HttpGet("GetAllLeaveType")]
  20. [ProducesResponseType(StatusCodes.Status200OK)]
  21. public async Task<ActionResult<List<LeaveTypeDto>>> GetAllLeaveType()
  22. {
  23. return await _LookupService.GetAllLeaveType();
  24. }
  25. [HttpGet("GetAllOrderType")]
  26. [ProducesResponseType(StatusCodes.Status200OK)]
  27. public async Task<ActionResult<List<OrderTypeDto>>> GetAllOrderType()
  28. {
  29. return await _LookupService.GetAllOrderType();
  30. }
  31. [HttpGet("GetAllCountries")]
  32. [ProducesResponseType(StatusCodes.Status200OK)]
  33. public async Task<ActionResult<List<CountryDto>>> GetAllCountries()
  34. {
  35. return await _LookupService.GetAllCountries();
  36. }
  37. [HttpGet("GetAllIndustries")]
  38. [ProducesResponseType(StatusCodes.Status200OK)]
  39. public async Task<ActionResult<List<IndustryDto>>> GetAllIndustries()
  40. {
  41. return await _LookupService.GetAllIndustries();
  42. }
  43. [HttpGet("GetAllJobTitles")]
  44. [ProducesResponseType(StatusCodes.Status200OK)]
  45. public async Task<ActionResult<List<JobTitleDto>>> GetAllJobTitles()
  46. {
  47. return await _LookupService.GetAllJobTitles();
  48. }
  49. [HttpGet("CreateCountries")]
  50. [ProducesResponseType(StatusCodes.Status200OK)]
  51. public async Task<ActionResult<List<CountryDto>>> CreateCountries()
  52. {
  53. return await _LookupService.CreateCountries();
  54. }
  55. }
  56. }