Skip to content

ReveeWu/feign-proxy-spring-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feign Controller 自动生成Starter

使用SpringCloud项目需要写Service对应Controller来对外部提供服务,该项目用来简化此步骤

使用步骤

  1. 启用代理功能
+ @EnableFeignProxy
public class TestApplication {

}
  1. 在需要的代理的Service上添加@FeignProxy注解
+ @FeignProxy
public interface TestService {
    @GetMapping("/sayHello")
    String sayHello();
}
  1. 会自动生成/sayHello接口
curl /sayHello
# return hello

其他

  1. 默认Service必须和ServiceImpl成对应关系,例如Service为Service则ServiceImpl必须为impl.ServiceImpl,可以通过实现EnableFeignProxy.ImplClassProvider自定义查找逻辑

  2. 版本号对应SpringBoot版本号

About

Feign Controller 自动生成Starter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages