diff options
author | Keuin <[email protected]> | 2023-07-11 22:56:07 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2023-07-11 22:56:07 +0800 |
commit | f5c63cde56eb35c0125a0545f084441cdd4340ab (patch) | |
tree | cf24779daaa3067902bef91d21bcdee7a78fd059 /common/testing | |
parent | 7fd817f6d1ead3de85294c1893a6e1572a1d12e3 (diff) |
Refactor: move data structures to a separate package to avoid circular dependency.
Diffstat (limited to 'common/testing')
-rw-r--r-- | common/testing/testutil.go | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/common/testing/testutil.go b/common/testing/testutil.go index 509c619..f99bec8 100644 --- a/common/testing/testutil.go +++ b/common/testing/testutil.go @@ -3,7 +3,7 @@ package testing import ( "encoding/json" "fmt" - "github.com/keuin/slbr/bilibili" + "github.com/keuin/slbr/types" "io" "net/http" ) @@ -12,23 +12,7 @@ import ( Some utility function for test-purpose only. */ -type LiveList struct { - Code int `json:"code"` - Message string `json:"message"` - TTL int `json:"ttl"` - Data struct { - Count int `json:"count"` - Data []struct { - Face string `json:"face"` - Link string `json:"link"` - Roomid bilibili.RoomId `json:"roomid"` - Roomname string `json:"roomname"` - Nickname string `json:"nickname"` - } `json:"data"` - } `json:"data"` -} - -func GetLiveListForGuestUser() (liveList LiveList, err error) { +func GetLiveListForGuestUser() (liveList types.LiveList, err error) { url := "https://api.live.bilibili.com/xlive/web-interface/v1/index/WebGetUnLoginRecList" resp, err := http.Get(url) if err != nil { |