30 lines
589 B
Go
30 lines
589 B
Go
package biliapi
|
|
|
|
import (
|
|
"fmt"
|
|
"net/http"
|
|
)
|
|
|
|
type StatData struct {
|
|
Mid uint64 `json:"mid"`
|
|
Following uint32 `json:"following"`
|
|
Whisper uint32 `json:"whisper"`
|
|
Black uint32 `json:"black"`
|
|
Follower uint32 `json:"follower"`
|
|
}
|
|
|
|
// UserStat 用户统计信息 例如粉丝数,订阅数等
|
|
func UserStat(mid uint) ([]byte, error) {
|
|
url := fmt.Sprintf("https://api.bilibili.com/x/relation/stat?vmid=%d", mid)
|
|
|
|
srv := BaseService{
|
|
client: &http.Client{},
|
|
url: url,
|
|
}
|
|
respBody, err := srv.DoRequest()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return respBody, nil
|
|
}
|