Skip to content

Commit

Permalink
Merge pull request #226 from kakao-tech-campus-2nd-step3/docs/#185-re…
Browse files Browse the repository at this point in the history
…adme

[fix] nickname 변경할때 바디로 받음
  • Loading branch information
BaeJunH0 authored Nov 15, 2024
2 parents 98595af + 6dd5f7a commit 32923b3
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions src/main/java/team7/inplace/user/presentation/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,36 +28,36 @@ public class UserController implements UserControllerApiSepc {

@PatchMapping("/nickname")
public ResponseEntity<Void> updateNickname(
@RequestParam String nickname
@RequestBody String nickname
) {
userService.updateNickname(nickname);
return new ResponseEntity<>(HttpStatus.OK);
}

@GetMapping("/influencers")
public ResponseEntity<Page<LikedInfluencerResponse>> getMyFavoriteInfluencers(
@PageableDefault(page = 0, size = 10) Pageable pageable
@PageableDefault(page = 0, size = 10) Pageable pageable
) {
Page<LikedInfluencerResponse> influencers = userFacade.getMyFavoriteInfluencers(pageable)
.map(LikedInfluencerResponse::from);
.map(LikedInfluencerResponse::from);
return new ResponseEntity<>(influencers, HttpStatus.OK);
}

@GetMapping("/places")
public ResponseEntity<Page<LikedPlaceResponse>> getMyFavoritePlaces(
@PageableDefault(page = 0, size = 10) Pageable pageable
@PageableDefault(page = 0, size = 10) Pageable pageable
) {
Page<LikedPlaceResponse> places = userFacade.getMyFavoritePlaces(pageable)
.map(LikedPlaceResponse::from);
.map(LikedPlaceResponse::from);
return new ResponseEntity<>(places, HttpStatus.OK);
}

@GetMapping("/reviews")
public ResponseEntity<Page<MyReviewResponse>> getMyReviews(
@PageableDefault(page = 0, size = 10) Pageable pageable
@PageableDefault(page = 0, size = 10) Pageable pageable
) {
Page<MyReviewResponse> reviews = userFacade.getMyReviews(pageable)
.map(MyReviewResponse::from);
.map(MyReviewResponse::from);
return new ResponseEntity<>(reviews, HttpStatus.OK);
}

Expand Down

0 comments on commit 32923b3

Please sign in to comment.