From 31600992701d5bf9568b166c540da8a09972ac39 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 07 七月 2021 18:01:51 +0800
Subject: [PATCH] add sdk or app Upgrade

---
 appApi.go |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/appApi.go b/appApi.go
index 2db1091..9bf868c 100644
--- a/appApi.go
+++ b/appApi.go
@@ -90,6 +90,26 @@
 	return res.Success, res.Data
 }
 
+// id浼犵畻娉曟垨鑰呭簲鐢ㄧ殑id锛屼笅杞藉畨瑁呮垨鍗囩骇
+func (api AppApi) Upgrade(id string) (bool, interface{}) {
+	url := DATA_URL_PREFIX + "/sdk/sdkDownload"
+	netNode := getNetNode(url2Topic(Topic_AppCenter_Service, url))
+	client := NewClient(WithNodes(netNode))
+	paramMap := map[string]string {
+		"path": id,
+	}
+	body, err := client.DoGetRequest(url,paramMap,nil)
+	if err != nil {
+		return false, err.Error()
+	}
+
+	var res Result
+	if err = json.Unmarshal(body, &res); err != nil {
+		return false, err.Error()
+	}
+	return res.Success, res.Data
+}
+
 //鑾峰彇鎵�鏈夊凡瀹夎鐨刟pp鍒楄〃,浠ackage涓簁ey
 func (api AppApi) FindAppMap() map[string]protomsg.App {
 	m := make(map[string]protomsg.App)

--
Gitblit v1.8.0