import HttpClient from '../Http' ; class IndexHttp { public static instance : IndexHttp = new IndexHttp ( ) ; constructor ( ) { } public async banner ( ) { const data = await HttpClient . init ( '/banner' , { method : "get" } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; return data ; } public async hotMusicList ( ) { const data = await HttpClient . init ( '/playlist/hot' , { method : 'get' } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; return data ; } public async topArtists ( ) { const data = await HttpClient . init ( '/top/artists' , { method : 'get' } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; return data ; } public async personalized ( limit ) { return await HttpClient . init ( `/personalized?limit=${ limit }` , { method : 'get' } ) . then ( ( res ) => Promise . resolve ( res ) ) . catch ( ( err ) => Promise . reject ( err ) ) ; } public async albumNewest ( ) { return await HttpClient . init ( "/album/newest" , { method : 'get' } ) ; } public async topAlbum ( limit = 10 ) { return await HttpClient . init ( `/top/album?limit=${ limit }` , { method : 'get' } ) ; } param type public async topList ( type ) { return await HttpClient . init ( `/top/list?idx=${ type }` , { method : 'get' } ) ; } param cat param limit public async artistList ( cat , limit ) { return await HttpClient . init ( `/artist/list?cat=${ cat }&limit=${ limit }` , { method : 'get' } ) ; } } export default IndexHttp . instance ;