72 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-05-12 02:45:43 +08:00
import request from '@/web/utils/request'
2022-04-16 21:14:03 +08:00
import {
FetchArtistParams,
FetchArtistResponse,
FetchArtistAlbumsParams,
FetchArtistAlbumsResponse,
2022-06-25 13:47:07 +08:00
FetchSimilarArtistsParams,
FetchSimilarArtistsResponse,
2022-08-03 23:48:39 +08:00
FetchArtistMVParams,
FetchArtistMVResponse,
LikeAArtistParams,
LikeAArtistResponse,
2022-04-16 21:14:03 +08:00
} from '@/shared/api/Artist'
2022-03-13 14:40:38 +08:00
// 歌手详情
export function fetchArtist(
2022-08-03 23:48:39 +08:00
params: FetchArtistParams
2022-03-13 14:40:38 +08:00
): Promise<FetchArtistResponse> {
return request({
url: '/artists',
method: 'get',
2022-08-03 23:48:39 +08:00
params: { ...params, timestamp: new Date().getTime() },
2022-03-13 14:40:38 +08:00
})
}
// 获取歌手的专辑列表
export function fetchArtistAlbums(
params: FetchArtistAlbumsParams
): Promise<FetchArtistAlbumsResponse> {
return request({
url: 'artist/album',
method: 'get',
params,
})
}
2022-06-25 13:47:07 +08:00
2022-08-03 23:48:39 +08:00
// 获取相似歌手
2022-06-25 13:47:07 +08:00
export function fetchSimilarArtists(
params: FetchSimilarArtistsParams
): Promise<FetchSimilarArtistsResponse> {
return request({
url: 'simi/artist',
method: 'get',
params,
})
}
2022-08-03 23:48:39 +08:00
// MV
export function fetchArtistMV(
params: FetchArtistMVParams
): Promise<FetchArtistMVResponse> {
return request({
url: '/artist/mv',
method: 'get',
params,
})
}
// 收藏歌手
export function likeAArtist(
params: LikeAArtistParams
): Promise<LikeAArtistResponse> {
return request({
url: 'artist/sub',
method: 'get',
params: {
id: params.id,
t: Number(params.like),
},
})
}