Sfoglia il codice sorgente

更新增加测试版本与开发版本

master
fyf 2 anni fa
parent
commit
8b2b162256
3 ha cambiato i file con 13 aggiunte e 2 eliminazioni
  1. +5
    -0
      DataVAPI/ModelDataBus/DataBus.cs
  2. +5
    -0
      DataVAPI/Startup.cs
  3. +3
    -2
      DataVAPI/UpAndDown/ProcessServer.cs

+ 5
- 0
DataVAPI/ModelDataBus/DataBus.cs Vedi File

@@ -37,6 +37,11 @@
/// 数据库名称
/// </summary>
public static string dbName = "iotdb";

public static string DeviceSecret = "c6a29788702b1146c7850adfbac0bc9a";
public static string DeviceName = "Transit_Test";
public static string ProductKey = "grgpECHSL7q";

#endregion
}
}

+ 5
- 0
DataVAPI/Startup.cs Vedi File

@@ -31,6 +31,11 @@ namespace DataVAPI
SugarDb.Conn = Configuration["DbConnectionstring"].ToString();
DataBus.connStr = Configuration["mongoDB.connStr"].ToString();
DataBus.dbName = Configuration["mongoDB.dbName"].ToString();

DataBus.DeviceSecret = Configuration["DeviceSecret"].ToString();
DataBus.DeviceName = Configuration["DeviceName"].ToString();
DataBus.ProductKey = Configuration["ProductKey"].ToString();

ProcessServer.Instance.Initialize();
//注册swagger服务
services.AddSwaggerUp();


+ 3
- 2
DataVAPI/UpAndDown/ProcessServer.cs Vedi File

@@ -1,6 +1,7 @@
using DataVApi.Order;
using DataVAPI.Controllers;
using DataVAPI.Model;
using DataVAPI.ModelDataBus;
using DataVAPI.Tool;
using DataVAPI.Tool.IOT;
using DataVAPI.Tool.控制台显示;
@@ -58,9 +59,9 @@ namespace DataVAPI.UpAndDown
LoadingShopInformation();
//MQTT 数据接收处理
ConsoleHelper.WriteInfoLine("尝试连接阿里云.");
if (IOTDevServer.GetInstance().CreateLinks("grgpECHSL7q", "Transit", "562dcc779b918a54c2d6589ec30ee230"))
if (IOTDevServer.GetInstance().CreateLinks(DataBus.ProductKey, DataBus.DeviceName, DataBus.DeviceSecret))
//if (IOTDevServer.GetInstance().CreateLinks("grgpECHSL7q", "Transit", "562dcc779b918a54c2d6589ec30ee230"))
{
ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接成功");
}
else


Caricamento…
Annulla
Salva