Skip to content

Commit

Permalink
refactor: 페이징 변경에 따른 반환값 수정
Browse files Browse the repository at this point in the history
Related to: #139
Ref: #136
  • Loading branch information
hgh1472 committed Oct 20, 2024
1 parent b79ba9e commit 9c6e2c2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package core.application.movies.controller;

import java.util.List;
import java.util.UUID;

import org.springframework.data.domain.Page;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
Expand Down Expand Up @@ -44,9 +44,9 @@ public class CommentController {
@Parameter(name = "sortType", description = "정렬 타입", example = "LIKE")
})
@GetMapping("/{movieId}/comments")
public ApiResponse<List<CommentRespDTO>> getComments(@PathVariable String movieId,
public ApiResponse<Page<CommentRespDTO>> getComments(@PathVariable String movieId,
@RequestParam int page, @RequestParam String sortType, @AuthenticationPrincipal CustomUserDetails userDetails) {
List<CommentRespDTO> comments;
Page<CommentRespDTO> comments;
UUID userId;
if (userDetails == null) {
userId = null;
Expand Down Expand Up @@ -97,7 +97,8 @@ public ApiResponse<Message> incrementCommentLike(@PathVariable Long commentId,

@Operation(summary = "한줄평 좋아요 취소")
@DeleteMapping("/{movieId}/comments/{commentId}/like")
public ApiResponse<Message> decrementCommentLike(@PathVariable Long commentId, @AuthenticationPrincipal CustomUserDetails userDetails) {
public ApiResponse<Message> decrementCommentLike(@PathVariable Long commentId,
@AuthenticationPrincipal CustomUserDetails userDetails) {
UUID userId = userDetails.getUserId();
commentService.decrementCommentLike(commentId, userId);
return ApiResponse.onDeleteSuccess(Message.createMessage("한줄평 좋아요 취소 성공"));
Expand Down

0 comments on commit 9c6e2c2

Please sign in to comment.