Spring Boot集成feign

添加引用
<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);

}
上一篇:课得软件丨发展方向一览 | 35岁以后,程序员都去哪里了


下一篇:SpringMVC中model的理解