diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/book/BooksClient.java b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/book/BooksClient.java index beba760f10..67e8f882ad 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/book/BooksClient.java +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/book/BooksClient.java @@ -5,6 +5,6 @@ import org.springframework.web.bind.annotation.*; @FeignClient(value = "book-service") public interface BooksClient { - @RequestMapping(method = RequestMethod.GET, value="/books/{bookId}") + @GetMapping("/books/{bookId}") Book getBookById(@PathVariable("bookId") Long bookId); } diff --git a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/rating/RatingsClient.java b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/rating/RatingsClient.java index e82202e5a7..4e87374b66 100644 --- a/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/rating/RatingsClient.java +++ b/spring-cloud/spring-cloud-bootstrap/gateway/src/main/java/com/baeldung/spring/cloud/bootstrap/gateway/client/rating/RatingsClient.java @@ -1,6 +1,7 @@ package com.baeldung.spring.cloud.bootstrap.gateway.client.rating; import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -10,6 +11,6 @@ import java.util.List; @FeignClient(value = "rating-service") public interface RatingsClient { - @RequestMapping(method = RequestMethod.GET, value="/ratings") + @GetMapping("/ratings") List getRatingsByBookId(@RequestParam("bookId") Long bookId, @RequestHeader("Cookie") String session); }