## 메소드 목록 * User Action * like track * likeTrack * like artist * likeArtist * like album * likeAlbum * like playlist * likePlaylist * library * tracks * getTracksByUserId * artists * getArtistsByUserId * albums * getAlbumsByUserId * playlists * getPlaylistsByUserId * detail * track * getTrackById * artist * getArtistById * album * getAlbumById * playlist * getPlaylistById * magazine * getMagazineById * Today * magazine * getMagazines ## API 명세 도출 > 예시 ### User Login |Method|URL|description| |-|-|-| |Get|/auth/login|정보를 보내주면 로그인을 합니다| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response ``` { token : '35oew53flk23jsdf%sdf3' } ``` ### API 목록 * `GET /track/:id` [트랙 디테일](#Track-detail) * `GET /album/:id` [앨범 디테일](#Album-detail) * `GET /artist/:id` [가수 디테일](#Artist-detail) * `GET /library/tracks` [보관함-노래](#LikeList-Track) * `GET /library/albums` [보관함-앨범](#LikeList-Album) * `GET /library/artists` [보관함-가수](#LikeList-Artist) * `GET /library/mixtapes` [보관함-믹스테잎](#LikeList-Mixtape) * `GET /library/playlists` [보관함-플레이리스트](#LikeList-Playlist) * `POST /library/tracks` [좋아요-노래](#User-Like-Track) * `DELETE /library/tracks/:id` [좋아요-노래-취소](#User-UnLike-Track) * `POST /library/albums` [좋아요-앨범](#User-Like-Album) * `DELETE /library/albums/:id` [좋아요-앨범-취소](#User-UnLike-Album) * `POST /library/artists` [좋아요-가수](#User-Like-Artist) * `DELETE /library/artists/:id` [좋아요-가수-취소](#User-UnLike-Artist) * `POST /library/playlists` [좋아요-플레이리스트](#User-Like-Playlist) * `DELETE /library/playlists/:id` [좋아요-플레이리스트-취소](#User-UnLike-Playlist) <!-- * `POST /library/mixtapes` [좋아요-믹스테잎](#User-Like-Mixtape) * `DELETE /library/mixtapes/:id` [좋아요-믹스테잎-취소](#User-UnLike-Mixtape) --> * `GET /magazines` [목록-매거진](#Magazines-List) --- <!-- * `GET /artists/:id/tracks` * `GET /artists/:id/albums` --> ### Track-detail |Method|URL|description| |-|-|-| |GET|/track/:id|노래에 대한 정보를 가져옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, id: 1, // trackID title: 'Dynamite', artists: [{ Artist }], album: { Album } songwriter: 'David Stewart, Jessica Agombar', composer: 'David Stewart, Jessica Agombar', isLocal: 1, } ``` ``` // Ex { "success": true, "data": { "id": 41051447, "title": "취기를 빌려 (취향저격 그녀 X 산들)", "songwriter": "새봄(Saevom)", "composer": "새봄(Saevom)", "isLocal": true, "album": { "id": 4686872, "name": "취기를 빌려 (취향저격 그녀 X 산들)", "imgUrl": "https://musicmeta-phinf.pstatic.net/album/004/686/4686872.jpg?type=r360Fll&v=20200720175905", "date": "2020-07-19T15:00:00.000Z" }, "artists": [] } } ``` 500: ``` { message: 'Internal Server Error' } ``` ### Album-detail |Method|URL|description| |-|-|-| |GET|/album/:id|앨범에 대한 정보를 가져옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, data: { id: 1, // albumID name: 'Fly Away', date: '2020-03-04', genres: [{ 페이지에 필요한 장르 정보들 }], imageUrl: 'https://...', artists: [ {Artist}, {Artist} ] } } ``` ``` // Ex { "success": true, "data": { "id": 5100782, "name": "쇼미더머니 9 Episode 1", "imgUrl": "https://musicmeta-phinf.pstatic.net/album/005/100/5100782.jpg?type=r100Fll&v=20201124173906", "date": "2020-11-20T15:00:00.000Z", "genres": [ { "id": 105, "name": "힙합" } ], "artists": [ { "id": 1620782, "name": "쿤디판다(Khundi Panda)", "debut": "2020-12-31T15:00:00.000Z", "imgUrl": "https://musicmeta-phinf.pstatic.net/artist/001/620/1620782.jpg?type=ff300_300&v=20191207105330" }, { "id": 3002627, "name": "머쉬베놈(MUSHVENOM)", "debut": "2020-12-31T15:00:00.000Z", "imgUrl": "https://musicmeta-phinf.pstatic.net/artist/003/002/3002627.jpg?type=ff300_300&v=20201019215622" }, { "id": 3009681, "name": "먼치맨", "debut": "2020-12-31T15:00:00.000Z", "imgUrl": "https://musicmeta-phinf.pstatic.net/artist/003/009/3009681.jpg?type=ff300_300&v=20201013185208" }, { "id": 3592382, "name": "미란이", "debut": "2020-12-31T15:00:00.000Z", "imgUrl": "https://musicmeta-phinf.pstatic.net/artist/003/592/3592382.jpg?type=ff300_300&v=20200422125208" } ] } } ``` 500: ``` { message: 'database error' } ``` ### Artist-detail |Method|URL|description| |-|-|-| |GET|/artist/:id|가수에 대한 정보를 가져옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, data: { id: 222, name: "임창정", debut: "1994-11-29T15:00:00.000Z", imgUrl: "https://musicmeta-phinf.pstatic.net/artist/000/000/222.jpg?type=ff300_300&v=20201019160109", genres: [ {Genre} ] } } ``` ``` // Ex { "success": true, "data": { "id": 97268, "name": "다비치", "debut": "2008-01-27T15:00:00.000Z", "imgUrl": "https://musicmeta-phinf.pstatic.net/artist/000/097/97268.jpg?type=ff300_300&v=20191203111407", "genres": [ { "id": 102, "name": "발라드" } ] } } ``` 500: ``` { message: 'Internal Server Error' } ``` ------- ### LikeList-Track |Method|URL|description| |-|-|-| |GET|/library/tracks|유저가 좋아요 누른 노래(보관함-노래) 리스트를 받아옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, data: { id: 41684117, title: "Dynamite", songwriter: "David Stewart, Jessica Agombar", composer: "David Stewart, Jessica Agombar", isLocal: true, album: { id: 4820425, name: "Dynamite (DayTime Version)", imgUrl: "https://musicmeta-phinf.pstatic.net/album/004/820/4820425.jpg?type=r360Fll&v=20200918130108", date: "2020-08-20T15:00:00.000Z" }, artists: [{Artist}, {Artist}] } } ``` 500: ``` { message: 'database error' } ``` ### LikeList-Album |Method|URL|description| |-|-|-| |GET|/library/albums|유저가 좋아요 누른 앨범(보관함-앨범) 리스트를 받아옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, data: [ { id: 4820425, name: "Dynamite (DayTime Version)", imgUrl: "https://musicmeta-phinf.pstatic.net/album/004/820/4820425.jpg?type=r360Fll&v=20200918130108", date: "2020-08-20T15:00:00.000Z", artists: [ {Artist}, {Artist} ] } ] } ``` 500: ``` { message: 'database error' } ``` ### LikeList-Artist |Method|URL|description| |-|-|-| |GET|/library/artists|유저가 좋아요 누른 가수(보관함-가수) 리스트를 받아옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success: true, data: [ { id: 143179, name: "방탄소년단", debut: "2013-06-11T15:00:00.000Z", imgUrl: "https://musicmeta-phinf.pstatic.net/artist/000/143/143179.jpg?type=ff300_300&v=20201109164507" }, { id: 500555, name: "BLACKPINK", debut: "2020-12-31T15:00:00.000Z", imgUrl: "https://musicmeta-phinf.pstatic.net/artist/000/500/500555.jpg?type=ff300_300&v=20201002130007" } ] } ``` 500: ``` { message: 'database error' } ``` ### LikeList-Playlist |Method|URL|description| |-|-|-| |GET|/library/playlists|유저가 좋아요 누른 가수(보관함-가수) 리스트를 받아옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { message: 'success', data: [] } ``` 500: ``` { message: 'database error' } ``` ----- ### User-Like-Track |Method|URL|description| |-|-|-| |POST|/library/tracks|유저가 노래를 보관함에 추가합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { trackId: 1 } ``` #### Response 204: ``` { } ``` 400: ``` { message: 'Parameter Error: trackId' } ``` 404: ``` { message: 'Track Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Unlike-Track |Method|URL|description| |-|-|-| |DELETE|/library/tracks/:id|유저가 노래를 보관함에서 삭제합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 204: ``` { } ``` 400: ``` { message: 'Parameter Error: trackId' } ``` 404: ``` { message: 'Track Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Like-Album |Method|URL|description| |-|-|-| |POST|/library/albums|유저가 앨범을 보관함에 추가합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { albumId: 1 } ``` #### Response 204: ``` { } ``` 400: ``` { message: 'Parameter Error: albumId' } ``` 404: ``` { message: 'Album Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Unlike-Album |Method|URL|description| |-|-|-| |DELETE|/like/albums/:id|유저가 앨범을 보관함에서 삭제합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { } ``` 400: ``` { message: 'Parameter Error: albumId' } ``` 404: ``` { message: 'Album Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Like-Artist |Method|URL|description| |-|-|-| |POST|/like/artists|유저가 가수를 보관함에 추가합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { artistId: 1 } ``` #### Response 204: ``` { } ``` 400: ``` { message: 'Parameter Error: artistId' } ``` 404: ``` { message: 'Artist Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Unlike-Artist |Method|URL|description| |-|-|-| |DELETE|/like/artists/:id|유저가 가수를 보관함에서 삭제합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { } ``` 400: ``` { message: 'Parameter Error: artistId' } ``` 404: ``` { message: 'Artist Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Like-Playlist |Method|URL|description| |-|-|-| |POST|/like/playlists|유저가 플레이리스트를 보관함에 추가합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 204: ``` { } ``` 400: ``` { message: 'Parameter Error: playlistId' } ``` 404: ``` { message: 'Playlist Not Found' } ``` 500: ``` { message: 'database error' } ``` ### User-Unlike-Playlist |Method|URL|description| |-|-|-| |DELETE|/like/playlists/:id|유저가 플레이리스트를 보관함에서 삭제합니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { } ``` 400: ``` { message: 'Parameter Error: playlistId' } ``` 404: ``` { message: 'Playlist Not Found' } ``` 500: ``` { message: 'database error' } ``` --- ### Magazines-List |Method|URL|description| |-|-|-| |GET|/magazine | 매거진 목록을 불러옵니다.| #### Request (GET은 query string, 이외에는 request body) ``` { } ``` #### Response 200: ``` { success : true, data : [ { content: "‘WAP’의 수위에 도전하는 메건 더 ..." date: "2020.12.05" id: 1 imgUrl: "https://music..." tag: "genre" title: "New Release #18 :메건 더 스탤리언, sogumm" }, { content: "BTS의 인기의 원천은 무엇일까...." date: "2020.12.06" id: 2 imgUrl: "https://music..." tag: "pick" title: "New Release #19 :BTS" }, ] } ``` 400: ``` { message: 'Parameter Error: magazineId' } ``` 404: ``` { message: 'Magazines Not Found' } ``` 500: ``` { message: 'database error' } ```