提交 d1e0846f 编写于 作者: zhouweidong's avatar zhouweidong

feign serviceId动态化配置

上级 fd33cc66
......@@ -40,6 +40,7 @@ zuul:
<#assign serviceId=systemName+"-"+sysApi>
</#if>
<#if serviceId!="">
<#assign serviceId="$"+"{ibiz.ref.service."+serviceId+":"+serviceId+"}">
${appEntity}:
path: /${serviceUrl}/**
serviceId: ${serviceId}
......@@ -49,30 +50,30 @@ zuul:
<#if haswfentity==true>
wfcore:
path: /wfcore/**
serviceId: ibzwf-api
serviceId: ${r'${ibiz.ref.service.wf:ibzwf-api}'}
stripPrefix: true
</#if>
<#if sys.getPSSystemSetting()?? && sys.getPSSystemSetting().getDataAccCtrlArch()?? && sys.getPSSystemSetting().getDataAccCtrlArch()==1>
loginv7:
path: /v7/login
serviceId: ibzuaa-api
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
changepwd:
path: /v7/changepwd
serviceId: ibzuaa-api
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
uaa:
path: /uaa/**
serviceId: ibzuaa-api
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
config:
path: /config/**
serviceId: ibzuaa-api
serviceId: ${r'${ibiz.ref.service.uaa:ibzuaa-api}'}
stripPrefix: false
<#if sys.getCodeName()!='ibzou' && sys.getCodeName()!='ibzrt'>
oucore:
path: /ibzorganizations/**
serviceId: ibzou-api
serviceId: ${r'${ibiz.ref.service.ou:ibzou-api}'}
stripPrefix: false
</#if>
</#if>
......
......@@ -25,10 +25,15 @@ import org.springframework.cloud.openfeign.FeignClient;
</#if>
<#comment>contextId存在下划线时,项目运行报错,模板中转中划线处理</#comment>
<#assign contextId=item.codeName?replace("_","-")>
<#if ((item.getPSSubSysServiceAPI().getServiceCodeName())!'')!=''>
<#assign serviceId="$"+"{ibiz.ref.service."+item.getPSSubSysServiceAPI().getServiceCodeName()+":"+item.getPSSubSysServiceAPI().getServiceCodeName()+"}">
<#else>
<#assign serviceId="$"+"{ibiz.ref.service."+item.getPSSubSysServiceAPI().codeName+":}">
</#if>
/**
* 实体[${item.codeName}] 服务对象接口
*/
@FeignClient(value = "${(item.getPSSubSysServiceAPI().getServiceCodeName())!''}", contextId = "${contextId}", fallback = ${item.codeName}Fallback.class)
@FeignClient(value = "${serviceId}", contextId = "${contextId}", fallback = ${item.codeName}Fallback.class)
public interface ${item.codeName}FeignClient {
<#if item.getPSSubSysServiceAPIDEMethods()??>
......
......@@ -10,7 +10,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import java.util.Map;
import java.util.Set;
@FeignClient(value = "ibzou-api",fallback = IBZOUFallback.class)
@FeignClient(value = "${r'${ibiz.ref.service.ou:ibzou-api}'}",fallback = IBZOUFallback.class)
public interface IBZOUFeignClient
{
/**
......
......@@ -10,7 +10,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import com.alibaba.fastjson.JSONObject;
@FeignClient(value = "ibzuaa-api",fallback = IBZUAAFallback.class)
@FeignClient(value = "${r'${ibiz.ref.service.uaa:ibzuaa-api}'}",fallback = IBZUAAFallback.class)
public interface IBZUAAFeignClient
{
/**
......
......@@ -7,7 +7,7 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import java.util.*;
@FeignClient(value = "ibzwf-api",fallback = IBZWFFallback.class)
@FeignClient(value = "${r'${ibiz.ref.service.wf:ibzwf-api}'}",fallback = IBZWFFallback.class)
public interface IBZWFFeignClient
{
@RequestMapping(method = RequestMethod.GET, value = "/{system}-app-{appname}/{entity}/process-definitions/{processDefinitionKey}/usertasks/{taskDefinitionKey}/tasks")
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册