import request from '@/web/utils/request' import { FetchAudioSourceParams, FetchAudioSourceResponse, FetchLyricParams, FetchLyricResponse, FetchTracksParams, FetchTracksResponse, LikeATrackParams, LikeATrackResponse, } from '@/shared/api/Track' // 获取歌曲详情 export function fetchTracks( params: FetchTracksParams ): Promise { return request({ url: '/song/detail', method: 'get', params: { ids: params.ids.join(','), }, }) } // 获取音源URL export function fetchAudioSource( params: FetchAudioSourceParams ): Promise { return request({ url: '/song/url', method: 'get', params, }) } // 获取歌词 export function fetchLyric( params: FetchLyricParams ): Promise { return request({ url: '/lyric', method: 'get', params, }) } // 收藏歌曲 export function likeATrack( params: LikeATrackParams ): Promise { return request({ url: '/like', method: 'post', params: { ...params, timestamp: Date.now(), }, }) }