add result

This commit is contained in:
zxbit2011
2020-11-27 15:12:13 +08:00
parent 8659031d44
commit 52808f0b3c
3 changed files with 34 additions and 13 deletions

View File

@@ -1,16 +1,17 @@
package examples
import (
"encoding/json"
"github.com/zxbit2011/hikvisionOpenAPIGo"
"testing"
)
func TestSDK(t *testing.T) {
hk := hikvisionOpenAPIGo.HKConfig{
Ip: "172.17.207.240",
Ip: "127.0.0.1",
Port: 443,
AppKey: "28057383",
Secret: "dZztQSSUAF4kLpURGQMa",
AppKey: "28057000",
Secret: "dZztQSS0000kLpURG000",
IsHttps: true,
}
@@ -23,16 +24,18 @@ func TestSDK(t *testing.T) {
t.Fatal(err)
return
}
t.Log("OK", string(result))
resJson, err := json.Marshal(result)
t.Log("OK", string(resJson))
/*body := map[string]string{
"cameraIndexCode": "71c1e8bd1b0d406a94e7cdf88a251f9b",
"protocol": "rtmp",
}
result, err := hk.Post("/artemis/api/video/v2/cameras/previewURLs", body, 15)
result, err := hk.HttpPost("/artemis/api/video/v2/cameras/previewURLs", body, 15)
if err != nil {
t.Fatal(err)
return
}
t.Log("OK", string(result))*/
resJson, err := json.Marshal(result)
t.Log("OK", string(resJson))*/
}