添加引用
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-openfeign-core</artifactId>
<version> 2.2.7.RELEASE</version>
</dependency>
Application上加入注解
@EnableFeignClients
public class SurveyActionApiApplication {
public static void main(String[] args) {
SpringApplication.run(SurveyActionApiApplication.class, args);
}
}
服务之间接口调用如下:加入注解@FeignClient
@FeignClient(value = "调用服务名")
@RequestMapping("/open-api/")
public interface XxlJobFeignProxy {
@RequestMapping("add")
ReturnT<String> add(info jobInfo);
}