api

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collection

type Collection struct {
	Id     string  `json:"id"`
	Name   string  `json:"name"`
	PicURL string  `json:"pic_url"`
	Songs  []*Song `json:"songs"`
}

func (*Collection) String

func (c *Collection) String() string

type Playlist

type Playlist struct {
	ID        string `json:"id"`
	Img       string `json:"img"`
	Name      string `json:"name"`
	Total     int64  `json:"total,string"`
	ListenNum int64  `json:"listenNum,omitempty"`
}

type Provider

type Provider interface {
	SearchSongs(ctx context.Context, keyword string, page int, pageSize int) ([]*Song, error)
	GetRank(ctx context.Context) ([]*Rank, error)
	GetRankList(ctx context.Context, bangId string, page int, pageSize int) ([]*Song, error)
	GetSong(ctx context.Context, songId string) (*Song, error)
	GetArtist(ctx context.Context, artistId string, page int, pageSize int) (*Collection, error)
	GetAlbum(ctx context.Context, albumId string) (*Collection, error)
	GetPlayLists(ctx context.Context, page int, pageSize int) ([]*Playlist, error)
	GetPlaylist(ctx context.Context, playlistId string) (*Collection, error)
	SendRequest(req *ghttp.Request) (*ghttp.Response, error)
}

type Rank

type Rank struct {
	Sourceid string `json:"sourceid"`
	Intro    string `json:"intro"`
	Name     string `json:"name"`
	ID       string `json:"id"`
	Source   string `json:"source"`
	Pic      string `json:"pic"`
	Pub      string `json:"pub"`
}

func (*Rank) String

func (c *Rank) String() string

type Song

type Song struct {
	Id        string `json:"id"`
	Name      string `json:"name"`
	Artist    string `json:"artist"`
	ArtistId  string `json:"artist_id,omitempty"`
	Album     string `json:"album"`
	AlbumId   string `json:"album_id,omitempty"`
	AlbumPic  string `json:"album_pic,omitempty"`
	PicURL    string `json:"pic_url,omitempty"`
	Lyric     string `json:"lyric,omitempty"`
	ListenURL string `json:"listen_url,omitempty"`
	Duration  int    `json:"duration"`
}

func (*Song) String

func (s *Song) String() string

Jump to

Keyboard shortcuts

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