|
@@ -1,108 +0,0 @@
|
|
|
-using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
-using System.ComponentModel;
|
|
|
|
|
-using System.Reflection.Metadata.Ecma335;
|
|
|
|
|
-using YSAI.Core.data;
|
|
|
|
|
-using YSAI.Core.@enum;
|
|
|
|
|
-using YSAI.Core.@interface.unify;
|
|
|
|
|
-using YSAI.DB;
|
|
|
|
|
-using YSAI.Kafka;
|
|
|
|
|
-using YSAI.Log;
|
|
|
|
|
-using YSAI.Modbus.client;
|
|
|
|
|
-using YSAI.Mqtt.client;
|
|
|
|
|
-using YSAI.Mqtt.service;
|
|
|
|
|
-using YSAI.Mqtt.service.websocket;
|
|
|
|
|
-using YSAI.Opc.da.client;
|
|
|
|
|
-using YSAI.Opc.da.http;
|
|
|
|
|
-using YSAI.Opc.ua.client;
|
|
|
|
|
-using YSAI.Opc.ua.service;
|
|
|
|
|
-using YSAI.RabbitMQ;
|
|
|
|
|
-using YSAI.S7.client;
|
|
|
|
|
-using YSAI.Unility;
|
|
|
|
|
-
|
|
|
|
|
-namespace YSAI.Manage.Controllers
|
|
|
|
|
-{
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// 库文件信息
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- [ApiController]
|
|
|
|
|
- [Route("api/[controller]/[action]")]
|
|
|
|
|
- public class LibInfoController : Controller
|
|
|
|
|
- {
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// 配置
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- private readonly IConfiguration configuration;
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// 统一操作结果
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- private readonly Or operateResult;
|
|
|
|
|
-
|
|
|
|
|
- public LibInfoController(IConfiguration configuration, Or operateResult)
|
|
|
|
|
- {
|
|
|
|
|
- this.configuration = configuration;
|
|
|
|
|
- this.operateResult = operateResult;
|
|
|
|
|
- operateResult.LogHead = "[ LibInfo 操作 ]";
|
|
|
|
|
- operateResult.ClassName = "LibInfo";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// 获取库文件集合
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <returns>rData:库文件名集合</returns>
|
|
|
|
|
- [HttpGet]
|
|
|
|
|
- [Description("获取库文件集合")]
|
|
|
|
|
- public IActionResult array()
|
|
|
|
|
- {
|
|
|
|
|
- //开始记录运行时间
|
|
|
|
|
- RunTimeTool.Instance($"{operateResult.ClassName}.array").StartRecord();
|
|
|
|
|
- return Ok(operateResult.Break("array",true,RData: configuration.GetSection("Config:LibArray").Get<List<string>>(), RType:ResultType.Json));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /// <summary>
|
|
|
|
|
- /// 获取库文件实例参数
|
|
|
|
|
- /// </summary>
|
|
|
|
|
- /// <param name="name">库文件名</param>
|
|
|
|
|
- /// <returns>rData:库文件所需实例参数集合</returns>
|
|
|
|
|
- [HttpGet]
|
|
|
|
|
- [Description("获取库文件实例参数")]
|
|
|
|
|
- public IActionResult param(string name)
|
|
|
|
|
- {
|
|
|
|
|
- //开始记录运行时间
|
|
|
|
|
- RunTimeTool.Instance($"{operateResult.ClassName}.param").StartRecord();
|
|
|
|
|
- switch (name)
|
|
|
|
|
- {
|
|
|
|
|
- case "DB":
|
|
|
|
|
- return Ok(operateResult.Break("param",true,RData: ReflexTool.GetClassAllPropertyData<DBData.Basics>(),RType:ResultType.Json));
|
|
|
|
|
- case "KafkaAdmin":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<KafkaAdminData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "KafkaConsumer":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<KafkaConsumerData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "KafkaProducer":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<KafkaProducerData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "ModbusClient":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<ModbusClientData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "MqttService":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<MqttServiceData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "MqttWebSocketService":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<MqttWebSocketServiceData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "MqttClient":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<MqttClientData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "OpcDaClient":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<OpcDaClientData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "OpcDaHttp":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<OpcDaHttpData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "OpcUaClient":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<OpcUaClientData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "OpcUaService":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<OpcUaServiceData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "RabbitMQConsumer":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<RabbitMQData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "RabbitMQPublisher":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<RabbitMQData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- case "S7Client":
|
|
|
|
|
- return Ok(operateResult.Break("param", true, RData: ReflexTool.GetClassAllPropertyData<S7ClientData.Basics>(), RType: ResultType.Json));
|
|
|
|
|
- }
|
|
|
|
|
- return Ok(operateResult.Break("param", false, "输入有误"));
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
-}
|
|
|