diff --git a/.gitignore b/.gitignore index 549e00a2a96fa9d7c5dbc9859664a78d980158c2..352fbc96a8d69f3f6ac9e3fc533f68535dbf27ce 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ target/ !.mvn/wrapper/maven-wrapper.jar !**/src/main/**/target/ !**/src/test/**/target/ +postSong.json ### STS ### .apt_generated diff --git a/postSong.json b/postSong.json deleted file mode 100644 index 56097e42937f296b9213ece963f84378b4df5531..0000000000000000000000000000000000000000 --- a/postSong.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "wrapperType":"collection", - "collectionType":"Album", - "artistId":994656, - "collectionId":580708175, - "amgArtistId":4739, - "artistName":"Led Zeppelin", - "collectionName":"Led Zeppelin IV (Remastered)", - "collectionCensoredName":"Led Zeppelin IV (Remastered)", - "artistViewUrl":"https://music.apple.com/us/artist/led-zeppelin/994656?uo=4", - "collectionViewUrl":"https://music.apple.com/us/album/led-zeppelin-iv-remastered/580708175?uo=4", - "artworkUrl60":"https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/5c/15/9b/5c159b27-95ca-b9a7-84e3-28e795fffd39/dj.kvkrpptq.jpg/60x60bb.jpg", - "artworkUrl100":"https://is1-ssl.mzstatic.com/image/thumb/Music115/v4/5c/15/9b/5c159b27-95ca-b9a7-84e3-28e795fffd39/dj.kvkrpptq.jpg/100x100bb.jpg", - "collectionPrice":9.99, - "collectionExplicitness":"notExplicit", - "trackCount":8, - "copyright":"℗ 1971 Atlantic Recording Corporation, a Warner Music Group Company. Marketed by Rhino Entertainment Company, a Warner Music Group Company.", - "country":"USA", - "currency":"USD", - "releaseDate":"1971-11-08T08:00:00Z", - "primaryGenreName":"Rock" -} \ No newline at end of file diff --git a/src/main/java/kr/ajousw/myspringweb/controller/MyWebController.java b/src/main/java/kr/ajousw/myspringweb/controller/MyWebController.java index 8fcec29394876f833b3df6c684425f97e6b7cb79..4c4e2756b321ef785a2a2a4fc670791b8634ea32 100644 --- a/src/main/java/kr/ajousw/myspringweb/controller/MyWebController.java +++ b/src/main/java/kr/ajousw/myspringweb/controller/MyWebController.java @@ -26,6 +26,9 @@ public class MyWebController { @Autowired FavoriteRepository albumsRepo; + @Autowired + MusicService service; + @GetMapping(value = "/musicSearch/{term}") public MusicList musicSearchByPath(@PathVariable String term) { try { diff --git a/src/main/java/kr/ajousw/myspringweb/service/MusicService.java b/src/main/java/kr/ajousw/myspringweb/service/MusicService.java new file mode 100644 index 0000000000000000000000000000000000000000..154720c18911ffabefb39e725c26a98d9a546b91 --- /dev/null +++ b/src/main/java/kr/ajousw/myspringweb/service/MusicService.java @@ -0,0 +1,16 @@ +package kr.ajousw.myspringweb.service; + +import org.springframework.stereotype.Service; +import org.springframework.web.client.RestTemplate; + +import jakarta.transaction.Transactional; +import kr.ajousw.myspringweb.repository.FavoriteRepository; +import lombok.RequiredArgsConstructor; + +@Service +@Transactional +@RequiredArgsConstructor +public class MusicService { + private final FavoriteRepository albumsRepo; + RestTemplate restTemplate = new RestTemplate(); +} \ No newline at end of file