diff --git a/pkg/services/zlmediakit/api_test.go b/pkg/services/zlmediakit/api_test.go index dd9fbb4..209800d 100644 --- a/pkg/services/zlmediakit/api_test.go +++ b/pkg/services/zlmediakit/api_test.go @@ -10,6 +10,25 @@ import ( "testing" ) +func TestZLMediaKit(t *testing.T) { + SetupZLMediaKitService(&Config{ + Id: "amrWMKmbKqoBjRQ9", + Url: "http://10.10.10.200:5081", + Secret: "4155cca6-2f9f-11ee-85e6-8de4ce2e7333", + }) + + resp, err := zLMediaKitService.client.R().Get("/index/api/getMediaList") + if err != nil { + t.Fatal(err) + } + data := &types.GetMediaListResp{} + _ = json.Unmarshal(resp.Body(), &data) + t.Logf("%+v\n", data) + for _, datum := range data.Data { + t.Logf("%+v\n", datum) + } +} + func TestZLMediaKit_API(t *testing.T) { SetupZLMediaKitService(&Config{ Id: "amrWMKmbKqoBjRQ9", diff --git a/pkg/services/zlmediakit/types/media.go b/pkg/services/zlmediakit/types/media.go index e7dc64a..ec9132b 100644 --- a/pkg/services/zlmediakit/types/media.go +++ b/pkg/services/zlmediakit/types/media.go @@ -32,7 +32,9 @@ type MediaTrack struct { SampleRate int `json:"sample_rate"` } -type GetMediaListResp struct { +type GetMediaListResp = Data[[]GetMediaListRespRaw] + +type GetMediaListRespRaw struct { Schema string `json:"schema"` Vhost string `json:"vhost"` App string `json:"app"`