From 48009df8620a592908387502a415756526b48f64 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期三, 07 七月 2021 17:26:32 +0800
Subject: [PATCH] add app or sdk uninstall

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

diff --git a/appApi.go b/appApi.go
index bd0eb0e..2db1091 100644
--- a/appApi.go
+++ b/appApi.go
@@ -52,6 +52,44 @@
 	return res.Success
 }
 
+func (api AppApi) GetAppInfo(id string) (flag bool, d interface{}) {
+	url := DATA_URL_PREFIX + "/app/getAppInfo"
+	netNode := getNetNode(url2Topic(Topic_AppCenter_Service, url))
+	client := NewClient(WithNodes(netNode))
+	paramMap := map[string]string {
+		"id": 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
+}
+
+func (api AppApi) Delete(appId string) (bool,interface{}) {
+	url := DATA_URL_PREFIX + "/app/delete"
+	netNode := getNetNode(url2Topic(Topic_AppCenter_Service, url))
+	client := NewClient(WithNodes(netNode))
+	paramBody := map[string]interface{} {
+		"appId": appId,
+	}
+	body, err := client.DoPostRequest(url,CONTENT_TYPE_JSON,paramBody,nil,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