Files
AlgerMusicPlayer/src/api/home.ts
T

46 lines
1.2 KiB
TypeScript
Raw Normal View History

import { IAlbumNew } from '@/type/album';
import { IRecommendMusic } from '@/type/music';
import { IPlayListSort } from '@/type/playlist';
import { IHotSearch, ISearchKeyword } from '@/type/search';
import { IHotSinger } from '@/type/singer';
import request from '@/utils/request';
interface IHotSingerParams {
offset: number;
limit: number;
}
interface IRecommendMusicParams {
limit: number;
}
// 获取热门歌手
export const getHotSinger = (params: IHotSingerParams) => {
return request.get<IHotSinger>('/top/artists', { params });
};
// 获取搜索推荐词
export const getSearchKeyword = () => {
return request.get<ISearchKeyword>('/search/default');
};
2021-07-26 17:47:15 +08:00
// 获取热门搜索
export const getHotSearch = () => {
return request.get<IHotSearch>('/search/hot/detail');
2021-07-26 17:47:15 +08:00
};
// 获取歌单分类
export const getPlaylistCategory = () => {
return request.get<IPlayListSort>('/playlist/catlist');
};
// 获取推荐音乐
export const getRecommendMusic = (params: IRecommendMusicParams) => {
return request.get<IRecommendMusic>('/personalized/newsong', { params });
};
2021-07-23 10:52:02 +08:00
// 获取最新专辑推荐
export const getNewAlbum = () => {
return request.get<IAlbumNew>('/album/newest');
2021-07-23 10:52:02 +08:00
};