一、FeignClient接口,不能使用@GettingMapping 之类的组合注解
代码示例:
@FeignClient("microservice-provider-user")
public interface UserFeignClient {
@RequestMapping(value = "/simple/{id}", method = RequestMethod.GET)
public User findById(@PathVariable("id") Long id);
...
}
这边的@RequestMapping(value = "/simple/{id}", method = RequestMethod.GET)不能写成@GetMapping("/simple/{id}")。
二、FeignClient接口中,如果使用到@PathVariable ,必须指定其value
代码示例:
@FeignClient("microservice-provider-user")
public interface UserFeignClient {
@RequestMapping(value = "/simple/{id}", method = RequestMethod.GET)
public User findById(@PathVariable("id") Long id);
...
}
这边的@PathVariable