HomeController.cs 982 Bytes
using HHECS.DAQWebClient.Services;
using HHECS.DAQWebClient.ViewModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System.Diagnostics;

namespace HHECS.DAQWebClient.Controllers
{
    [Authorize]
    public class HomeController : Controller
    {
        private readonly CommonService _commonService;
        private readonly ILogger<HomeController> _logger;

        public HomeController(CommonService commonService, ILogger<HomeController> logger)
        {
            _commonService = commonService;
            _logger = logger;
        }

        public IActionResult Index()
        {
            return View(_commonService.Logs);
        }

        [AllowAnonymous]
        [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)]
        public IActionResult Error()
        {
            return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier });
        }
    }
}