Skip to content

Commit

Permalink
fix : @RequestParm으로 일단 대체
Browse files Browse the repository at this point in the history
  • Loading branch information
dltjdgh0428 committed Mar 28, 2024
1 parent d3bc95b commit dfa24be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public CMRespDto<?> taggedPin(@PathVariable String content) {
return new CMRespDto<>(HttpStatus.OK, result,"태그 조회 성공!"); // 이 부분 논의
}

@GetMapping("/api/mypage/notyet")
public CMRespDto<?> userReview(@AuthenticationPrincipal OAuth2User oAuth2User) {
List<ReviewDto> result = reviewService.유저모든독후감조회((Long) oAuth2User.getAttributes().get("id"));
@GetMapping("/api/mypage/review")
public CMRespDto<?> userReview(@RequestParam Long socialId) {
List<ReviewDto> result = reviewService.유저모든독후감조회(socialId);
return new CMRespDto<>(HttpStatus.OK, result,"모든 독후감 조회 성공!");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,28 @@ public CMRespDto<?> addReview(@RequestBody ReviewRespDto reviewRespDto) {
//조회
//공개 독후감 조회
@GetMapping("/api/reviews")
public CMRespDto<?> publicReviews() {
public CMRespDto<?> publicReviews(@RequestParam Long socialId) {
List<ReviewDto> result = reviewService.모든독후감조회();
return new CMRespDto<>(HttpStatus.OK, result, "전체 공유 독후감 조회");
}

@GetMapping("/api/review/public")
public CMRespDto<?> findPublicReviews() {
public CMRespDto<?> findPublicReviews(@RequestParam Long socialId) {
List<ReviewDto> result = reviewService.모든공유독후감조회();
return new CMRespDto<>(HttpStatus.OK, result, "모든 공유 독후감 조회 완료");
}


@GetMapping("/api/detail/{bookId}")
public CMRespDto<?> bookReviews(@AuthenticationPrincipal OAuth2User oAuth2User, @PathVariable Long bookId) {
List<ReviewDto> result = reviewService.책에따른모든리뷰((Long) oAuth2User.getAttributes().get("id"), bookId);
public CMRespDto<?> bookReviews(@RequestParam Long socialId, @PathVariable Long bookId) {
List<ReviewDto> result = reviewService.책에따른모든리뷰(socialId, bookId);
return new CMRespDto<>(HttpStatus.OK, result, "책에 따른 전체 독후감 조회");
}

//수정
@GetMapping("/api/review/{reviewId}")
public CMRespDto<?> getReview(@AuthenticationPrincipal OAuth2User oAuth2User, @PathVariable Long reviewId) {
ReviewDto reviewDto = reviewService.단일독후감조회((Long) oAuth2User.getAttributes().get("id"), reviewId);
public CMRespDto<?> getReview(@RequestParam Long socialId, @PathVariable Long reviewId) {
ReviewDto reviewDto = reviewService.단일독후감조회(socialId, reviewId);
return new CMRespDto<>(HttpStatus.OK, reviewDto, "단일 독후감 조회");
}

Expand Down Expand Up @@ -117,14 +117,14 @@ public CMRespDto<?> deleteReview(@PathVariable Long reviewId,
// 좋아요 구현

@PostMapping("/api/review/{reviewId}/likes")
public CMRespDto<?> like(@AuthenticationPrincipal OAuth2User oAuth2User, @PathVariable Long reviewId) {
likesService.좋아요((Long) oAuth2User.getAttributes().get("id"), reviewId);
public CMRespDto<?> like(@RequestParam Long socialId, @PathVariable Long reviewId) {
likesService.좋아요(socialId, reviewId);
return new CMRespDto<>(HttpStatus.OK, null, "좋아요 등록 완료!");
}

@DeleteMapping("/api/review/{reviewId}/likes")
public CMRespDto<?> unLike(@AuthenticationPrincipal OAuth2User oAuth2User, @PathVariable Long reviewId) {
likesService.좋아요취소((Long) oAuth2User.getAttributes().get("id"), reviewId);
public CMRespDto<?> unLike(@RequestParam Long socialId, @PathVariable Long reviewId) {
likesService.좋아요취소(socialId, reviewId);
return new CMRespDto<>(HttpStatus.OK, null, "좋아요 취소 완료!");
}
}

0 comments on commit dfa24be

Please sign in to comment.