Fegin的使用总结

/**
*
* @Description: 修改microservicecloud-api工程,根据已经有的DeptClientService接口

新建,MICROSERVICECLOUD-DEPT指的是注册中心的服务列表

一个实现了FallbackFactory接口的类DeptClientServiceFallbackFactory
* @author zzq
* @date 2019年11月17日
*/
//@FeignClient(value = "MICROSERVICECLOUD-DEPT")
@FeignClient(value = "MICROSERVICECLOUD-DEPT",fallbackFactory=DeptClientServiceFallbackFactory.class)
public interface DeptClientService
{
@RequestMapping(value = "/dept/get/{id}", method = RequestMethod.GET)
public Dept get(@PathVariable("id") long id);

@RequestMapping(value = "/dept/list", method = RequestMethod.GET)
public List<Dept> list();

@RequestMapping(value = "/dept/add", method = RequestMethod.POST)

上一篇:Fegin 解决多文件上传问题


下一篇:spring cloud之Fegin简单实例