From 8ea88fedd51e4961d0fd0aec6c2873a579fb6db8 Mon Sep 17 00:00:00 2001
From: tangxu <76880903@qq.com>
Date: 星期一, 31 十月 2022 14:18:36 +0800
Subject: [PATCH] 完善调度计划分析

---
 Application/IStation.Application.Monitor/monitor_control/MonitorControlNTConfigure_Controller.cs |   33 ++++++++++++++++++++++-----------
 1 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/Application/IStation.Application.Monitor/monitor_control/MonitorControlNTConfigure_Controller.cs b/Application/IStation.Application.Monitor/monitor_control/MonitorControlNTConfigure_Controller.cs
index 5654864..92e312d 100644
--- a/Application/IStation.Application.Monitor/monitor_control/MonitorControlNTConfigure_Controller.cs
+++ b/Application/IStation.Application.Monitor/monitor_control/MonitorControlNTConfigure_Controller.cs
@@ -7,7 +7,7 @@
 using Furion.DynamicApiController;
 using System.ComponentModel.DataAnnotations;
 using Mapster;
-
+using Furion.FriendlyException;
 
 namespace IStation.Application
 {
@@ -18,17 +18,22 @@
     [ApiDescriptionSettings("Monitor", Name = "鐩戞祴鍗楅�氭帶鍒�", Order = 400)]
     public class MonitorControlNT_Controller : IDynamicApiController 
     {
-
         /// <summary>
         /// 娴嬭瘯鍚姩
         /// </summary>
         [Route("TestStart@V1.0")]
         [HttpPost]
-        public string TestStart()
+        public string TestStart([Required] NTStartInput input)
         {
+            if (input.Password != Settings.Operating.NT.Password)
+            {
+                throw Oops.Oh("瀵嗙爜閿欒!");
+            }
+            var context = new Model.MonitorTestControlParas.StartContext(input.HZ, input.OperatingMode, input.OperatingValue);
+
             var paras = new Model.MonitorTestControlParas();
-            paras.Type = 1;
-            paras.Paras = string.Empty;
+            paras.ControlType = Model.MonitorTestControlParas.eControlType.Start;
+            paras.Context = context.ToJson();
 
             var runQueue = new RabbitMqExChangeHelper();
             runQueue.Push("NTTEST", paras);
@@ -40,17 +45,23 @@
         /// </summary>
         [Route("TestStop@V1.0")]
         [HttpPost]
-        public string TestStop()
+        public string TestStop([Required] NTStopInput input)
         {
+            if (input.Password != Settings.Operating.NT.Password)
+            {
+                throw Oops.Oh("瀵嗙爜閿欒!");
+            }
             var paras = new Model.MonitorTestControlParas();
-            paras.Type = 0;
-            paras.Paras = string.Empty;
+            paras.ControlType = Model.MonitorTestControlParas.eControlType.Stop;
+            paras.Context = string.Empty;
 
             var runQueue = new RabbitMqExChangeHelper();
             runQueue.Push("NTTEST", paras);
             return "OK";
         }
 
+
+/*
         /// <summary>
         /// 娴嬭瘯鍙橀
         /// </summary>
@@ -59,14 +70,14 @@
         public string TestChange(NTTestChangeInput input)
         {
             var paras = new Model.MonitorTestControlParas();
-            paras.Type = -1;
-            paras.Paras = input.HZ.ToString();
+            paras.ControlType = -1;
+            paras.Context = input.HZ.ToString();
 
             var runQueue = new RabbitMqExChangeHelper();
             runQueue.Push("NTTEST", paras);
             return "OK";
         }
-
+*/
 
 
 

--
Gitblit v1.9.3