From a1d7ecd47060c46a2f2f1aa7cd370ecc46fa1e9e Mon Sep 17 00:00:00 2001
From: wanggang <76527413@qq.com>
Date: Thu, 27 Aug 2020 19:12:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=8D=87=E7=BA=A7?=
=?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=89=A7=E8=A1=8C=E8=A7=84=E5=88=99=EF=BC=9A?=
=?UTF-8?q?=E5=BD=93=E5=89=8D=E7=89=88=E6=9C=AC=E5=B0=8F=E4=BA=8E=E5=8D=87?=
=?UTF-8?q?=E7=BA=A7=E6=97=B6=E5=8F=91=E5=B8=83=E7=9A=84=E7=89=88=E6=9C=AC?=
=?UTF-8?q?=E5=8F=B7=EF=BC=8C=E6=89=A7=E8=A1=8C=E5=AF=B9=E5=BA=94=E7=9A=84?=
=?UTF-8?q?sql=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=8F=AF=E4=BB=A5=E4=B8=80?=
=?UTF-8?q?=E6=AC=A1=E6=80=A7=E6=89=A7=E8=A1=8C=E5=8D=87=E7=BA=A7=E5=88=B0?=
=?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Former-commit-id: fddeb6f47fd9b2b7694c13b59a42762192ce297d
Former-commit-id: e8caec1d07227b7d724c65c6ae6560a0a8333195
---
.../{update1.0.0.530.sql => 200827.sql} | 0
projects/IoTNode/IoTNode.csproj | 2 +-
projects/IoTNode/Program.cs | 48 +------------------
projects/IoTNode/Startup.cs | 3 +-
4 files changed, 4 insertions(+), 49 deletions(-)
rename projects/IoTNode/{update1.0.0.530.sql => 200827.sql} (100%)
diff --git a/projects/IoTNode/update1.0.0.530.sql b/projects/IoTNode/200827.sql
similarity index 100%
rename from projects/IoTNode/update1.0.0.530.sql
rename to projects/IoTNode/200827.sql
diff --git a/projects/IoTNode/IoTNode.csproj b/projects/IoTNode/IoTNode.csproj
index fbc6908a..67ed2f1f 100644
--- a/projects/IoTNode/IoTNode.csproj
+++ b/projects/IoTNode/IoTNode.csproj
@@ -25,7 +25,7 @@
PreserveNewest
-
+
PreserveNewest
diff --git a/projects/IoTNode/Program.cs b/projects/IoTNode/Program.cs
index 896aa3ee..155285dc 100644
--- a/projects/IoTNode/Program.cs
+++ b/projects/IoTNode/Program.cs
@@ -32,50 +32,4 @@ namespace IoTNode
.Run();
}
}
-}
-/*
-1.程序
-(1)检查升级程序是否需要升级
-(2)升级升级程序
-(3)下载升级程序,检查checksum
-(4)备份现有升级程序
-(5)关闭升级程序
-(6)升级升级程序:ui, db->start
-(7)升级失败,还原升级程序,写入失败信息到程序存储
-(8)升级成功,启动升级程序
-(9)发送升级命令给升级程序
-2.升级程序
-(1)检查程序是否需要升级
-(2)下载新程序,检查checksum
-(3)备份现有程序
-(4)升级程序
-(5)失败还原
-(6)成功启动
-*/
-/*
-///
- ///
- /// http://www.xml-rpc.net/faq/xmlrpcnetfaq-2-5-0.html#2.5
- /// http://supervisord.org/api.html
- ///
- [XmlRpcUrl("http://iot.edusoa.com:8003/RPC2")]
- public interface ISupervisor : IXmlRpcProxy
- {
- [XmlRpcMethod("system.listMethods")]
- string SystemListMethods(int stateNumber);
- }
-
- class Program
- {
- static void Main(string[] args)
- {
- var proxy = XmlRpcProxyGen.Create();
- proxy.Credentials = new NetworkCredential("usr", "pwd");
- var list = proxy.SystemListMethods();
- foreach (var item in list)
- {
- Console.WriteLine(item);
- }
- }
- }
-*/
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/projects/IoTNode/Startup.cs b/projects/IoTNode/Startup.cs
index 90653003..8d5e39ae 100644
--- a/projects/IoTNode/Startup.cs
+++ b/projects/IoTNode/Startup.cs
@@ -63,7 +63,8 @@ namespace IoTNode
app.UseHangfireDashboard("/job", options);
app.UseHangfireServer();
- UpdateDataBase(app, "update1.0.0.530.sql", () => Helper.Instance.GetVersion() == "1.0.0.530");
+ var version = Convert.ToInt64(Helper.Instance.GetVersion().Replace(".", ""));
+ UpdateDataBase(app, "10020082702.sql", () => version < 10020082702);
UpdateVersion(app);
}