From 3ea90a522ec1679e3c244b245e5554fe320c2cb1 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期六, 22 六月 2019 11:00:47 +0800
Subject: [PATCH] add camera.GetCamerasByRunType

---
 syssetApi.go |    9 +++++++++
 cameraApi.go |   29 +++++++++++++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/cameraApi.go b/cameraApi.go
index c5c9a4b..95dc8a3 100644
--- a/cameraApi.go
+++ b/cameraApi.go
@@ -4,6 +4,7 @@
 	"basic.com/pubsub/protomsg.git"
 	"encoding/json"
 	"fmt"
+	"strconv"
 )
 
 type CameraApi struct{}
@@ -281,4 +282,32 @@
 		return false,nil
 	}
 	return true,res.Data
+}
+
+//鏍规嵁杩愯绫诲瀷鑾峰彇鎽勫儚鏈哄垪琛�
+//runType(0:鑾峰彇杞鍒楄〃锛�1锛氳幏鍙栧疄鏃跺垪琛�)
+func (api CameraApi) GetCamerasByRunType(runType int)(flag bool,cameras []protomsg.Camera){
+	url := BASIC_URL + DATA_URL_PREFIX + "/camera/getCamerasByRunType"
+	client := NewClient()
+	paramQuery := make(map[string]string,0)
+	paramQuery["runType"]=strconv.Itoa(runType)
+	body, err := client.DoGetRequest(url, paramQuery, nil)
+	if err != nil {
+		return false,nil
+	}
+
+	var res Result
+	if err = json.Unmarshal(body, &res); err != nil {
+		return false,nil
+	}
+	b, err := json.Marshal(res.Data)
+	if err !=nil {
+		fmt.Println("unmarshal GetCamerasByRunType.result err")
+		return false,nil
+	}
+	if err = json.Unmarshal(b, &cameras);err !=nil {
+		return false,nil
+	} else {
+		return true,cameras
+	}
 }
\ No newline at end of file
diff --git a/syssetApi.go b/syssetApi.go
index 7cff6b5..29653a7 100644
--- a/syssetApi.go
+++ b/syssetApi.go
@@ -35,3 +35,12 @@
 		}
 	}
 }
+//淇濆瓨杞閰嶇疆
+func (api SysSetApi) SavePollConfig(paramBody map[string]interface{}) bool{
+	return false
+}
+
+//鑾峰彇杞閰嶇疆
+func (api SysSetApi) GetPollConfig() (bool,interface{}) {
+	return false,nil
+}
\ No newline at end of file

--
Gitblit v1.8.0