7 changed files with 99 additions and 3 deletions
@ -0,0 +1,30 @@ |
|||
package com.elink.esua.epdc.modules.feign; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.category.EpmetCategoryCodeOption; |
|||
import com.elink.esua.epdc.modules.feign.fallback.AnalysisFeignClientFallback; |
|||
import org.springframework.cloud.openfeign.FeignClient; |
|||
import org.springframework.http.MediaType; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
|
|||
/** |
|||
* 数据分析模块调用 |
|||
* |
|||
* @Author:liuchuang |
|||
* @Date:2020/9/9 15:41 |
|||
*/ |
|||
@FeignClient(name = ServiceConstant.EPDC_ANALYSIS_SERVER, fallback = AnalysisFeignClientFallback.class,url = "http://localhost:9077") |
|||
public interface AnalysisFeignClient { |
|||
|
|||
/** |
|||
* @Description 组织机构编码获取 |
|||
* @Author songyunpeng |
|||
* @Date 2021/1/7 |
|||
* @Param [] |
|||
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|||
**/ |
|||
@GetMapping(value = "analysis/category/getCategoryCode", consumes = MediaType.APPLICATION_JSON_VALUE) |
|||
Result<EpmetCategoryCodeOption> getCategoryCode(); |
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.elink.esua.epdc.modules.feign.fallback; |
|||
|
|||
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant; |
|||
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils; |
|||
import com.elink.esua.epdc.commons.tools.utils.Result; |
|||
import com.elink.esua.epdc.dto.category.EpmetCategoryCodeOption; |
|||
import com.elink.esua.epdc.modules.feign.AnalysisFeignClient; |
|||
import org.springframework.stereotype.Component; |
|||
|
|||
/** |
|||
* @Author:songyunpeg |
|||
* @Date:2020/9/9 15:42 |
|||
*/ |
|||
@Component |
|||
public class AnalysisFeignClientFallback implements AnalysisFeignClient { |
|||
|
|||
|
|||
@Override |
|||
public Result<EpmetCategoryCodeOption> getCategoryCode() { |
|||
return ModuleUtils.feignConError(ServiceConstant.EPDC_ANALYSIS_SERVER, "getCategoryCode"); |
|||
} |
|||
} |
Loading…
Reference in new issue