fegin测试时候报错了

fegin测试时候报错了,不清楚什么原因请大神帮忙看下,和老师敲的代码一样,不知道为什么我的报错了,人家的不报错

 

cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'consumerfeigncontroller': Unsatisfied dependency expressed through field 'userclient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.haohao.consumer.client.userclient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param 0.
2021-06-10 10:59:06.345  INFO 21360 --- [           main] o.apache.catalina.core.StandardService   : Stopping service [Tomcat]
2021-06-10 10:59:06.371  INFO 21360 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-06-10 10:59:06.392 ERROR 21360 --- [           main] o.s.boot.SpringApplication               : Application run failed

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'consumerfeigncontroller': Unsatisfied dependency expressed through field 'userclient'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.haohao.consumer.client.userclient': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param 0.

 

自己的代码:

feigncontroller代码:

 

application启动代码

建议先规范代码编写

使用Feign进行代理的时候,所有接口参数必须写上@PathVariable注解,并且参数保持一致你看看哪漏了,还有你老师肯定不是这么敲的。。命名要规范,这么看着绿线不难受吗hhh

网上说是feign中使用pathVariable要指定value

https://www.cnblogs.com/huhuixin/p/7797850.html