From 9e3e240a596a04192e3a672df2e46b8c590e0b9b Mon Sep 17 00:00:00 2001 From: Grzegorz Piwowarek Date: Sat, 24 Jun 2017 19:44:41 +0200 Subject: [PATCH] Refactor Gateway clients (#2144) --- .../cloud/bootstrap/gateway/client/book/BooksClient.java | 2 +- .../cloud/bootstrap/gateway/client/rating/RatingsClient.java | 3 ++- 2 files changed, 3 insertions(+), 2 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 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); }