diff --git a/src/main/java/com/listywave/list/application/service/CommentService.java b/src/main/java/com/listywave/list/application/service/CommentService.java index e3cadab3..05e91c99 100644 --- a/src/main/java/com/listywave/list/application/service/CommentService.java +++ b/src/main/java/com/listywave/list/application/service/CommentService.java @@ -32,9 +32,10 @@ public class CommentService { private final ReplyRepository replyRepository; private final CommentRepository commentRepository; - public CommentCreateResponse create(Long listId, String accessToken, String content) { - Long userId = jwtManager.read(accessToken); - User user = userRepository.getById(userId); + public CommentCreateResponse create(Long listId, String content) { + // TODO: 프론트 단에서 댓글 생성 테스트 끝나면 원래대로 복구 +// Long userId = jwtManager.read(accessToken); + User user = userRepository.getById(1L); Lists list = listRepository.getById(listId); Comment comment = Comment.create(list, user, content); @@ -70,10 +71,10 @@ public CommentFindResponse getComments(Long listId, int size, Long cursorId) { return CommentFindResponse.from(totalCount, cursorIdOfResult, hasNext, result); } - public void delete(Long listId, String accessToken, Long commentId) { - - Long userId = jwtManager.read(accessToken); - userRepository.getById(userId); + public void delete(Long listId, Long commentId) { + // TODO: 프론트 단에서 댓글 생성 테스트 끝나면 원래대로 복구 +// Long userId = jwtManager.read(accessToken); +// userRepository.getById(userId); listRepository.getById(listId); Comment comment = commentRepository.getById(commentId); diff --git a/src/main/java/com/listywave/list/presentation/controller/CommentController.java b/src/main/java/com/listywave/list/presentation/controller/CommentController.java index 238dfcbd..25edca68 100644 --- a/src/main/java/com/listywave/list/presentation/controller/CommentController.java +++ b/src/main/java/com/listywave/list/presentation/controller/CommentController.java @@ -13,7 +13,6 @@ import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; @@ -28,10 +27,10 @@ public class CommentController { @PostMapping ResponseEntity create( @PathVariable(value = "listId") Long listId, - @RequestHeader(value = "Authorization", defaultValue = "") String accessToken, +// @RequestHeader(value = "Authorization", defaultValue = "") String accessToken, @RequestBody CommentCreateRequest commentCreateRequest ) { - CommentCreateResponse response = commentService.create(listId, accessToken, commentCreateRequest.content()); + CommentCreateResponse response = commentService.create(listId, commentCreateRequest.content()); return ResponseEntity.status(CREATED).body(response); } @@ -48,10 +47,10 @@ ResponseEntity getAllCommentsByList( @DeleteMapping("/{commentId}") ResponseEntity delete( @PathVariable(value = "listId") Long listId, - @RequestHeader(value = "Authorization", defaultValue = "") String accessToken, +// @RequestHeader(value = "Authorization", defaultValue = "") String accessToken, @PathVariable(value = "commentId") Long commentId ) { - commentService.delete(listId, accessToken, commentId); + commentService.delete(listId, commentId); return ResponseEntity.noContent().build(); } }