From 81c320d96a4abcdc276c52a5c8a5a5baa8b36532 Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期五, 18 十二月 2020 14:23:57 +0800
Subject: [PATCH] 添加两个接口

---
 cameraPolygonRelation.go |   16 ++++++++++++++++
 cameraGroupApi.go        |   17 +++++++++++++++++
 2 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/cameraGroupApi.go b/cameraGroupApi.go
index 3207588..bc894c1 100644
--- a/cameraGroupApi.go
+++ b/cameraGroupApi.go
@@ -55,4 +55,21 @@
 		return false,nil
 	}
 	return res.Success,res.Data
+}
+
+func (api CameraGroupApi) Delete(groupId string) bool {
+	url := api.getBasicUrl() + DATA_URL_PREFIX + "/camera/group/del"
+	client := NewClient()
+	paramMap := make(map[string]string,0)
+	paramMap["groupId"] = groupId
+	body, err := client.DoDeleteRequest(url,CONTENT_TYPE_FORM,nil,paramMap)
+	if err != nil {
+		return false
+	}
+
+	var res Result
+	if err = json.Unmarshal(body, &res); err != nil {
+		return false
+	}
+	return res.Success
 }
\ No newline at end of file
diff --git a/cameraPolygonRelation.go b/cameraPolygonRelation.go
index 970ea32..7a69878 100644
--- a/cameraPolygonRelation.go
+++ b/cameraPolygonRelation.go
@@ -24,6 +24,22 @@
 	return "http://"+api.Ip+":"+strconv.Itoa(api.Port)
 }
 
+func (api CameraPolygonRelationApi) FindPolygonByGroup(groupId string) (bool,interface{}) {
+	url := api.getBasicUrl() + DATA_URL_PREFIX + "/polygon/findByGroup"
+	client := NewClient()
+
+	body, err := client.DoGetRequest(url, nil, nil)
+	if err != nil {
+		return false, nil
+	}
+
+	var res Result
+	if err = json.Unmarshal(body, &res); err != nil {
+		return false,nil
+	}
+	return res.Success, res.Data
+}
+
 func (api CameraPolygonRelationApi) FindAll() (flag bool,list []protomsg.CameraPolygonRelation) {
 	url := api.getBasicUrl() + DATA_URL_PREFIX + "/polygon/relation/findAll"
 	client := NewClient()

--
Gitblit v1.8.0