使用feign时
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘xxx’
Caused by: org.springframework.beans.factory.BeanCreationException
注入bean失败
原因: **使用@PathVariable需要指定值 例User findById(@PathVariable(“id”) Long id); **
//声明当前类是一个Feign客户端,指定服务名为user-service
@FeignClient("user-service")
public interface UserClient {
@GetMapping("/user/{id}")
//指定@PathVariable("id")
User findById(@PathVariable("id") Long id);
}