2021-01-27 15:15:03 +08:00
|
|
|
package com.ruoyi.demo.feign;
|
|
|
|
|
2021-06-16 19:24:26 +08:00
|
|
|
import com.ruoyi.demo.feign.constant.FeignTestConstant;
|
2021-01-27 15:15:03 +08:00
|
|
|
import com.ruoyi.demo.feign.fallback.FeignTestFallback;
|
|
|
|
import org.springframework.cloud.openfeign.FeignClient;
|
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
|
2021-05-10 15:34:17 +08:00
|
|
|
/**
|
|
|
|
* feign测试service
|
2021-06-16 19:24:26 +08:00
|
|
|
* 规范接口 Service 无感调用
|
|
|
|
* 常量管理请求路径 更加规范
|
2021-09-03 11:43:34 +08:00
|
|
|
* 自定义容错处理 安全可靠 (需自行配置熔断器)
|
|
|
|
* 增加 feign 的目的为使 http 请求接口化
|
|
|
|
*
|
2021-05-10 15:34:17 +08:00
|
|
|
* @author Lion Li
|
2021-10-15 15:55:44 +08:00
|
|
|
* @deprecated 由于使用人数较少 决定与 3.4.0 版本移除
|
2021-05-10 15:34:17 +08:00
|
|
|
*/
|
2021-06-16 19:24:26 +08:00
|
|
|
@FeignClient(
|
|
|
|
name = FeignTestConstant.BAIDU_NAME,
|
|
|
|
url = FeignTestConstant.BAIDU_URL,
|
|
|
|
fallback = FeignTestFallback.class)
|
2021-01-27 15:15:03 +08:00
|
|
|
public interface FeignTestService {
|
|
|
|
|
|
|
|
@GetMapping("/s")
|
|
|
|
String search(@RequestParam("wd") String wd);
|
|
|
|
}
|