From 5133036e9f297019771d4aeac7f961cbb57406ec Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期三, 22 五月 2019 13:11:37 +0800
Subject: [PATCH] add api
---
api_test.go | 82 +++++++++++++++++++++++++++++++++++++++++
1 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/api_test.go b/api_test.go
index ddff79b..1158431 100644
--- a/api_test.go
+++ b/api_test.go
@@ -1 +1,83 @@
package dbapi
+
+import (
+ "dbapi/protomsg"
+ "fmt"
+ "testing"
+)
+
+func TestGetLocalCameraTree(t *testing.T) {
+ var api AreaApi
+ body := api.GetLocalCameraTree(0, 0, "c")
+ fmt.Println(body)
+}
+
+func TestAreaAdd(t *testing.T) {
+ var api AreaApi
+ var area = protomsg.Area{
+ Parentid: 0,
+ Name: "鍝堝搱鍝�",
+ }
+
+ flag := api.AreaAdd(area)
+ fmt.Println(flag)
+}
+
+func TestAreaUpdate(t *testing.T) {
+ var api AreaApi
+ var area = protomsg.Area{
+ Id: 1,
+ Name: "鍖哄煙鏇存柊娴嬭瘯",
+ Parentid: 0,
+ }
+ flag := api.AreaUpdate(area)
+ fmt.Println(flag)
+}
+
+func TestGetCameraById(t *testing.T) {
+ var api CameraApi
+ camera, _ := api.GetCameraById("cid0")
+ fmt.Println(camera)
+}
+
+func TestMangosReqClient(t *testing.T){
+ var client ReqrepApi
+
+ client.SendRequestAndGetReply("one")
+}
+
+func TestSdkApi_FindAll(t *testing.T) {
+ var api SdkApi
+ all := api.FindAll("")
+ fmt.Println(all)
+}
+
+func TestSdkApi_GetById(t *testing.T) {
+ var api SdkApi
+ model := api.GetById("812b674b-2375-4589-919a-5c1c3278a97e")
+ fmt.Printf("sdkArgs:%s \n",model.Args)
+
+ //if err := json.Unmarshal([]byte(model.Args), &sdkArgs);err !=nil {
+ // fmt.Println(err)
+ //}
+
+ fmt.Println(model)
+}
+
+func TestSdkApi_GetAllSdkIds(t *testing.T) {
+ var api SdkApi
+ sdkIds := api.GetAllSdkIds()
+ fmt.Println(sdkIds)
+}
+
+func TestTaskApi_FindAll(t *testing.T) {
+ var api TaskApi
+ taskInfos := api.FindAll()
+ fmt.Println(taskInfos)
+}
+
+func TestCameraApi_FindAll(t *testing.T) {
+ var api CameraApi
+ cameras := api.FindAll()
+ fmt.Println(cameras)
+}
\ No newline at end of file
--
Gitblit v1.8.0