From fa5d3510c294fa17dc081c3bdd295ce8d3b55c40 Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期一, 17 六月 2019 19:09:11 +0800
Subject: [PATCH] add saveLinkRrulesByGroup

---
 api_test.go |   50 ++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/api_test.go b/api_test.go
index 3473da0..056b3ce 100644
--- a/api_test.go
+++ b/api_test.go
@@ -1,7 +1,8 @@
 package dbapi
 
 import (
-	"analyweb/protomsg"
+	"basic.com/pubsub/protomsg.git"
+	"encoding/json"
 	"fmt"
 	"testing"
 	"time"
@@ -9,7 +10,7 @@
 
 func TestGetLocalCameraTree(t *testing.T) {
 	var api AreaApi
-	body := api.GetLocalCameraTree(0, 0, "c")
+	body := api.GetLocalCameraTree("0", "0", "c")
 	fmt.Println(body)
 }
 
@@ -19,8 +20,11 @@
 		Parentid: 0,
 		Name:     "鍝堝搱鍝�",
 	}
+	dataBytes, _ := json.Marshal(area)
+	paramBody := make(map[string]interface{},0)
+	json.Unmarshal(dataBytes,paramBody)
 
-	flag := api.AreaAdd(area)
+	flag := api.AreaAdd(paramBody)
 	fmt.Println(flag)
 }
 
@@ -31,7 +35,10 @@
 		Name:     "鍖哄煙鏇存柊娴嬭瘯",
 		Parentid: 0,
 	}
-	flag := api.AreaUpdate(area)
+	dataBytes, _ := json.Marshal(area)
+	paramBody := make(map[string]interface{},0)
+	json.Unmarshal(dataBytes,paramBody)
+	flag := api.AreaUpdate(paramBody)
 	fmt.Println(flag)
 }
 
@@ -47,7 +54,10 @@
 		Name:"娴嬭瘯鍟婂晩鍟婂晩鍟婂晩鍟婂晩",
 		Areaid:0,
 	}
-	result := api.CameraAdd(camera)
+	dataBytes, _ := json.Marshal(camera)
+	paramBody := make(map[string]interface{},0)
+	json.Unmarshal(dataBytes,paramBody)
+	result := api.CameraAdd(paramBody)
 	fmt.Println("add result: ",result)
 
 }
@@ -61,8 +71,11 @@
 			Icon:"bbb",
 			Url:"baidu",
 		}
-		result := api.Save(sdk)
-		fmt.Println("add result: ",result)
+		dataBytes, _ := json.Marshal(sdk)
+		paramBody := make(map[string]interface{},0)
+		json.Unmarshal(dataBytes,paramBody)
+		result,data := api.Save(paramBody)
+		fmt.Println("add result: ",result,data)
 	}
 
 }
@@ -79,7 +92,7 @@
 
 func TestSdkApi_GetById(t *testing.T) {
 	var api SdkApi
-	model := api.GetById("812b674b-2375-4589-919a-5c1c3278a97e")
+	model,_ := api.GetById("812b674b-2375-4589-919a-5c1c3278a97e")
 	fmt.Println(model)
 }
 
@@ -99,4 +112,25 @@
 	var api CameraApi
 	cameras := api.FindAll()
 	fmt.Println(cameras)
+}
+
+//鏌ユ壘鎵�鏈夌殑澶氳竟褰�
+func TestCameraApi_FindAllPolygons(t *testing.T) {
+	var api CameraApi
+	data := api.FindAllPolygons()
+	fmt.Println("polygons:",data)
+}
+
+//鏌ユ壘鎵�鏈夋椂闂磋鍒�
+func TestCameraApi_FindAllTimeRules(t *testing.T) {
+	var api CameraApi
+	_, rules := api.FindAllTimeRules()
+	fmt.Println("timeRules:",rules)
+}
+
+//鏌ユ壘鎵�鏈変换鍔¤鍒�
+func TestCameraTaskArgsApi_FindAll(t *testing.T) {
+	var api CameraTaskArgsApi
+	all := api.FindAll()
+	fmt.Println("all:",all)
 }
\ No newline at end of file

--
Gitblit v1.8.0