FeignTestService.java 520 B

123456789101112131415161718
  1. package com.ruoyi.demo.feign;
  2. import com.ruoyi.demo.feign.fallback.FeignTestFallback;
  3. import org.springframework.cloud.openfeign.FeignClient;
  4. import org.springframework.web.bind.annotation.GetMapping;
  5. import org.springframework.web.bind.annotation.RequestParam;
  6. /**
  7. * feign测试service
  8. *
  9. * @author Lion Li
  10. */
  11. @FeignClient(name = "baidu",url = "http://www.baidu.com",fallback = FeignTestFallback.class)
  12. public interface FeignTestService {
  13. @GetMapping("/s")
  14. String search(@RequestParam("wd") String wd);
  15. }