LookupController.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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("GetAllIndustries")]
  40. [ProducesResponseType(StatusCodes.Status200OK)]
  41. public async Task<ActionResult<List<IndustryDto>>> GetAllIndustries()
  42. {
  43. return await _LookupService.GetAllIndustries();
  44. }
  45. [HttpGet("GetAllJobTitles")]
  46. [ProducesResponseType(StatusCodes.Status200OK)]
  47. public async Task<ActionResult<List<JobTitleDto>>> GetAllJobTitles()
  48. {
  49. return await _LookupService.GetAllJobTitles();
  50. }
  51. [HttpGet("CreateCountries")]
  52. [ProducesResponseType(StatusCodes.Status200OK)]
  53. public async Task<ActionResult<List<CountryDto>>> CreateCountries()
  54. {
  55. return await _LookupService.CreateCountries();
  56. }
  57. }
  58. }