2022-06-25 13:47:07 +08:00
|
|
|
import {
|
|
|
|
FetchArtistAlbumsResponse,
|
|
|
|
FetchArtistResponse,
|
|
|
|
FetchSimilarArtistsResponse,
|
|
|
|
} from './api/Artist'
|
2022-04-16 21:14:03 +08:00
|
|
|
import { FetchAlbumResponse } from './api/Album'
|
|
|
|
import {
|
2022-07-11 11:06:41 +08:00
|
|
|
FetchListenedRecordsResponse,
|
2022-04-16 21:14:03 +08:00
|
|
|
FetchUserAccountResponse,
|
|
|
|
FetchUserAlbumsResponse,
|
|
|
|
FetchUserArtistsResponse,
|
|
|
|
FetchUserLikedTracksIDsResponse,
|
|
|
|
FetchUserPlaylistsResponse,
|
|
|
|
} from './api/User'
|
|
|
|
import {
|
|
|
|
FetchAudioSourceResponse,
|
|
|
|
FetchLyricResponse,
|
|
|
|
FetchTracksResponse,
|
|
|
|
} from './api/Track'
|
|
|
|
import {
|
|
|
|
FetchPlaylistResponse,
|
|
|
|
FetchRecommendedPlaylistsResponse,
|
|
|
|
} from './api/Playlists'
|
|
|
|
|
|
|
|
export const enum APIs {
|
|
|
|
Album = 'album',
|
|
|
|
Artist = 'artists',
|
|
|
|
ArtistAlbum = 'artist/album',
|
|
|
|
Likelist = 'likelist',
|
|
|
|
Lyric = 'lyric',
|
|
|
|
Personalized = 'personalized',
|
|
|
|
Playlist = 'playlist/detail',
|
|
|
|
RecommendResource = 'recommend/resource',
|
|
|
|
SongUrl = 'song/url',
|
|
|
|
Track = 'song/detail',
|
|
|
|
UserAccount = 'user/account',
|
|
|
|
UserAlbums = 'album/sublist',
|
|
|
|
UserArtists = 'artist/sublist',
|
|
|
|
UserPlaylist = 'user/playlist',
|
2022-06-25 13:47:07 +08:00
|
|
|
SimilarArtist = 'simi/artist',
|
2022-07-11 11:06:41 +08:00
|
|
|
ListenedRecords = 'user/record',
|
2022-06-12 15:29:14 +08:00
|
|
|
|
|
|
|
// not netease api
|
|
|
|
CoverColor = 'cover_color',
|
|
|
|
VideoCover = 'video_cover',
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface APIsParams {
|
|
|
|
[APIs.Album]: { id: number }
|
|
|
|
[APIs.Artist]: { id: number }
|
|
|
|
[APIs.ArtistAlbum]: { id: number }
|
|
|
|
[APIs.Likelist]: void
|
|
|
|
[APIs.Lyric]: { id: number }
|
|
|
|
[APIs.Personalized]: void
|
|
|
|
[APIs.Playlist]: { id: number }
|
|
|
|
[APIs.RecommendResource]: void
|
|
|
|
[APIs.SongUrl]: { id: string }
|
|
|
|
[APIs.Track]: { ids: string }
|
|
|
|
[APIs.UserAccount]: void
|
|
|
|
[APIs.UserAlbums]: void
|
|
|
|
[APIs.UserArtists]: void
|
|
|
|
[APIs.UserPlaylist]: void
|
2022-06-25 13:47:07 +08:00
|
|
|
[APIs.SimilarArtist]: { id: number }
|
2022-06-12 15:29:14 +08:00
|
|
|
[APIs.CoverColor]: { id: number }
|
|
|
|
[APIs.VideoCover]: { id: number }
|
2022-07-11 11:06:41 +08:00
|
|
|
[APIs.ListenedRecords]: { id: number; type: number }
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface APIsResponse {
|
|
|
|
[APIs.Album]: FetchAlbumResponse
|
|
|
|
[APIs.Artist]: FetchArtistResponse
|
|
|
|
[APIs.ArtistAlbum]: FetchArtistAlbumsResponse
|
|
|
|
[APIs.Likelist]: FetchUserLikedTracksIDsResponse
|
|
|
|
[APIs.Lyric]: FetchLyricResponse
|
|
|
|
[APIs.Personalized]: FetchRecommendedPlaylistsResponse
|
|
|
|
[APIs.Playlist]: FetchPlaylistResponse
|
|
|
|
[APIs.RecommendResource]: FetchRecommendedPlaylistsResponse
|
|
|
|
[APIs.SongUrl]: FetchAudioSourceResponse
|
|
|
|
[APIs.Track]: FetchTracksResponse
|
|
|
|
[APIs.UserAccount]: FetchUserAccountResponse
|
|
|
|
[APIs.UserAlbums]: FetchUserAlbumsResponse
|
|
|
|
[APIs.UserArtists]: FetchUserArtistsResponse
|
|
|
|
[APIs.UserPlaylist]: FetchUserPlaylistsResponse
|
2022-06-25 13:47:07 +08:00
|
|
|
[APIs.SimilarArtist]: FetchSimilarArtistsResponse
|
2022-06-12 15:29:14 +08:00
|
|
|
[APIs.CoverColor]: string | undefined
|
|
|
|
[APIs.VideoCover]: string | undefined
|
2022-07-11 11:06:41 +08:00
|
|
|
[APIs.ListenedRecords]: FetchListenedRecordsResponse
|
2022-04-16 21:14:03 +08:00
|
|
|
}
|