From 7afd6516806710fa1fa22c40fc11e9393ca4720b Mon Sep 17 00:00:00 2001
From: liuxiaolong <736321739@qq.com>
Date: 星期四, 27 六月 2019 14:27:20 +0800
Subject: [PATCH] fix url
---
syssetApi.go | 4 ++--
api_test.go | 25 ++++++++++++++++++++++++-
2 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/api_test.go b/api_test.go
index 454f947..4d88455 100644
--- a/api_test.go
+++ b/api_test.go
@@ -2,6 +2,7 @@
import (
"basic.com/pubsub/protomsg.git"
+ "crypto/rand"
"encoding/json"
"fmt"
"reflect"
@@ -12,6 +13,14 @@
func Add(a,b string) (string,string) {
ret := a+" "+b
return ret,ret
+}
+
+func PseudoUuid() (uuid string) {
+ b := make([]byte, 16)
+ rand.Read(b)
+ uuid = fmt.Sprintf("%X-%X-%X-%X-%X", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
+
+ return uuid
}
var funcMap = map[string]interface{}{"add":Add}
@@ -35,7 +44,7 @@
//fmt.Println(body)
ret := Call("add", "hello", "world")
-
+ fmt.Println("NewUUID:",PseudoUuid())
fmt.Println(ret)
}
@@ -165,4 +174,18 @@
var api CameraTaskArgsApi
all := api.FindAll()
fmt.Println("all:",all)
+}
+
+func TestSysSetApi_GetServerInfo(t *testing.T) {
+ var api SysSetApi
+ flag, sysconf := api.GetServerInfo()
+ fmt.Println("flag:",flag)
+ fmt.Println("server.Info:",sysconf)
+}
+
+func TestCameraApi_GetCamerasByRunType(t *testing.T) {
+ var api CameraApi
+ flag, cameras := api.GetCamerasByRunType(0,"")
+ fmt.Println("flag:",flag)
+ fmt.Println("cameras:",cameras)
}
\ No newline at end of file
diff --git a/syssetApi.go b/syssetApi.go
index f84efcb..7646598 100644
--- a/syssetApi.go
+++ b/syssetApi.go
@@ -38,7 +38,7 @@
}
//淇濆瓨杞閰嶇疆
func (api SysSetApi) SavePollPeriod(period int) (bool,interface{}){
- url := BASIC_URL + DATA_URL_PREFIX + "/pollConfig/savePollConfig"
+ url := BASIC_URL + DATA_URL_PREFIX + "/pollConfig/savePollPeriod"
client := NewClient()
paramBody := make(map[string]interface{},0)
paramBody["period"] = period
@@ -57,7 +57,7 @@
}
func (api SysSetApi) SavePollDelay(delay int) (bool,interface{}){
- url := BASIC_URL + DATA_URL_PREFIX + "/pollConfig/savePollConfig"
+ url := BASIC_URL + DATA_URL_PREFIX + "/pollConfig/savePollDelay"
client := NewClient()
paramBody := make(map[string]interface{},0)
paramBody["delay"] = delay
--
Gitblit v1.8.0