1234567891011121314151617181920212223242526272829303132333435 |
- package xphapi
- import (
- "encoding/json"
- "testing"
- )
- func TestXph_GetDeviceData(t *testing.T) {
- x := &Xph{
- baseUrl: "http://115.28.187.9:8005",
- back: nil,
- }
- token := "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzOTYxMTQxNDIiLCJhdWQiOiJjb25zdW1lciIsImV4cCI6MTczNTIwMTI3N30.jWYVHhcDSbFTX9_W70mT6jW2MUF2ZwBMTVCx7YxXpT6mbuzjibhP9nZxoegOEyxZTGhAd9oqmj5RFU2mni31DQ"
- gotData, err := x.GetDeviceData("865012063142227", token)
- if err != nil {
- t.Error(err)
- t.Fatal(err)
- }
- str, err := json.Marshal(gotData)
- t.Log(string(str), err)
- }
- func TestXph_GetAllDevices(t *testing.T) {
- x := &Xph{
- baseUrl: "http://115.28.187.9:8005",
- back: nil,
- }
- token := "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIzOTYxMTQxNDIiLCJhdWQiOiJjb25zdW1lciIsImV4cCI6MTczNTIwMTI3N30.jWYVHhcDSbFTX9_W70mT6jW2MUF2ZwBMTVCx7YxXpT6mbuzjibhP9nZxoegOEyxZTGhAd9oqmj5RFU2mni31DQ"
- gotData := x.GetAllDevices("396114142", token)
- str, err := json.Marshal(gotData)
- t.Log(string(str), err)
- }
|