using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Cors;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace WK_KLI_LAPS_Service.Controllers.NavMenu
{
    [EnableCors("CorsPolicy")]
    [Authorize]
    [ApiController]
    [Route("api/[controller]")]
    public class NavMenuApiController : Controller
    {
        private INavMenuService _navMenuServices;
        public NavMenuApiController(INavMenuService navMenuServices)
        {
            _navMenuServices = navMenuServices;
        }

        [Authorize]
        [HttpGet("getRoleMappedMenu/{userid}")]
        public object getRoleMappedMenu(int userid)
        {
            var _actionList = _navMenuServices.getRoleMappedMenu(userid);
            return Ok(_actionList);
        }
        [Authorize]
        [HttpGet("getRoleMappedMenuDashboard/{userid}")]
        public object getRoleMappedMenuDashboard(int userid)
        {
            var _actionList = _navMenuServices.getRoleMappedMenuDashboard(userid);
            return Ok(_actionList);
        }
    }
}
