Skip to content

Commit

Permalink
Merge branch 'fix/encoding-issue' into test-deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
seohyun-lee committed Aug 15, 2024
2 parents f9309be + da10fdb commit 1ea8178
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 36 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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해당 회원의 팔로우, 팔로잉 데이터는 삭제합니다.")
Expand All @@ -95,7 +90,4 @@ public ResponseEntity<?> updatePassword(@RequestBody @Valid PasswordUpdateReques
profileService.updatePassword(requestDto);
return ResponseEntity.ok().build();
}



}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -20,8 +18,7 @@ public class SpotifyController {
@GetMapping("/external/songs")
public List<SpotifySearchDto> 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);
}
}

0 comments on commit 1ea8178

Please sign in to comment.