update 更新 feign demo 更清晰的用法

This commit is contained in:
疯狂的狮子li 2021-06-16 19:24:26 +08:00
parent 9f856e9ec2
commit a0392865f4
1 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,6 @@
package com.ruoyi.demo.feign; package com.ruoyi.demo.feign;
import com.ruoyi.demo.feign.constant.FeignTestConstant;
import com.ruoyi.demo.feign.fallback.FeignTestFallback; import com.ruoyi.demo.feign.fallback.FeignTestFallback;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -7,10 +8,15 @@ import org.springframework.web.bind.annotation.RequestParam;
/** /**
* feign测试service * feign测试service
* * 规范接口 Service 无感调用
* 常量管理请求路径 更加规范
* 自定义容错处理 安全可靠
* @author Lion Li * @author Lion Li
*/ */
@FeignClient(name = "baidu",url = "http://www.baidu.com",fallback = FeignTestFallback.class) @FeignClient(
name = FeignTestConstant.BAIDU_NAME,
url = FeignTestConstant.BAIDU_URL,
fallback = FeignTestFallback.class)
public interface FeignTestService { public interface FeignTestService {
@GetMapping("/s") @GetMapping("/s")