|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using Application.Domain.Entities;
|
|
|
|
|
using Infrastructure.Data;
|
|
|
|
|
using Infrastructure.Domain;
|
|
|
|
|
using Infrastructure.Extensions;
|
|
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
@ -22,13 +23,15 @@ namespace IoTCenter.Controllers
|
|
|
|
|
private readonly IRepository<Data> _dataRepo;
|
|
|
|
|
private readonly IRepository<Category> _categoryRepo;
|
|
|
|
|
private readonly IRepository<Product> _productRepo;
|
|
|
|
|
private readonly IEventPublisher _eventPublisher;
|
|
|
|
|
|
|
|
|
|
public HomeController(IConfiguration cfg,
|
|
|
|
|
IRepository<Node> nodeRepo,
|
|
|
|
|
IRepository<Device> deviceRepo,
|
|
|
|
|
IRepository<Data> dataRepo,
|
|
|
|
|
IRepository<Category> categoryRepo,
|
|
|
|
|
IRepository<Product> productRepo)
|
|
|
|
|
IRepository<Product> productRepo,
|
|
|
|
|
IEventPublisher eventPublisher)
|
|
|
|
|
{
|
|
|
|
|
this._cfg = cfg;
|
|
|
|
|
this._nodeRepo = nodeRepo;
|
|
|
|
@ -36,11 +39,13 @@ namespace IoTCenter.Controllers
|
|
|
|
|
this._dataRepo = dataRepo;
|
|
|
|
|
this._categoryRepo = categoryRepo;
|
|
|
|
|
this._productRepo = productRepo;
|
|
|
|
|
this._eventPublisher = eventPublisher;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Authorize]
|
|
|
|
|
public IActionResult Index()
|
|
|
|
|
{
|
|
|
|
|
this._eventPublisher.Publish(new EntityInsertedEvent<Node>(new Node()));
|
|
|
|
|
return View();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|