account

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 5 Imported by: 9

Documentation

Index

Constants

View Source
const (
	// APIServer API服务器地址
	APIServer = "http://localhost:3000/"
	// APILoginMail 邮箱登录地址
	APILoginMail = APIServer + "login?email=%s&password=%s"
	// APILoginStatus 登录状态地址
	APILoginStatus = APIServer + "login/status"
	// APILogout 登出
	APILogout = APIServer + "logout"
	// APIUserDetail 用户详情
	APIUserDetail = APIServer + "user/detail?uid=%d"
	// APIHeartbeatMode 心动模式
	APIHeartbeatMode = APIServer + "playmode/intelligence/list?id=%d&pid=%d" // songID and playsheerid
	// APIMusicURL 获取音乐的地址
	APIMusicURL = APIServer + "song/url?id=" // More can be added
	// APIMusicURLSingle 获取单个音乐地址
	APIMusicURLSingle = APIServer + "song/url?id=%d"
	// APISignIn 签到API
	APISignIn = APIServer + "daily_signin?type=%d"
	// APIFM 电台API
	APIFM = APIServer + "personal_fm"
	// APIDailyRecommendSong 每日推荐API
	APIDailyRecommendSong = APIServer + "recommend/songs"
	// APILoveList 我喜欢的音乐API
	APILoveList = APIServer + "likelist?uid=%d"
	// APIUserPlaySheetList 用户歌单API
	APIUserPlaySheetList = APIServer + "user/playlist?uid=%d"
	// APIPlaySheetDetail 歌单详情API
	APIPlaySheetDetail = APIServer + "playlist/detail?id=%d"
	// APISongDetail 歌曲详情API
	APISongDetail = APIServer + "song/detail?ids="
	// APILyric 歌词API
	APILyric = APIServer + "lyric?id=%d"
	// APILike 喜欢此音乐API
	APILike = APIServer + "like?id=%d"
)

API 地址列表

Variables

This section is empty.

Functions

This section is empty.

Types

type Login

type Login struct {
	APIAddr    string
	Client     *network.Client
	LoginData  []byte
	UserData   User
	PlaySheets []PlaySheet
}

Login 网易云登录客户端

func NewLogin

func NewLogin(client *network.Client) *Login

NewLogin 创建新的网易云登录客户端

func (*Login) DisLike

func (l *Login) DisLike(ID int) bool

DisLike 取消喜欢指定ID的音乐

func (*Login) GetAllPlaySheet

func (l *Login) GetAllPlaySheet()

GetAllPlaySheet 获取用户所有的歌单

func (*Login) GetFMSong

func (l *Login) GetFMSong() []Song

GetFMSong 获取私人电台歌曲列表

func (*Login) GetFavSong

func (l *Login) GetFavSong() []Song

GetFavSong 获取我喜欢的音乐歌曲列表

func (*Login) GetRecommend

func (l *Login) GetRecommend() []Song

GetRecommend 获取每日推荐歌单

func (*Login) GetSongDetails

func (l *Login) GetSongDetails(ids ...int) []Song

GetSongDetails 获取id序列的详细信息,包含URL

func (*Login) GetStatusCode

func (l *Login) GetStatusCode(data []byte) int

GetStatusCode 获取返回状态码

func (*Login) GetUID

func (l *Login) GetUID() int

GetUID 获取用户UID

func (*Login) GetURLByID

func (l *Login) GetURLByID(ID int) string

GetURLByID 获取歌曲URL

func (*Login) Like

func (l *Login) Like(ID int) bool

Like 喜欢指定ID的音乐

func (*Login) LoginEmail

func (l *Login) LoginEmail(email, password string) []byte

LoginEmail 使用邮箱登录

func (*Login) Logout

func (l *Login) Logout() []byte

Logout 登出

func (*Login) ParseLoginData

func (l *Login) ParseLoginData()

ParseLoginData 解析登录信息

type PlaySheet

type PlaySheet struct {
	ID          int
	Name        string
	Creator     int
	CreatorName string
	Songs       []Song
}

PlaySheet 用户歌单

func (*PlaySheet) LoadDetail

func (p *PlaySheet) LoadDetail(l *Login)

LoadDetail 加载歌单的详情

type Profile

type Profile struct {
	NickName      string
	Gender        int
	Birthday      int
	DefaultAvatar bool
	AvatarURL     string
	City          int
}

Profile 用户个人信息登记

type Song

type Song struct {
	Name string
	URL  string
	ID   int
}

Song 记录歌曲播放所需的信息,用于传递给播放列表信息。

type User

type User struct {
	UID        int
	UserName   string
	CreateTime int
	VipType    int
	Profile    Profile
}

User 用户信息登记

Jump to

Keyboard shortcuts

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