account

package
v0.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2021 License: MIT Imports: 8 Imported by: 0

README

账号

  1. 获取网盘用户信息
  2. 获取用户网盘空间容量信息

Documentation

Index

Constants

View Source
const QuotaUri = "/api/quota"
View Source
const UserInfoUri = "/rest/2.0/xpan/nas?method=uinfo"

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccessToken string
}

func NewAccountClient

func NewAccountClient(accessToken string) *Account

func (*Account) Quota

func (a *Account) Quota() (QuotaResponse, error)

获取用户网盘容量信息

func (*Account) UserInfo

func (a *Account) UserInfo() (UserInfoResponse, error)

获取网盘用户信息

type QuotaResponse

type QuotaResponse struct {
	conf.CloudDiskResponseBase
	Total  int  `json:"total"`
	Used   int  `json:"used"`
	Free   int  `json:"free"`
	Expire bool `json:"expire"`
}

type UserInfoResponse

type UserInfoResponse struct {
	BaiduName    string `json:"baidu_name"`
	NetdiskName  string `json:"netdisk_name"`
	AvatarUrl    string `json:"avatar_url"`
	VipType      int    `json:"vip_type"`
	Uk           int    `json:"uk"` //uk字段对应auth.UserInfo方法返回的user_id
	ErrorCode    int    `json:"errno"`
	ErrorMsg     string `json:"errmsg"`
	RequestID    int
	RequestIDStr string `json:"request_id"` //用户信息接口返回的request_id为string类型
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL