123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- using Microsoft.AspNetCore.Mvc;
- using Microsoft.CodeAnalysis.Operations;
- using ProductionLineMonitor.Core.Dtos;
- using ProductionLineMonitor.Core.IRepositories;
- using ProductionLineMonitor.Core.Services;
- namespace ProductionLineMonitor.Web.Controllers
- {
- public class ProductionLineController : BaseController
- {
- private readonly IProductionLineCoreService _productionLineService;
- private readonly IUnitOfWork _unitOfWork;
- public ProductionLineController(
- IProductionLineCoreService productionLineService,
- IUnitOfWork unitOfWork)
- {
- _productionLineService = productionLineService;
- _unitOfWork = unitOfWork;
- }
- [HttpGet]
- public IActionResult Index()
- {
- return View();
- }
- [HttpGet]
- public IActionResult GetProductionLines()
- {
- return Ok(_productionLineService.GetProductionLines());
- }
- [HttpGet]
- public IActionResult GetProductionLineTree()
- {
- return Ok(_productionLineService.GetProductionLineTree().Nodes);
- }
- [HttpGet]
- public IActionResult GetProductionLineMachineTree()
- {
- return Ok(_productionLineService.GetProductionLineMachineTree().Nodes);
- }
- [HttpPost]
- public IActionResult GetMachineDayData([FromBody]ReadDayDto dto)
- {
- return Ok(_productionLineService.GetMachineDayData(dto.Id, dto.DateTime));
- }
- [HttpPost]
- public IActionResult GetProductionLineDayData([FromBody] ReadDayDto dto)
- {
- return Ok(_productionLineService.GetProductionLineDayData(dto.Id, dto.DateTime));
- }
- }
- }
|