This commit is contained in:
shikong 2025-01-25 03:38:59 +08:00
parent 01e7c955bf
commit 7909229664
Signed by: Shikong
GPG Key ID: BD85FF18B373C341
2 changed files with 22 additions and 1 deletions

View File

@ -10,6 +10,25 @@ import (
"testing" "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) { func TestZLMediaKit_API(t *testing.T) {
SetupZLMediaKitService(&Config{ SetupZLMediaKitService(&Config{
Id: "amrWMKmbKqoBjRQ9", Id: "amrWMKmbKqoBjRQ9",

View File

@ -32,7 +32,9 @@ type MediaTrack struct {
SampleRate int `json:"sample_rate"` SampleRate int `json:"sample_rate"`
} }
type GetMediaListResp struct { type GetMediaListResp = Data[[]GetMediaListRespRaw]
type GetMediaListRespRaw struct {
Schema string `json:"schema"` Schema string `json:"schema"`
Vhost string `json:"vhost"` Vhost string `json:"vhost"`
App string `json:"app"` App string `json:"app"`