Description:
Field restTemplate in com.imooc.controller.OrdersController required a bean of type 'org.springframework.web.client.RestTemplate' that could not be found.
The injection point has the following annotations:
- @org.springframework.beans.factory.annotation.Autowired(required=true)
Action:
Consider defining a bean of type 'org.springframework.web.client.RestTemplate' in your configuration.
解决办法:在启动类中添加:
@Bean
public RestTemplate restTemplate(RestTemplateBuilder builder){
return builder.build();
}
这样,即可解决