From f5c63cde56eb35c0125a0545f084441cdd4340ab Mon Sep 17 00:00:00 2001 From: Keuin Date: Tue, 11 Jul 2023 22:56:07 +0800 Subject: Refactor: move data structures to a separate package to avoid circular dependency. --- bilibili/danmaku_server_info.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'bilibili/danmaku_server_info.go') diff --git a/bilibili/danmaku_server_info.go b/bilibili/danmaku_server_info.go index b68d4b5..5df8ed7 100644 --- a/bilibili/danmaku_server_info.go +++ b/bilibili/danmaku_server_info.go @@ -2,9 +2,10 @@ package bilibili import ( "fmt" + "github.com/keuin/slbr/types" ) -type DanmakuServerInfoResponse = BaseResponse[danmakuInfo] +type DanmakuServerInfoResponse = types.BaseResponse[danmakuInfo] type danmakuInfo struct { Group string `json:"group"` @@ -21,7 +22,7 @@ type danmakuInfo struct { } `json:"host_list"` } -func (b Bilibili) GetDanmakuServerInfo(roomId RoomId) (resp DanmakuServerInfoResponse, err error) { +func (b Bilibili) GetDanmakuServerInfo(roomId types.RoomId) (resp DanmakuServerInfoResponse, err error) { url := fmt.Sprintf("https://api.live.bilibili.com/xlive/web-room/v1/index/getDanmuInfo?id=%d&type=0", roomId) return callGet[DanmakuServerInfoResponse](b, url) } -- cgit v1.2.3