PatientFegin.java 1.1 KB

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