From d87683f9f90c80f808968bf00a371aa3429d39dc Mon Sep 17 00:00:00 2001 From: slavisa-baeldung Date: Sun, 25 Jun 2017 21:51:44 +0100 Subject: [PATCH] BAEL-947 - moving from @GetMapping to @RequestMapping on account of https://github.com/spring-cloud/spring-cloud-netflix/issues/760 --- .../cloud/bootstrap/gateway/client/book/BooksClient.java | 8 ++++++-- .../bootstrap/gateway/client/rating/RatingsClient.java | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) 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 67e8f882ad..f60f65d23c 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 @@ -1,10 +1,14 @@ package com.baeldung.spring.cloud.bootstrap.gateway.client.book; import org.springframework.cloud.netflix.feign.FeignClient; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; @FeignClient(value = "book-service") public interface BooksClient { - @GetMapping("/books/{bookId}") + + @RequestMapping(value = "/books/{bookId}", method = {RequestMethod.GET}) 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 4e87374b66..9728111c5e 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 @@ -11,6 +11,7 @@ import java.util.List; @FeignClient(value = "rating-service") public interface RatingsClient { - @GetMapping("/ratings") + + @RequestMapping(value = "/ratings", method = {RequestMethod.GET}) List getRatingsByBookId(@RequestParam("bookId") Long bookId, @RequestHeader("Cookie") String session); }