remove 移除 feign 相关代码与依赖

This commit is contained in:
疯狂的狮子li
2021-11-03 15:02:29 +08:00
parent 95dcae1a85
commit 8a93371baa
15 changed files with 9 additions and 337 deletions

View File

@ -1,37 +0,0 @@
package com.ruoyi.demo.controller;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.demo.feign.FeignTestService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* feign测试controller
*
* @author Lion Li
* @deprecated 由于使用人数较少 决定与 3.4.0 版本移除
*/
@Api(value = "feign测试", tags = {"feign测试"})
@RequiredArgsConstructor(onConstructor_ = @Autowired)
@RestController
@RequestMapping("/feign/test")
public class FeignTestController {
private final FeignTestService feignTestService;
/**
* 搜索数据
*/
@ApiOperation("测试使用feign请求数据")
@GetMapping("/search/{wd}")
public AjaxResult search(@PathVariable String wd) {
String search = feignTestService.search(wd);
return AjaxResult.success("操作成功",search);
}
}

View File

@ -1,27 +0,0 @@
package com.ruoyi.demo.feign;
import com.ruoyi.demo.feign.constant.FeignTestConstant;
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;
/**
* feign测试service
* 规范接口 Service 无感调用
* 常量管理请求路径 更加规范
* 自定义容错处理 安全可靠 (需自行配置熔断器)
* 增加 feign 的目的为使 http 请求接口化
*
* @author Lion Li
* @deprecated 由于使用人数较少 决定与 3.4.0 版本移除
*/
@FeignClient(
name = FeignTestConstant.BAIDU_NAME,
url = FeignTestConstant.BAIDU_URL,
fallback = FeignTestFallback.class)
public interface FeignTestService {
@GetMapping("/s")
String search(@RequestParam("wd") String wd);
}

View File

@ -1,13 +0,0 @@
package com.ruoyi.demo.feign.constant;
/**
* @deprecated 由于使用人数较少 决定与 3.4.0 版本移除
*/
@Deprecated
public class FeignTestConstant {
public static final String BAIDU_NAME = "baidu";
public static final String BAIDU_URL = "http://www.baidu.com";
}

View File

@ -1,28 +0,0 @@
package com.ruoyi.demo.feign.fallback;
import com.ruoyi.demo.feign.FeignTestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* feign测试fallback
* 自定义封装结构体熔断
* 需重写解码器 根据自定义实体 自行解析熔断
*
* 熔断器需要自行添加配置
*
* @see {com.ruoyi.framework.config.FeignConfig#errorDecoder()}
* @author Lion Li
* @deprecated 由于使用人数较少 决定与 3.4.0 版本移除
*/
@Slf4j
@Component
public class FeignTestFallback implements FeignTestService {
@Override
public String search(String wd) {
log.error("fallback");
return "报错啦";
}
}

View File

@ -1 +0,0 @@
package com.ruoyi.demo.feign.fallback;

View File

@ -1 +0,0 @@
package com.ruoyi.demo.feign;