From c46fab4ed51205639f04d0c908d483245161b34f Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 19 六月 2019 13:38:58 +0800
Subject: [PATCH] add CameraTaskApi.UpdateCameraTaskStatus

---
 api_test.go |   50 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/api_test.go b/api_test.go
index eefcf4c..454f947 100644
--- a/api_test.go
+++ b/api_test.go
@@ -4,14 +4,39 @@
 	"basic.com/pubsub/protomsg.git"
 	"encoding/json"
 	"fmt"
+	"reflect"
 	"testing"
 	"time"
 )
 
+func Add(a,b string) (string,string) {
+	ret := a+" "+b
+	return ret,ret
+}
+
+var funcMap = map[string]interface{}{"add":Add}
+
+func Call(name string, params ...interface{}) ([]reflect.Value){
+	fun :=reflect.ValueOf(funcMap[name])
+	if len(params) != fun.Type().NumIn() {
+		return nil
+	}
+	in := make([]reflect.Value,len(params))
+	for k,v :=range params {
+		in[k] = reflect.ValueOf(v)
+	}
+
+	return fun.Call(in)
+}
+
 func TestGetLocalCameraTree(t *testing.T) {
-	var api AreaApi
-	body := api.GetLocalCameraTree("0", "0", "c")
-	fmt.Println(body)
+	//var api AreaApi
+	//body := api.GetLocalCameraTree("0", "0", "c")
+	//fmt.Println(body)
+
+	ret := Call("add", "hello", "world")
+
+	fmt.Println(ret)
 }
 
 func TestAreaAdd(t *testing.T) {
@@ -92,8 +117,15 @@
 
 func TestSdkApi_GetById(t *testing.T) {
 	var api SdkApi
-	model,_ := api.GetById("812b674b-2375-4589-919a-5c1c3278a97e")
-	fmt.Println(model)
+	_,data := api.GetById("812b674b-2375-4589-919a-5c1c3278a97e")
+
+	dataBytes, _ := json.Marshal(data)
+	var sdkInfo protomsg.Sdk
+	err := json.Unmarshal(dataBytes,&sdkInfo)
+	if err !=nil {
+		fmt.Println("sdk Unmarshal err",err)
+	}
+	fmt.Println(sdkInfo.Args)
 }
 
 func TestSdkApi_GetAllSdkIds(t *testing.T) {
@@ -121,8 +153,16 @@
 	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