123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- using Microsoft.AspNetCore.Authorization;
- using Microsoft.AspNetCore.Http;
- using Microsoft.AspNetCore.Mvc;
- using MTWorkHR.Application.Identity;
- using MTWorkHR.Application.Models;
- using MTWorkHR.Application.Services.Interfaces;
- using MTWorkHR.Identity.Services;
- namespace MTWorkHR.API.Controllers
- {
- [Route("api/[controller]")]
- [ApiController]
- public class UserTaskController : ControllerBase
- {
- private readonly IUserTaskService _userTaskService;
- public UserTaskController(IUserTaskService UserUserTaskService)
- {
- this._userTaskService = UserUserTaskService;
- }
- [HttpGet("GetAll")]
- public async Task<ActionResult<List<UserTaskDto>>> GetAll([FromQuery]PagingInputDto pagingInput)
- {
- return Ok(await _userTaskService.GetAll(pagingInput));
- }
- [HttpGet("Get")]
- public async Task<ActionResult<UserTaskDto>> Get(long UserTaskId)
- {
- return Ok(await _userTaskService.GetById(UserTaskId));
- }
- [HttpPost("Create")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- public async Task<ActionResult<UserTaskDto>> Create([FromBody] UserTaskDto input)
- {
- return await _userTaskService.Create(input);
- }
- [HttpPost("Update")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- public async Task Update([FromBody] UserTaskDto input)
- {
- await _userTaskService.Update(input);
- }
- [HttpPost("Delete")]
- [ProducesResponseType(StatusCodes.Status200OK)]
- public async Task Delete(long id)
- {
- await _userTaskService.Delete(id);
- }
- }
- }
|