From 6dd5f7adc3bad7bfa1c4d2a32e4ee09d1afe40f8 Mon Sep 17 00:00:00 2001 From: suhyeon7497 Date: Fri, 15 Nov 2024 15:04:40 +0900 Subject: [PATCH] =?UTF-8?q?[fix]=20nickname=20=EB=B3=80=EA=B2=BD=ED=95=A0?= =?UTF-8?q?=EB=95=8C=20=EB=B0=94=EB=94=94=EB=A1=9C=20=EB=B0=9B=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/presentation/UserController.java | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/java/team7/inplace/user/presentation/UserController.java b/src/main/java/team7/inplace/user/presentation/UserController.java index 7f70a42a..121dedab 100644 --- a/src/main/java/team7/inplace/user/presentation/UserController.java +++ b/src/main/java/team7/inplace/user/presentation/UserController.java @@ -6,7 +6,11 @@ import org.springframework.data.web.PageableDefault; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import team7.inplace.user.application.UserFacade; import team7.inplace.user.application.UserService; import team7.inplace.user.presentation.dto.LikedInfluencerResponse; @@ -24,7 +28,7 @@ public class UserController implements UserControllerApiSepc { @PatchMapping("/nickname") public ResponseEntity updateNickname( - @RequestParam String nickname + @RequestBody String nickname ) { userService.updateNickname(nickname); return new ResponseEntity<>(HttpStatus.OK); @@ -32,28 +36,28 @@ public ResponseEntity updateNickname( @GetMapping("/influencers") public ResponseEntity> getMyFavoriteInfluencers( - @PageableDefault(page = 0, size = 10) Pageable pageable + @PageableDefault(page = 0, size = 10) Pageable pageable ) { Page influencers = userFacade.getMyFavoriteInfluencers(pageable) - .map(LikedInfluencerResponse::from); + .map(LikedInfluencerResponse::from); return new ResponseEntity<>(influencers, HttpStatus.OK); } @GetMapping("/places") public ResponseEntity> getMyFavoritePlaces( - @PageableDefault(page = 0, size = 10) Pageable pageable + @PageableDefault(page = 0, size = 10) Pageable pageable ) { Page places = userFacade.getMyFavoritePlaces(pageable) - .map(LikedPlaceResponse::from); + .map(LikedPlaceResponse::from); return new ResponseEntity<>(places, HttpStatus.OK); } @GetMapping("/reviews") public ResponseEntity> getMyReviews( - @PageableDefault(page = 0, size = 10) Pageable pageable + @PageableDefault(page = 0, size = 10) Pageable pageable ) { Page reviews = userFacade.getMyReviews(pageable) - .map(MyReviewResponse::from); + .map(MyReviewResponse::from); return new ResponseEntity<>(reviews, HttpStatus.OK); }