Skip to content

Commit

Permalink
查询悄悄关注明细、查询互相关注明细、查询黑名单明细
Browse files Browse the repository at this point in the history
  • Loading branch information
CuteReimu committed Aug 19, 2024
1 parent f26bcca commit 9bb70ed
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions type.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ type ContractInfo struct {
UserAttr int `json:"user_attr"` // 对方作为目标用户的契约者的属性。1:老粉。否则为原始粉丝。仅当有特殊属性时才有此项
}

// RelationUser 关系列表对象
type RelationUser struct {
Mid int `json:"mid"` // 用户 mid
Attribute int `json:"attribute"` // 对方对于自己的关系属性。0:未关注。1:悄悄关注(现已下线)。2:已关注。6:已互粉。128:已拉黑
Expand Down
47 changes: 47 additions & 0 deletions user.go
Original file line number Diff line number Diff line change
Expand Up @@ -584,3 +584,50 @@ func (c *Client) GetSameFollowings(param GetSameFollowingsParam) (*GetSameFollow
)
return execute[*GetSameFollowingsResult](c, method, url, param)
}

type GetWhispersResult struct {
List []RelationUser `json:"list"` // 明细列表
ReVersion any `json:"re_version"` // (?)(可能是number,可能是string)
}

// GetWhispers 查询悄悄关注明细
func (c *Client) GetWhispers() (*GetWhispersResult, error) {
const (
method = resty.MethodGet
url = "https://api.bilibili.com/x/relation/whispers"
)
return execute[*GetWhispersResult](c, method, url, nil)
}

type GetFriendsResult struct {
List []RelationUser `json:"list"` // 明细列表
ReVersion any `json:"re_version"` // (?)(可能是number,可能是string)
}

// GetFriends 查询互相关注明细
func (c *Client) GetFriends() (*GetFriendsResult, error) {
const (
method = resty.MethodGet
url = "https://api.bilibili.com/x/relation/friends"
)
return execute[*GetFriendsResult](c, method, url, nil)
}

type GetBlacksParam struct {
Ps int `json:"ps,omitempty" request:"query,omitempty"` // 每页项数。默认为 50
Pn int `json:"pn,omitempty" request:"query,omitempty"` // 页码。默认为 1
}

type GetBlacksResult struct {
List []RelationUser `json:"list"` // 明细列表
ReVersion any `json:"re_version"` // (?)(可能是number,可能是string)
}

// GetBlacks 查询黑名单明细
func (c *Client) GetBlacks(param GetBlacksParam) (*GetBlacksResult, error) {
const (
method = resty.MethodGet
url = "https://api.bilibili.com/x/relation/blacks"
)
return execute[*GetBlacksResult](c, method, url, param)
}

0 comments on commit 9bb70ed

Please sign in to comment.