Browse Source

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

master
fyf 2 years ago
parent
commit
8b2b162256
3 changed files with 13 additions and 2 deletions
  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 View File

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

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

#endregion #endregion
} }
} }

+ 5
- 0
DataVAPI/Startup.cs View File

@@ -31,6 +31,11 @@ namespace DataVAPI
SugarDb.Conn = Configuration["DbConnectionstring"].ToString(); SugarDb.Conn = Configuration["DbConnectionstring"].ToString();
DataBus.connStr = Configuration["mongoDB.connStr"].ToString(); DataBus.connStr = Configuration["mongoDB.connStr"].ToString();
DataBus.dbName = Configuration["mongoDB.dbName"].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(); ProcessServer.Instance.Initialize();
//注册swagger服务 //注册swagger服务
services.AddSwaggerUp(); services.AddSwaggerUp();


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

@@ -1,6 +1,7 @@
using DataVApi.Order; using DataVApi.Order;
using DataVAPI.Controllers; using DataVAPI.Controllers;
using DataVAPI.Model; using DataVAPI.Model;
using DataVAPI.ModelDataBus;
using DataVAPI.Tool; using DataVAPI.Tool;
using DataVAPI.Tool.IOT; using DataVAPI.Tool.IOT;
using DataVAPI.Tool.控制台显示; using DataVAPI.Tool.控制台显示;
@@ -58,9 +59,9 @@ namespace DataVAPI.UpAndDown
LoadingShopInformation(); LoadingShopInformation();
//MQTT 数据接收处理 //MQTT 数据接收处理
ConsoleHelper.WriteInfoLine("尝试连接阿里云."); 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】连接成功"); ConsoleHelper.WriteSuccessLine($"阿里云【Transit】连接成功");
} }
else else


Loading…
Cancel
Save