小编Die*_*oMG的帖子

@FeignClient 接口上不允许使用 @RequestMapping 注解

我遇到了麻烦!正如我一直在阅读的那样,这种情况的发生是因为它不再被接受。但我该如何解决呢?这是我一直在尝试映射的代码。

@FeignClient(name = "product-service")
@RequestMapping("api/products/")
public interface ProductClient {

    @GetMapping("/{id}")
    ResponseEntity<Product> getProduct(@PathVariable("id") Long id);

    @GetMapping("/{id}/stock")
    ResponseEntity<Product> updateStockProduct(@PathVariable("id") Long id,@RequestParam(name = "quantity", required = true) Integer quantity);
}
Run Code Online (Sandbox Code Playgroud)

预先感谢您的任何建议或解决方案!

spring-boot request-mapping spring-cloud-feign

16
推荐指数
1
解决办法
9878
查看次数