ERROR 151704

이경헌·2024년 12월 2일

Caused by: java.lang.IllegalStateException: Body parameters cannot be used with form parameters.

수정전

@FeignClient(name = "comment-client", url = "http://localhost:8090/back/posts/{postId}/comments")
public interface CommentClient {

	@GetMapping
	ResponseEntity<List<GetCommentResponse>> getCommentsByPostId(@PathVariable Long postId);

	@PostMapping
	ResponseEntity<Void> createComment(@PathVariable Long postId, @RequestBody CreateCommentRequest request);

	@PutMapping("/{commentId}")
	ResponseEntity<Void> updateComment(@PathVariable Long postId, @PathVariable Long commentId,
		@RequestBody UpdateCommentRequest request);

	@DeleteMapping("/{commentId}")
	ResponseEntity<Void> deleteComment(@PathVariable Long postId, @PathVariable Long commentId);
}

수정후

@FeignClient(name = "comment-client", url = "http://localhost:8090/back/posts")
public interface CommentClient {

	@GetMapping("/{postId}/comments")
	ResponseEntity<List<GetCommentResponse>> getCommentsByPostId(@PathVariable Long postId);

	@PostMapping("/{postId}/comments")
	ResponseEntity<Void> createComment(@PathVariable Long postId, @RequestBody CreateCommentRequest request);

	@PutMapping("/{postId}/comments/{commentId}")
	ResponseEntity<Void> updateComment(@PathVariable Long postId, @PathVariable Long commentId,
		@RequestBody UpdateCommentRequest request);

	@DeleteMapping("/{postId}/comments/{commentId}")
	ResponseEntity<Void> deleteComment(@PathVariable Long postId, @PathVariable Long commentId);
}

0개의 댓글