feat: 更新接口
This commit is contained in:
@@ -2,13 +2,16 @@ namespace PetWashControl.Services;
|
||||
|
||||
public class ConfigurationService
|
||||
{
|
||||
public string ApiBaseUrl { get; set; } = "https://localhost:7203/";
|
||||
public string MqttBrokerHost { get; set; } = "localhost";
|
||||
// https://localhost:7203/ 本地
|
||||
public string ApiBaseUrl { get; set; } = "http://localhost:5000/";
|
||||
public string MqttBrokerHost { get; set; } = "101.132.182.216";
|
||||
public int MqttBrokerPort { get; set; } = 1883;
|
||||
public string MqttApiKey { get; set; } = "dc240ab5ec";
|
||||
public string MqttId { get; set; } = "13064";
|
||||
public string MqttClientId { get; set; } = "PetWashControl";
|
||||
|
||||
// Modbus TCP 配置
|
||||
public string ModbusIpAddress { get; set; } = "192.168.1.10";
|
||||
public string ModbusIpAddress { get; set; } = "127.0.0.1";
|
||||
public int ModbusPort { get; set; } = 502;
|
||||
public byte ModbusSlaveId { get; set; } = 1;
|
||||
public int ModbusConnectTimeoutMs { get; set; } = 5000;
|
||||
|
||||
@@ -24,6 +24,7 @@ public class MqttClientService
|
||||
_options = new MqttClientOptionsBuilder()
|
||||
.WithTcpServer(_config.MqttBrokerHost, _config.MqttBrokerPort)
|
||||
.WithClientId(_config.MqttClientId)
|
||||
//.WithCredentials(_config.MqttId, _config.MqttApiKey)
|
||||
.WithCleanSession()
|
||||
.Build();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user