MeetingController.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 MeetingController : ControllerBase
  13. {
  14. private readonly IMeetingService _MeetingService;
  15. public MeetingController(IMeetingService UserMeetingService)
  16. {
  17. this._MeetingService = UserMeetingService;
  18. }
  19. [HttpGet("GetAll")]
  20. [ProducesResponseType(StatusCodes.Status200OK)]
  21. public async Task<ActionResult<List<MeetingDto>>> GetAll([FromQuery] PagingInputDto pagingInput)
  22. {
  23. return Ok(await _MeetingService.GetAll(pagingInput));
  24. }
  25. [HttpGet("Get")]
  26. [ProducesResponseType(StatusCodes.Status200OK)]
  27. public async Task<ActionResult<MeetingDto>> Get(long MeetingId)
  28. {
  29. return Ok(await _MeetingService.GetById(MeetingId));
  30. }
  31. [HttpPost("Create")]
  32. [ProducesResponseType(StatusCodes.Status200OK)]
  33. public async Task<ActionResult<MeetingDto>> Create([FromBody] MeetingDto input)
  34. {
  35. return await _MeetingService.Create(input);
  36. }
  37. [HttpPost("Update")]
  38. [ProducesResponseType(StatusCodes.Status200OK)]
  39. public async Task Update([FromBody] MeetingDto input)
  40. {
  41. await _MeetingService.Update(input);
  42. }
  43. [HttpPost("Delete")]
  44. [ProducesResponseType(StatusCodes.Status200OK)]
  45. public async Task Delete(long id)
  46. {
  47. await _MeetingService.Delete(id);
  48. }
  49. }
  50. }