PatientFegin.java 861 B

12345678910111213141516171819202122
  1. package com.yihu.jw.fegin;
  2. import com.yihu.jw.fegin.fallback.PatientFeginFallback;
  3. import org.springframework.cloud.netflix.feign.FeignClient;
  4. import org.springframework.web.bind.annotation.RequestMapping;
  5. import org.springframework.web.bind.annotation.RequestMethod;
  6. import org.springframework.web.bind.annotation.RequestParam;
  7. /**
  8. * Created by chenweida on 2017/5/10.
  9. */
  10. @FeignClient(
  11. name = "svr-base", // name值是eurika的实例名字
  12. fallback = PatientFeginFallback.class// fallback是请求超时或者错误的回调函数
  13. // ,configuration = //可以配置当个fegin的配置 例如禁用单个feign的hystrix
  14. )
  15. public interface PatientFegin {
  16. @RequestMapping(value = "/patient/findByCode", method = RequestMethod.GET)
  17. public String findByCode(@RequestParam(value = "code", required = true) String code);
  18. }