Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/main/java/com/issueDive/controller/CommentController.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,27 @@ public ResponseEntity<ApiResponse<List<CommentResponse>>> getComment(@PathVariab

@PostMapping
public ResponseEntity<ApiResponse<CommentResponse>> createComment(@PathVariable Long issueId, @RequestBody @Valid CreateCommentRequest request
,@RequestHeader("X-USER-ID") Long userId){

// ,@RequestHeader("X-USER-ID") Long userId){
){
Long userId = 1L; // 임시 사용자 ID // JWT 기능 구현 완료 시 변경
CommentResponse created = commentService.createComment(issueId, request, userId);
return ResponseEntity.status(HttpStatus.CREATED).body(ApiResponse.ok(created));
}

@PatchMapping("/{commentId}")
public ResponseEntity<ApiResponse<CommentResponse>> updateComment(@PathVariable Long issueId, @PathVariable Long commentId, @RequestBody @Valid UpdateCommentRequest request, @RequestHeader("X-USER-ID") Long userId){
public ResponseEntity<ApiResponse<CommentResponse>> updateComment(@PathVariable Long issueId, @PathVariable Long commentId, @RequestBody @Valid UpdateCommentRequest request
// , @RequestHeader("X-USER-ID") Long userId){
){
Long userId = 1L; // 임시 사용자 ID // JWT 기능 구현 완료 시 변경
CommentResponse updated = commentService.updateComment(issueId, commentId, request, userId);
return ResponseEntity.ok(ApiResponse.ok(updated));
}

@DeleteMapping("/{commentId}")
public ResponseEntity<?> deleteComment(@PathVariable Long issueId, @PathVariable Long commentId, @RequestHeader("X-USER-ID") Long userId){
public ResponseEntity<?> deleteComment(@PathVariable Long issueId, @PathVariable Long commentId
// , @RequestHeader("X-USER-ID") Long userId){
){
Long userId = 1L; // 임시 사용자 ID // JWT 기능 구현 완료 시 변경
commentService.deleteComment(issueId, commentId, userId);
return ResponseEntity.noContent().build();
}
Expand Down
Loading