From b6eb2c0da4e653c6fdd278bcbdcd55ec376cd481 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sun, 2 Jul 2023 14:48:47 +0800 Subject: Refactor: move RoomId type to the correct package. Type all room ID usages. --- bilibili/room_profile.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bilibili/room_profile.go') diff --git a/bilibili/room_profile.go b/bilibili/room_profile.go index 9eed175..98cc790 100644 --- a/bilibili/room_profile.go +++ b/bilibili/room_profile.go @@ -2,12 +2,11 @@ package bilibili import ( "fmt" - "github.com/keuin/slbr/common" ) type roomProfile struct { UID int `json:"uid"` - RoomID int `json:"room_id"` + RoomID RoomId `json:"room_id"` ShortID int `json:"short_id"` Attention int `json:"attention"` Online int `json:"online"` @@ -80,7 +79,9 @@ type roomProfile struct { type RoomProfileResponse = BaseResponse[roomProfile] -func (b Bilibili) GetRoomProfile(roomId common.RoomId) (resp RoomProfileResponse, err error) { +func (b Bilibili) GetRoomProfile(roomId RoomId) (resp RoomProfileResponse, err error) { url := fmt.Sprintf("https://api.live.bilibili.com/room/v1/Room/get_info?room_id=%d", roomId) return callGet[RoomProfileResponse](b, url) } + +type RoomId uint64 -- cgit v1.2.3