client配置
@FeignClient(value = "user-service")
public interface UserClient {
//http://user-service/user/123
@GetMapping("/user/{id}")
User queryById(@PathVariable int id);
}
配置完后再运行这个消费服务的时候抛出了一个异常
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'consumerFeignController': Unsatisfied dependency expressed through method 'setUserClient' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.consumer.client.UserClient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param 0.
后来在