mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-05-17 10:27:30 +08:00
35 lines
922 B
TypeScript
35 lines
922 B
TypeScript
|
|
import request from "@/utils/request";
|
||
|
|
import { IHotSinger } from "@/type/singer";
|
||
|
|
import { ISearchKeyword } from "@/type/search";
|
||
|
|
import { IPlayListSort } from "@/type/playlist";
|
||
|
|
import { IRecommendMusic } from "@/type/music";
|
||
|
|
|
||
|
|
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");
|
||
|
|
};
|
||
|
|
|
||
|
|
// 获取歌单分类
|
||
|
|
export const getPlaylistCategory = () => {
|
||
|
|
return request.get<IPlayListSort>("/playlist/catlist");
|
||
|
|
};
|
||
|
|
|
||
|
|
// 获取推荐音乐
|
||
|
|
export const getRecommendMusic = (params: IRecommendMusicParams) => {
|
||
|
|
return request.get<IRecommendMusic>("/personalized/newsong", { params });
|
||
|
|
};
|