diff --git a/src/main/java/sws/songpin/domain/member/controller/MemberController.java b/src/main/java/sws/songpin/domain/member/controller/MemberController.java index 082bbd51..5d287c34 100644 --- a/src/main/java/sws/songpin/domain/member/controller/MemberController.java +++ b/src/main/java/sws/songpin/domain/member/controller/MemberController.java @@ -17,9 +17,6 @@ import sws.songpin.domain.playlist.service.PlaylistService; import sws.songpin.domain.member.service.ProfileService; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - @Tag(name = "Member", description = "Member 관련 API입니다.") @RestController @RequiredArgsConstructor @@ -34,9 +31,8 @@ public class MemberController { @Operation(summary = "유저 검색", description = "유저를 검색합니다.") @GetMapping public ResponseEntity searchMembers(@RequestParam("keyword") final String keyword, - @PageableDefault(size = 20) final Pageable pageable) throws UnsupportedEncodingException { - String decodedKeyword = URLDecoder.decode(keyword, "UTF-8"); - return ResponseEntity.ok().body(memberService.searchMembers(decodedKeyword, pageable)); + @PageableDefault(size = 20) final Pageable pageable) { + return ResponseEntity.ok().body(memberService.searchMembers(keyword, pageable)); } @Operation(summary = "타 유저 정보 조회", description = "memberId으로 해당 유저의 프로필 이미지, 닉네임, 아이디 정보 조회") @GetMapping("/{memberId}") diff --git a/src/main/java/sws/songpin/domain/member/controller/MyPageController.java b/src/main/java/sws/songpin/domain/member/controller/MyPageController.java index 7df974b7..bedb2106 100644 --- a/src/main/java/sws/songpin/domain/member/controller/MyPageController.java +++ b/src/main/java/sws/songpin/domain/member/controller/MyPageController.java @@ -14,14 +14,10 @@ import sws.songpin.domain.member.dto.request.ProfileDeactivateRequestDto; import sws.songpin.domain.member.dto.request.ProfileUpdateRequestDto; import sws.songpin.domain.member.service.ProfileService; -import sws.songpin.domain.model.SortBy; import sws.songpin.domain.pin.service.PinService; import sws.songpin.domain.playlist.service.PlaylistService; import sws.songpin.global.auth.CookieUtil; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - @Tag(name = "MyPage", description = "MyPage 관련 API입니다.") @RestController @RequiredArgsConstructor @@ -73,9 +69,8 @@ public ResponseEntity getMyFeedPinsByMonth(@RequestParam("year") int year, @R @Operation(summary = "마이페이지에서 핀 검색", description = "마이페이지에서의 핀 검색 결과를 페이징으로 불러옵니다.") @GetMapping("/pins") public ResponseEntity songSearch(@RequestParam("keyword") final String keyword, - @PageableDefault(size = 20) final Pageable pageable) throws UnsupportedEncodingException { - String decodedKeyword = URLDecoder.decode(keyword, "UTF-8"); - return ResponseEntity.ok().body(pinService.searchMyPins(decodedKeyword, pageable)); + @PageableDefault(size = 20) final Pageable pageable) { + return ResponseEntity.ok().body(pinService.searchMyPins(keyword, pageable)); } @Operation(summary = "회원 탈퇴", description = "회원 상태를 '탈퇴'로 변경하고 닉네임을 '(알 수 없음)'으로 변경합니다. \t\n해당 회원의 handle을 랜덤 uuid 값으로 변경합니다. \t\nRedis와 쿠키에 저장되었던 회원의 Refresh Token을 삭제합니다. \t\n해당 회원이 등록했던 핀 등의 데이터는 남겨둡니다. \t\n해당 회원의 팔로우, 팔로잉 데이터는 삭제합니다.") @@ -95,7 +90,4 @@ public ResponseEntity updatePassword(@RequestBody @Valid PasswordUpdateReques profileService.updatePassword(requestDto); return ResponseEntity.ok().build(); } - - - } diff --git a/src/main/java/sws/songpin/domain/playlist/controller/PlaylistController.java b/src/main/java/sws/songpin/domain/playlist/controller/PlaylistController.java index 1c649246..8a4b4e84 100644 --- a/src/main/java/sws/songpin/domain/playlist/controller/PlaylistController.java +++ b/src/main/java/sws/songpin/domain/playlist/controller/PlaylistController.java @@ -16,9 +16,6 @@ import sws.songpin.domain.playlist.service.PlaylistService; import sws.songpin.domain.playlistpin.service.PlaylistPinService; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; - @Tag(name = "Playlist", description = "Playlist 관련 API입니다.") @RestController @RequiredArgsConstructor @@ -71,10 +68,7 @@ public ResponseEntity getPlaylistMain() { @GetMapping public ResponseEntity playlistSearch(@RequestParam final String keyword, @RequestParam(defaultValue = "ACCURACY") final String sortBy, - @PageableDefault(size = 20) final Pageable pageable) throws UnsupportedEncodingException { - String decodedKeyword = URLDecoder.decode(keyword, "UTF-8"); - return ResponseEntity.ok().body(playlistService.searchPlaylists(decodedKeyword, SortBy.from(sortBy), pageable)); + @PageableDefault(size = 20) final Pageable pageable) { + return ResponseEntity.ok().body(playlistService.searchPlaylists(keyword, SortBy.from(sortBy), pageable)); } - - } diff --git a/src/main/java/sws/songpin/domain/song/controller/SongController.java b/src/main/java/sws/songpin/domain/song/controller/SongController.java index 9350c67e..37805fa1 100644 --- a/src/main/java/sws/songpin/domain/song/controller/SongController.java +++ b/src/main/java/sws/songpin/domain/song/controller/SongController.java @@ -13,10 +13,6 @@ import sws.songpin.domain.song.dto.response.SongDetailsResponseDto; import sws.songpin.domain.song.service.SongService; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; -import java.util.List; - @Tag(name = "Song", description = "Song 관련 API입니다.") @RestController @RequestMapping("/songs") @@ -50,8 +46,7 @@ public ResponseEntity getMyPinsForSong(@PathVariable("songId") final Long son @Operation(summary = "노래 검색", description = "노래 검색 결과를 선택한 정렬 기준에 따라 페이징으로 불러옵니다.") public ResponseEntity songSearch(@RequestParam("keyword") final String keyword, @RequestParam(value = "sortBy", defaultValue = "ACCURACY") final String sortBy, - @PageableDefault(size = 20) final Pageable pageable) throws UnsupportedEncodingException { - String decodedKeyword = URLDecoder.decode(keyword, "UTF-8"); - return ResponseEntity.ok().body(songService.searchSongs(decodedKeyword, SortBy.from(sortBy), pageable)); + @PageableDefault(size = 20) final Pageable pageable) { + return ResponseEntity.ok().body(songService.searchSongs(keyword, SortBy.from(sortBy), pageable)); } } diff --git a/src/main/java/sws/songpin/domain/song/spotify/SpotifyController.java b/src/main/java/sws/songpin/domain/song/spotify/SpotifyController.java index f5f6a9e4..2766a1d8 100644 --- a/src/main/java/sws/songpin/domain/song/spotify/SpotifyController.java +++ b/src/main/java/sws/songpin/domain/song/spotify/SpotifyController.java @@ -7,8 +7,6 @@ import sws.songpin.domain.song.dto.response.SpotifySearchDto; import sws.songpin.domain.song.service.SongService; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import java.util.List; @RestController @@ -20,8 +18,7 @@ public class SpotifyController { @GetMapping("/external/songs") public List searchTracks( @RequestParam("keyword") String keyword, - @RequestParam(value = "offset", defaultValue = "0") int offset) throws UnsupportedEncodingException { - String decodedKeyword = URLDecoder.decode(keyword, "UTF-8"); - return songService.searchTracks(decodedKeyword, offset); + @RequestParam(value = "offset", defaultValue = "0") int offset) { + return songService.searchTracks(keyword, offset); } }